Changeset 209972 in webkit
- Timestamp:
- Dec 18, 2016 12:11:48 AM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r209970 r209972 1 2016-12-17 Simon Fraser <simon.fraser@apple.com> 2 3 Fix iOS test results after r209967. 4 5 Subtracting out the status bar height was erroneously happening for all tests, 6 not just for flexible viewport tests. 7 8 Fix by plumbing WebViewSizingMode through resizeTo() and setWindowFrame(). 9 10 * WebKitTestRunner/PlatformWebView.h: 11 * WebKitTestRunner/TestController.cpp: 12 (WTR::TestController::resetStateToConsistentValues): 13 * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: 14 (WTR::PlatformWebView::resizeTo): 15 (WTR::PlatformWebView::setWindowFrame): 16 * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: 17 (WTR::PlatformWebView::resizeTo): 18 (WTR::PlatformWebView::setWindowFrame): 19 * WebKitTestRunner/ios/PlatformWebViewIOS.mm: 20 (WTR::PlatformWebView::resizeTo): 21 (WTR::PlatformWebView::setWindowFrame): 22 * WebKitTestRunner/ios/TestControllerIOS.mm: 23 (WTR::TestController::platformConfigureViewForTest): 24 * WebKitTestRunner/mac/PlatformWebViewMac.mm: 25 (WTR::PlatformWebView::resizeTo): 26 (WTR::PlatformWebView::setWindowFrame): 27 1 28 2016-12-17 Joonghun Park <jh718.park@samsung.com> 2 29 -
trunk/Tools/WebKitTestRunner/PlatformWebView.h
r204853 r209972 68 68 PlatformWindow platformWindow() { return m_window; } 69 69 static PlatformWindow keyWindow(); 70 void resizeTo(unsigned width, unsigned height); 70 71 enum class WebViewSizingMode { 72 Default, 73 HeightRespectsStatusBar 74 }; 75 76 void resizeTo(unsigned width, unsigned height, WebViewSizingMode = WebViewSizingMode::Default); 71 77 void focus(); 72 78 73 79 WKRect windowFrame(); 74 void setWindowFrame(WKRect );80 void setWindowFrame(WKRect, WebViewSizingMode = WebViewSizingMode::Default); 75 81 76 82 void didInitializeClients(); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r209798 r209972 763 763 764 764 #if PLATFORM(EFL) 765 // EFL use a real window while other ports such as Qt don't.765 // EFL uses a real window while other ports such as Qt don't. 766 766 // In EFL, we need to resize the window to the original size after calls to window.resizeTo. 767 767 WKRect rect = m_mainWebView->windowFrame(); -
trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
r199336 r209972 86 86 } 87 87 88 void PlatformWebView::resizeTo(unsigned width, unsigned height )88 void PlatformWebView::resizeTo(unsigned width, unsigned height, WebViewSizingMode) 89 89 { 90 90 // FIXME: Don't we need to resize the window too? … … 116 116 } 117 117 118 void PlatformWebView::setWindowFrame(WKRect frame )118 void PlatformWebView::setWindowFrame(WKRect frame, WebViewSizingMode) 119 119 { 120 120 ecore_evas_move_resize(m_window, frame.origin.x, frame.origin.y, frame.size.width, frame.size.height); -
trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
r191783 r209972 65 65 } 66 66 67 void PlatformWebView::resizeTo(unsigned width, unsigned height )67 void PlatformWebView::resizeTo(unsigned width, unsigned height, WebViewSizingMode sizingMode) 68 68 { 69 69 WKRect frame = windowFrame(); 70 70 frame.size.width = width; 71 71 frame.size.height = height; 72 setWindowFrame(frame );72 setWindowFrame(frame, sizingMode); 73 73 } 74 74 … … 98 98 } 99 99 100 void PlatformWebView::setWindowFrame(WKRect frame )100 void PlatformWebView::setWindowFrame(WKRect frame, WebViewSizingMode) 101 101 { 102 102 gdk_window_move_resize(gtk_widget_get_window(GTK_WIDGET(m_window)), -
trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm
r209967 r209972 115 115 }; 116 116 117 static CGRect viewRectForWindowRect(CGRect windowRect, WebViewSizingMode mode)117 static CGRect viewRectForWindowRect(CGRect windowRect, PlatformWebView::WebViewSizingMode mode) 118 118 { 119 119 CGFloat statusBarBottom = CGRectGetMaxY([[UIApplication sharedApplication] statusBarFrame]); 120 return CGRectMake(windowRect.origin.x, windowRect.origin.y + statusBarBottom, windowRect.size.width, windowRect.size.height - (mode == WebViewSizingMode::HeightRespectsStatusBar ? statusBarBottom : 0));120 return CGRectMake(windowRect.origin.x, windowRect.origin.y + statusBarBottom, windowRect.size.width, windowRect.size.height - (mode == PlatformWebView::WebViewSizingMode::HeightRespectsStatusBar ? statusBarBottom : 0)); 121 121 } 122 122 … … 167 167 } 168 168 169 void PlatformWebView::resizeTo(unsigned width, unsigned height )169 void PlatformWebView::resizeTo(unsigned width, unsigned height, WebViewSizingMode viewSizingMode) 170 170 { 171 171 WKRect frame = windowFrame(); 172 172 frame.size.width = width; 173 173 frame.size.height = height; 174 setWindowFrame(frame );174 setWindowFrame(frame, viewSizingMode); 175 175 } 176 176 … … 198 198 } 199 199 200 void PlatformWebView::setWindowFrame(WKRect frame )200 void PlatformWebView::setWindowFrame(WKRect frame, WebViewSizingMode viewSizingMode) 201 201 { 202 202 [m_window setFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)]; 203 [platformView() setFrame:viewRectForWindowRect(CGRectMake(0, 0, frame.size.width, frame.size.height), WebViewSizingMode::HeightRespectsStatusBar)];203 [platformView() setFrame:viewRectForWindowRect(CGRectMake(0, 0, frame.size.width, frame.size.height), viewSizingMode)]; 204 204 } 205 205 -
trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm
r208926 r209972 98 98 if (test.options().useFlexibleViewport) { 99 99 CGRect screenBounds = [UIScreen mainScreen].bounds; 100 mainWebView()->resizeTo(screenBounds.size.width, screenBounds.size.height );100 mainWebView()->resizeTo(screenBounds.size.width, screenBounds.size.height, PlatformWebView::WebViewSizingMode::HeightRespectsStatusBar); 101 101 // We also pass data to InjectedBundle::beginTesting() to have it call 102 102 // WKBundlePageSetUseTestingViewportConfiguration(false). -
trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
r209364 r209972 165 165 } 166 166 167 void PlatformWebView::resizeTo(unsigned width, unsigned height )167 void PlatformWebView::resizeTo(unsigned width, unsigned height, WebViewSizingMode sizingMode) 168 168 { 169 169 WKRect frame = windowFrame(); 170 170 frame.size.width = width; 171 171 frame.size.height = height; 172 setWindowFrame(frame );172 setWindowFrame(frame, sizingMode); 173 173 } 174 174 … … 220 220 } 221 221 222 void PlatformWebView::setWindowFrame(WKRect frame )222 void PlatformWebView::setWindowFrame(WKRect frame, WebViewSizingMode) 223 223 { 224 224 [m_window setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height) display:YES];
Note: See TracChangeset
for help on using the changeset viewer.