Changeset 155140 in webkit
- Timestamp:
- Sep 5, 2013 12:38:48 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r155124 r155140 1 2013-09-05 Simon Fraser <simon.fraser@apple.com> 2 3 Expected result images are sometimes blank in WKTR 4 https://bugs.webkit.org/show_bug.cgi?id=120715 5 6 Reviewed by Tim Horton. 7 8 In WebKitTestRunner, snapshots obtained via windowSnapshotImage() were 9 sometimes blank if a previous test triggered compositing mode, and the 10 current test or reference did not require compositing. This happened 11 because the UI process didn't wait for the web process to complete 12 its compositing mode switch before snapshotting. Fix by calling 13 WKPageForceRepaint() before we take the snapshot; this is async, 14 so we have to spin the runloop for a while. 15 16 Remove the Qt/EFL code that does the same thing. 17 18 * WebKitTestRunner/TestInvocation.cpp: 19 (WTR::TestInvocation::forceRepaintDoneCallback): 20 (WTR::TestInvocation::dumpResults): 21 * WebKitTestRunner/TestInvocation.h: 22 * WebKitTestRunner/cairo/TestInvocationCairo.cpp: 23 (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): 24 * WebKitTestRunner/qt/TestInvocationQt.cpp: 25 (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): 26 1 27 2013-09-05 Csaba Osztrogonác <ossy@webkit.org> 2 28 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r153054 r155140 311 311 } 312 312 313 void TestInvocation::forceRepaintDoneCallback(WKErrorRef, void* context) 314 { 315 TestInvocation* testInvocation = static_cast<TestInvocation*>(context); 316 testInvocation->m_gotRepaint = true; 317 } 318 313 319 void TestInvocation::dumpResults() 314 320 { … … 318 324 dumpAudio(m_audioResult.get()); 319 325 320 if (m_dumpPixels && m_pixelResult) 326 if (m_dumpPixels && m_pixelResult) { 327 m_gotRepaint = false; 328 WKPageForceRepaint(TestController::shared().mainWebView()->page(), this, TestInvocation::forceRepaintDoneCallback); 329 TestController::shared().runUntil(m_gotRepaint, TestController::ShortTimeout); 330 if (!m_gotRepaint) { 331 m_errorMessage = "Timed out waiting for pre-pixel dump repaint\n"; 332 m_webProcessIsUnresponsive = true; 333 return; 334 } 321 335 dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get()); 336 } 322 337 323 338 fputs("#EOF\n", stdout); -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r152295 r155140 59 59 bool compareActualHashToExpectedAndDumpResults(const char[33]); 60 60 61 #if PLATFORM(QT) || PLATFORM(EFL)62 61 static void forceRepaintDoneCallback(WKErrorRef, void* context); 63 #endif 64 62 65 63 WKRetainPtr<WKURLRef> m_url; 66 64 std::string m_pathOrURL; -
trunk/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp
r136004 r155140 107 107 } 108 108 109 #if PLATFORM(EFL)110 void TestInvocation::forceRepaintDoneCallback(WKErrorRef, void *context)111 {112 static_cast<TestInvocation*>(context)->m_gotRepaint = true;113 TestController::shared().notifyDone();114 }115 #endif116 117 109 void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef wkImage, WKArrayRef repaintRects) 118 110 { 119 111 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(EFL) 120 112 UNUSED_PARAM(wkImage); 121 122 cairo_surface_t* surface; 123 124 WKPageRef page = TestController::shared().mainWebView()->page(); 125 WKPageForceRepaint(page, this, &forceRepaintDoneCallback); 126 127 TestController::shared().runUntil(m_gotRepaint, TestController::ShortTimeout); 128 129 if (!m_gotRepaint) { 130 m_error = true; 131 m_errorMessage = "Timed out waiting for repaint\n"; 132 m_webProcessIsUnresponsive = true; 133 return; 134 } 135 136 surface = WKImageCreateCairoSurface(TestController::shared().mainWebView()->windowSnapshotImage().get()); 113 cairo_surface_t* surface = WKImageCreateCairoSurface(TestController::shared().mainWebView()->windowSnapshotImage().get()); 137 114 #else 138 115 cairo_surface_t* surface = WKImageCreateCairoSurface(wkImage); -
trunk/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
r150007 r155140 65 65 } 66 66 67 void TestInvocation::forceRepaintDoneCallback(WKErrorRef, void *context)68 {69 static_cast<TestInvocation*>(context)->m_gotRepaint = true;70 TestController::shared().notifyDone();71 }72 73 67 void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef imageRef, WKArrayRef repaintRects) 74 68 { 75 69 QImage image; 76 70 if (PlatformWebView::windowShapshotEnabled()) { 77 WKPageRef page = TestController::shared().mainWebView()->page(); 78 WKPageForceRepaint(page, this, &forceRepaintDoneCallback); 79 80 TestController::shared().runUntil(m_gotRepaint, TestController::ShortTimeout); 81 82 if (m_gotRepaint) 83 image = WKImageCreateQImage(TestController::shared().mainWebView()->windowSnapshotImage().get()); 84 else { 85 m_error = true; 86 m_errorMessage = "Timed out waiting for repaint\n"; 87 m_webProcessIsUnresponsive = true; 88 return; 89 } 71 image = WKImageCreateQImage(TestController::shared().mainWebView()->windowSnapshotImage().get()); 90 72 } else 91 73 image = WKImageCreateQImage(imageRef);
Note: See TracChangeset
for help on using the changeset viewer.