|
Lines 56-67
namespace TestWebKitAPI {
a/Tools/TestWebKitAPI/Tests/WebKitCocoa/TopContentInset.mm_sec1
|
| 56 |
TEST(TopContentInset, Fullscreen) |
56 |
TEST(TopContentInset, Fullscreen) |
| 57 |
{ |
57 |
{ |
| 58 |
RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); |
58 |
RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); |
| 59 |
RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]); |
|
|
| 60 |
[webView _setTopContentInset:10]; |
| 61 |
[webView _setAutomaticallyAdjustsContentInsets:NO]; |
| 62 |
[configuration preferences]._fullScreenEnabled = YES; |
59 |
[configuration preferences]._fullScreenEnabled = YES; |
| 63 |
RetainPtr<FullscreenChangeMessageHandler> handler = adoptNS([[FullscreenChangeMessageHandler alloc] init]); |
60 |
RetainPtr<FullscreenChangeMessageHandler> handler = adoptNS([[FullscreenChangeMessageHandler alloc] init]); |
| 64 |
[[configuration userContentController] addScriptMessageHandler:handler.get() name:@"fullscreenChangeHandler"]; |
61 |
[[configuration userContentController] addScriptMessageHandler:handler.get() name:@"fullscreenChangeHandler"]; |
|
|
62 |
RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100) configuration:configuration.get()]); |
| 63 |
[webView _setTopContentInset:10]; |
| 64 |
[webView _setAutomaticallyAdjustsContentInsets:NO]; |
| 65 |
|
65 |
|
| 66 |
RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]); |
66 |
RetainPtr<NSWindow> window = adoptNS([[NSWindow alloc] initWithContentRect:[webView frame] styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO]); |
| 67 |
[[window contentView] addSubview:webView.get()]; |
67 |
[[window contentView] addSubview:webView.get()]; |