Changeset 149087 in webkit
- Timestamp:
- Apr 24, 2013 7:09:22 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r149073 r149087 1 2013-04-24 Simon Fraser <simon.fraser@apple.com> 2 3 Pixel tests in SVG are all broken in WK2 4 https://bugs.webkit.org/show_bug.cgi?id=114218 5 6 Reviewed by Darin Adler. 7 8 Window snapshots in WebKitTestRunner on Mac are window-sized 9 (800x600), which is wrong for the W3C SVG tests that require a 10 480x360 snapshot. 11 12 Fix by resizing the window, as well as the web view in 13 PlatformWebView::resizeTo() so that window snapshots are correctly 14 sized. 15 16 Also do some drive-by cleanup of the window size constants in both 17 DRT and WTR to remove magic numbers, and make the code more similar. 18 19 * DumpRenderTree/TestRunner.cpp: 20 (TestRunner::setShouldPaintBrokenImage): 21 * DumpRenderTree/TestRunner.h: 22 * DumpRenderTree/efl/DumpRenderTree.cpp: 23 * DumpRenderTree/gtk/DumpRenderTree.cpp: 24 (webInspectorShowWindow): 25 * DumpRenderTree/mac/DumpRenderTree.mm: 26 (createWebViewAndOffscreenWindow): 27 (sizeWebViewForCurrentTest): 28 * DumpRenderTree/mac/DumpRenderTreeMac.h: 29 * DumpRenderTree/mac/PixelDumpSupportMac.mm: 30 (createPagedBitmapContext): 31 * DumpRenderTree/qt/DumpRenderTreeQt.cpp: 32 (DumpRenderTree::DumpRenderTree): 33 (DumpRenderTree::open): 34 * DumpRenderTree/qt/TestRunnerQt.cpp: 35 * DumpRenderTree/qt/TestRunnerQt.h: 36 * DumpRenderTree/win/DumpRenderTree.cpp: 37 (sizeWebViewForCurrentTest): 38 * DumpRenderTree/wx/DumpRenderTreeWx.cpp: 39 * WebKitTestRunner/TestController.cpp: 40 (WTR::TestController::resetStateToConsistentValues): 41 * WebKitTestRunner/TestController.h: 42 * WebKitTestRunner/TestInvocation.cpp: 43 (WTR::sizeWebViewForCurrentTest): 44 * WebKitTestRunner/mac/PlatformWebViewMac.mm: 45 (WTR::PlatformWebView::PlatformWebView): 46 (WTR::PlatformWebView::resizeTo): 47 1 48 2013-04-24 Byungwoo Lee <bw80.lee@samsung.com> 2 49 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r146291 r149087 44 44 #include <wtf/OwnArrayPtr.h> 45 45 #include <wtf/RefPtr.h> 46 47 const unsigned TestRunner::viewWidth = 800; 48 const unsigned TestRunner::viewHeight = 600; 49 50 const unsigned TestRunner::w3cSVGViewWidth = 480; 51 const unsigned TestRunner::w3cSVGViewHeight = 360; 46 52 47 53 TestRunner::TestRunner(const std::string& testPathOrURL, const std::string& expectedPixelHash) … … 2237 2243 m_shouldPaintBrokenImage = shouldPaintBrokenImage; 2238 2244 } 2239 2240 const unsigned TestRunner::maxViewWidth = 800;2241 const unsigned TestRunner::maxViewHeight = 600; -
trunk/Tools/DumpRenderTree/TestRunner.h
r146291 r149087 42 42 public: 43 43 static PassRefPtr<TestRunner> create(const std::string& testPathOrURL, const std::string& expectedPixelHash); 44 45 static const unsigned viewWidth; 46 static const unsigned viewHeight; 47 48 static const unsigned w3cSVGViewWidth; 49 static const unsigned w3cSVGViewHeight; 50 44 51 ~TestRunner(); 45 52 … … 331 338 bool shouldPaintBrokenImage() const { return m_shouldPaintBrokenImage; } 332 339 333 static const unsigned maxViewWidth;334 static const unsigned maxViewHeight;335 336 340 void setTextDirection(JSStringRef); 337 341 const std::string& titleTextDirection() const { return m_titleTextDirection; } -
trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp
r143708 r149087 281 281 282 282 const bool isSVGW3CTest = testURL.contains("svg/W3C-SVG-1.1"); 283 const int width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth;284 const int height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight;283 const int width = isSVGW3CTest ? TestRunner::w3cSVGViewWidth : TestRunner::viewWidth; 284 const int height = isSVGW3CTest ? TestRunner::w3cSVGViewHeight : TestRunner::viewHeight; 285 285 evas_object_resize(browser->mainView(), width, height); 286 286 -
trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
r148025 r149087 159 159 evas_object_smart_callback_add(mainFrame, "load,finished", onInspectorFrameLoadFinished, 0); 160 160 161 evas_object_resize(inspectorView, TestRunner:: maxViewWidth, TestRunner::maxViewHeight);161 evas_object_resize(inspectorView, TestRunner::viewWidth, TestRunner::viewHeight); 162 162 evas_object_show(inspectorView); 163 163 evas_object_focus_set(inspectorView, true); … … 213 213 evas_object_name_set(m_mainView, "m_mainView"); 214 214 evas_object_move(m_mainView, 0, 0); 215 evas_object_resize(m_mainView, 800, 600);215 evas_object_resize(m_mainView, TestRunner::viewWidth, TestRunner::viewHeight); 216 216 evas_object_layer_set(m_mainView, EVAS_LAYER_MAX); 217 217 evas_object_show(m_mainView); -
trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
r148210 r149087 748 748 GtkAllocation size; 749 749 size.x = size.y = 0; 750 size.width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth;751 size.height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight;750 size.width = isSVGW3CTest ? TestRunner::w3cSVGViewWidth : TestRunner::viewWidth; 751 size.height = isSVGW3CTest ? TestRunner::w3cSVGViewHeight : TestRunner::viewHeight; 752 752 gtk_window_resize(GTK_WINDOW(window), size.width, size.height); 753 753 gtk_widget_size_allocate(container, &size); … … 1068 1068 static gboolean webInspectorShowWindow(WebKitWebInspector*, gpointer data) 1069 1069 { 1070 gtk_window_set_default_size(GTK_WINDOW(webInspectorWindow), 800, 600);1070 gtk_window_set_default_size(GTK_WINDOW(webInspectorWindow), TestRunner::viewWidth, TestRunner::viewHeight); 1071 1071 gtk_widget_show_all(webInspectorWindow); 1072 1072 return TRUE; -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r148306 r149087 523 523 WebView *createWebViewAndOffscreenWindow() 524 524 { 525 NSRect rect = NSMakeRect(0, 0, TestRunner:: maxViewWidth, TestRunner::maxViewHeight);525 NSRect rect = NSMakeRect(0, 0, TestRunner::viewWidth, TestRunner::viewHeight); 526 526 WebView *webView = [[WebView alloc] initWithFrame:rect frameName:nil groupName:@"org.webkit.DumpRenderTree"]; 527 527 … … 1106 1106 bool isSVGW3CTest = (gTestRunner->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); 1107 1107 if (isSVGW3CTest) 1108 [[mainFrame webView] setFrameSize:NSMakeSize( 480, 360)];1108 [[mainFrame webView] setFrameSize:NSMakeSize(TestRunner::w3cSVGViewWidth, TestRunner::w3cSVGViewHeight)]; 1109 1109 else 1110 [[mainFrame webView] setFrameSize:NSMakeSize(TestRunner:: maxViewWidth, TestRunner::maxViewHeight)];1110 [[mainFrame webView] setFrameSize:NSMakeSize(TestRunner::viewWidth, TestRunner::viewHeight)]; 1111 1111 } 1112 1112 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h
r104902 r149087 59 59 extern StorageTrackerDelegate* storageDelegate; 60 60 61 extern const unsigned maxViewHeight;62 extern const unsigned maxViewWidth;63 64 61 void setWaitToDumpWatchdog(CFRunLoopTimerRef); 65 62 bool shouldSetWaitToDumpWatchdog(); -
trunk/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm
r131564 r149087 185 185 PassRefPtr<BitmapContext> createPagedBitmapContext() 186 186 { 187 int pageWidthInPixels = TestRunner:: maxViewWidth;188 int pageHeightInPixels = TestRunner:: maxViewHeight;187 int pageWidthInPixels = TestRunner::viewWidth; 188 int pageHeightInPixels = TestRunner::viewHeight; 189 189 int numberOfPages = [mainFrame numberOfPagesWithPageWidth:pageWidthInPixels pageHeight:pageHeightInPixels]; 190 190 size_t rowBytes = 0; -
trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
r147563 r149087 428 428 429 429 m_mainView->setContextMenuPolicy(Qt::NoContextMenu); 430 m_mainView->resize(QSize(TestRunner Qt::maxViewWidth, TestRunnerQt::maxViewHeight));430 m_mainView->resize(QSize(TestRunner::viewWidth, TestRunner::viewHeight)); 431 431 432 432 // clean up cache by resetting quota. … … 626 626 // W3C SVG tests expect to be 480x360 627 627 bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1"); 628 int width = isW3CTest ? 480 : TestRunnerQt::maxViewWidth;629 int height = isW3CTest ? 360 : TestRunnerQt::maxViewHeight;628 int width = isW3CTest ? TestRunner::w3cSVGViewWidth : TestRunner::viewWidth; 629 int height = isW3CTest ? TestRunner::w3cSVGViewHeight : TestRunner::viewHeight; 630 630 m_mainView->resize(QSize(width, height)); 631 631 m_page->setPreferredContentsSize(QSize()); -
trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp
r147563 r149087 775 775 } 776 776 777 const unsigned TestRunnerQt::maxViewWidth = 800;778 const unsigned TestRunnerQt::maxViewHeight = 600;779 780 777 // --- JSC C API stubs 781 778 -
trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h
r147563 r149087 68 68 69 69 void reset(); 70 71 static const unsigned int maxViewWidth;72 static const unsigned int maxViewHeight;73 70 74 71 void setTimeout(int timeout) { m_timeout = timeout; } -
trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp
r145849 r149087 932 932 unsigned height; 933 933 if (isSVGW3CTest) { 934 width = 480;935 height = 360;934 width = TestRunner::w3cSVGViewWidth; 935 height = TestRunner::w3cSVGViewHeight; 936 936 } else { 937 width = TestRunner:: maxViewWidth;938 height = TestRunner:: maxViewHeight;937 width = TestRunner::viewWidth; 938 height = TestRunner::viewHeight; 939 939 } 940 940 … … 1191 1191 IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow) 1192 1192 { 1193 unsigned maxViewWidth = TestRunner:: maxViewWidth;1194 unsigned maxViewHeight = TestRunner:: maxViewHeight;1193 unsigned maxViewWidth = TestRunner::viewWidth; 1194 unsigned maxViewHeight = TestRunner::viewHeight; 1195 1195 HWND hostWindow = CreateWindowEx(WS_EX_TOOLWINDOW, kDumpRenderTreeClassName, TEXT("DumpRenderTree"), WS_POPUP, 1196 1196 -maxViewWidth, -maxViewHeight, maxViewWidth, maxViewHeight, 0, 0, GetModuleHandle(0), 0); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r149027 r149087 63 63 64 64 namespace WTR { 65 66 const unsigned TestController::viewWidth = 800; 67 const unsigned TestController::viewHeight = 600; 68 69 const unsigned TestController::w3cSVGViewWidth = 480; 70 const unsigned TestController::w3cSVGViewHeight = 360; 65 71 66 72 // defaultLongTimeout + defaultShortTimeout should be less than 80, … … 590 596 // In EFL, we need to resize the window to the original size after calls to window.resizeTo. 591 597 WKRect rect = m_mainWebView->windowFrame(); 592 m_mainWebView->setWindowFrame(WKRectMake(rect.origin.x, rect.origin.y, 800, 600));598 m_mainWebView->setWindowFrame(WKRectMake(rect.origin.x, rect.origin.y, TestController::viewWidth, TestController::viewHeight)); 593 599 #endif 594 600 -
trunk/Tools/WebKitTestRunner/TestController.h
r143988 r149087 47 47 static TestController& shared(); 48 48 49 static const unsigned viewWidth; 50 static const unsigned viewHeight; 51 52 static const unsigned w3cSVGViewWidth; 53 static const unsigned w3cSVGViewHeight; 54 49 55 TestController(int argc, const char* argv[]); 50 56 ~TestController(); -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r141011 r149087 128 128 } 129 129 130 static const unsigned w3cSVGWidth = 480;131 static const unsigned w3cSVGHeight = 360;132 static const unsigned normalWidth = 800;133 static const unsigned normalHeight = 600;134 135 130 static void sizeWebViewForCurrentTest(const char* pathOrURL) 136 131 { … … 138 133 139 134 if (isSVGW3CTest) 140 TestController::shared().mainWebView()->resizeTo( w3cSVGWidth, w3cSVGHeight);135 TestController::shared().mainWebView()->resizeTo(TestController::w3cSVGViewWidth, TestController::w3cSVGViewHeight); 141 136 else 142 TestController::shared().mainWebView()->resizeTo(normalWidth, normalHeight); 143 } 137 TestController::shared().mainWebView()->resizeTo(TestController::viewWidth, TestController::viewHeight); 138 } 139 144 140 static bool shouldLogFrameLoadDelegates(const char* pathOrURL) 145 141 { -
trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
r146650 r149087 125 125 bool useTiledDrawing = useTiledDrawingValue && WKBooleanGetValue(static_cast<WKBooleanRef>(useTiledDrawingValue)); 126 126 127 NSRect rect = NSMakeRect(0, 0, 800, 600);127 NSRect rect = NSMakeRect(0, 0, TestController::viewWidth, TestController::viewHeight); 128 128 m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef useTiledDrawing:useTiledDrawing]; 129 129 [m_view setWindowOcclusionDetectionEnabled:NO]; … … 142 142 void PlatformWebView::resizeTo(unsigned width, unsigned height) 143 143 { 144 NSRect windowFrame = [m_window frame]; 145 windowFrame.size.width = width; 146 windowFrame.size.height = height; 147 [m_window setFrame:windowFrame display:YES]; 144 148 [m_view setFrame:NSMakeRect(0, 0, width, height)]; 145 149 }
Note: See TracChangeset
for help on using the changeset viewer.