Changeset 189958 in webkit
- Timestamp:
- Sep 17, 2015 6:58:37 PM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r189948 r189958 1 2015-09-17 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] When loading viewport tests, use the normal web page viewport configuration 4 https://bugs.webkit.org/show_bug.cgi?id=149321 5 6 Reviewed by Tim Horton. 7 8 InjectedBundlePage::platformDidStartProvisionalLoadForFrame() unconditionally 9 enabled the "testing" viewport configuration, which disables page scaling. 10 11 If we're running viewport tests, we want the normal web page configuration. 12 Do that by passing a flag in the dictionary sent to InjectedBundle::beginTesting(), 13 based on whether the test is in a "viewport" directory. 14 15 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 16 (WTR::InjectedBundle::beginTesting): 17 * WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm: 18 (WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame): Deleted. 19 * WebKitTestRunner/TestInvocation.cpp: 20 (WTR::TestInvocation::shouldLogFrameLoadDelegates): 21 (WTR::TestInvocation::shouldLogHistoryClientCallbacks): 22 (WTR::TestInvocation::shouldMakeViewportFlexible): 23 (WTR::TestInvocation::invoke): 24 * WebKitTestRunner/TestInvocation.h: 25 * WebKitTestRunner/ios/TestControllerIOS.mm: 26 (WTR::TestController::platformConfigureViewForTest): 27 (WTR::shouldMakeViewportFlexible): Deleted. 28 1 29 2015-09-17 Simon Fraser <simon.fraser@apple.com> 2 30 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r189392 r189958 284 284 WKBundlePageRemoveAllUserContent(page()->page()); 285 285 286 #if PLATFORM(IOS) 287 WKBundlePageSetUseTestingViewportConfiguration(page()->page(), !booleanForKey(settings, "UseFlexibleViewport")); 288 #endif 289 286 290 m_testRunner->setShouldDumpFrameLoadCallbacks(booleanForKey(settings, "DumpFrameLoadDelegates")); 287 291 m_testRunner->setUserStyleSheetEnabled(false); -
trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm
r179409 r189958 44 44 45 45 setCrashReportApplicationSpecificInformationToURL(InjectedBundle::singleton().testRunner()->testURL()); 46 47 #if PLATFORM(IOS)48 WKBundlePageSetUseTestingViewportConfiguration(page(), true);49 #endif50 46 } 51 47 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r189908 r189958 133 133 } 134 134 135 bool TestInvocation::shouldLogFrameLoadDelegates() 135 bool TestInvocation::shouldLogFrameLoadDelegates() const 136 136 { 137 137 return urlContains("loading/"); 138 138 } 139 139 140 bool TestInvocation::shouldLogHistoryClientCallbacks() 140 bool TestInvocation::shouldLogHistoryClientCallbacks() const 141 141 { 142 142 return urlContains("globalhistory/"); 143 } 144 145 bool TestInvocation::shouldMakeViewportFlexible() const 146 { 147 return urlContains("viewport/"); 143 148 } 144 149 … … 163 168 WKRetainPtr<WKBooleanRef> dumpFrameLoadDelegatesValue = adoptWK(WKBooleanCreate(shouldLogFrameLoadDelegates())); 164 169 WKDictionarySetItem(beginTestMessageBody.get(), dumpFrameLoadDelegatesKey.get(), dumpFrameLoadDelegatesValue.get()); 170 171 WKRetainPtr<WKStringRef> useFlexibleViewportKey = adoptWK(WKStringCreateWithUTF8CString("UseFlexibleViewport")); 172 WKRetainPtr<WKBooleanRef> useFlexibleViewportValue = adoptWK(WKBooleanCreate(shouldMakeViewportFlexible())); 173 WKDictionarySetItem(beginTestMessageBody.get(), useFlexibleViewportKey.get(), useFlexibleViewportValue.get()); 165 174 166 175 WKRetainPtr<WKStringRef> dumpPixelsKey = adoptWK(WKStringCreateWithUTF8CString("DumpPixels")); -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r189908 r189958 61 61 void didRemoveSwipeSnapshot(); 62 62 63 bool shouldMakeViewportFlexible() const; 64 63 65 private: 64 66 void dumpResults(); … … 71 73 static void forceRepaintDoneCallback(WKErrorRef, void* context); 72 74 73 bool shouldLogFrameLoadDelegates() ;74 bool shouldLogHistoryClientCallbacks() ;75 bool shouldLogFrameLoadDelegates() const; 76 bool shouldLogHistoryClientCallbacks() const; 75 77 76 78 WKRetainPtr<WKURLRef> m_url; -
trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm
r189668 r189958 75 75 } 76 76 77 static bool shouldMakeViewportFlexible(const TestInvocation& test)78 {79 return test.urlContains("viewport/");80 }81 82 77 void TestController::platformResetPreferencesToConsistentValues() 83 78 { … … 94 89 void TestController::platformConfigureViewForTest(const TestInvocation& test) 95 90 { 96 if ( shouldMakeViewportFlexible(test)) {91 if (test.shouldMakeViewportFlexible()) { 97 92 const unsigned phoneViewHeight = 480; 98 93 const unsigned phoneViewWidth = 320; 99 94 100 95 mainWebView()->resizeTo(phoneViewWidth, phoneViewHeight); 101 // FIXME: more viewport config to do here. 96 // We also pass data to InjectedBundle::beginTesting() to have it call 97 // WKBundlePageSetUseTestingViewportConfiguration(false). 102 98 } 103 99 }
Note: See TracChangeset
for help on using the changeset viewer.