<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[190304] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/190304">190304</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-09-28 23:51:22 -0700 (Mon, 28 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WTR] Pixel tests generate the snapshots twice in Web and UI processes
https://bugs.webkit.org/show_bug.cgi?id=149595

Reviewed by Tim Horton.

All ports except IOS implement
PlatformWebView::windowSnapshotImage() to generate the snapshot
for the pixel tests in the UI process. But we are still generating
a snapshot for pixel tests in the Web process too, that is passed
to the UI process but ignored.
Whether a pixel result is needed or not, is only known by the web
process depending on whether the test called dumpAsText with
dumpPixels == true or not. Since the pixels are now dump in the UI
process, we need to pass that information to the UI process when
the test is done. For that we set a PixelResultIsPending bool
parameter to the Done message, and we only add the PixelResult
when UI process doesn't need to generate the pixels dump.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage): Set
m_pixelResultIsPending to false on reset.
(WTR::InjectedBundle::done): Add PixelResultIsPending parameter to the
Done message, and set the PixelResult if m_pixelResultIsPending is false.
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::setPixelResult): Set m_pixelResultIsPending to false.
(WTR::InjectedBundle::setNeedsPixelResult): Set m_pixelResultIsPending.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dump): Only create a snapshot for IOS
port.
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::dumpResults): Use either the pixel result
from the web process or generate a pixel result from the web view
if need it.
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h: Add SnapshotResultType enum
parameter to dumpPixelsAndCompareWithExpected, since the snapshot
is created by the caller now, but the CG implementation needs to
know if it's a Web or UI process snapshot.
* WebKitTestRunner/cairo/TestInvocationCairo.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Create a
cairo surface for the given image.
* WebKitTestRunner/cg/TestInvocationCG.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Create a
CGContext for the given image.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationh">trunk/Tools/WebKitTestRunner/TestInvocation.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnercairoTestInvocationCairocpp">trunk/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnercgTestInvocationCGcpp">trunk/Tools/WebKitTestRunner/cg/TestInvocationCG.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/ChangeLog        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2015-09-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [WTR] Pixel tests generate the snapshots twice in Web and UI processes
+        https://bugs.webkit.org/show_bug.cgi?id=149595
+
+        Reviewed by Tim Horton.
+
+        All ports except IOS implement
+        PlatformWebView::windowSnapshotImage() to generate the snapshot
+        for the pixel tests in the UI process. But we are still generating
+        a snapshot for pixel tests in the Web process too, that is passed
+        to the UI process but ignored.
+        Whether a pixel result is needed or not, is only known by the web
+        process depending on whether the test called dumpAsText with
+        dumpPixels == true or not. Since the pixels are now dump in the UI
+        process, we need to pass that information to the UI process when
+        the test is done. For that we set a PixelResultIsPending bool
+        parameter to the Done message, and we only add the PixelResult
+        when UI process doesn't need to generate the pixels dump.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::didReceiveMessageToPage): Set
+        m_pixelResultIsPending to false on reset.
+        (WTR::InjectedBundle::done): Add PixelResultIsPending parameter to the
+        Done message, and set the PixelResult if m_pixelResultIsPending is false.
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+        (WTR::InjectedBundle::setPixelResult): Set m_pixelResultIsPending to false.
+        (WTR::InjectedBundle::setNeedsPixelResult): Set m_pixelResultIsPending.
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::dump): Only create a snapshot for IOS
+        port.
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::dumpResults): Use either the pixel result
+        from the web process or generate a pixel result from the web view
+        if need it.
+        (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+        * WebKitTestRunner/TestInvocation.h: Add SnapshotResultType enum
+        parameter to dumpPixelsAndCompareWithExpected, since the snapshot
+        is created by the caller now, but the CG implementation needs to
+        know if it's a Web or UI process snapshot.
+        * WebKitTestRunner/cairo/TestInvocationCairo.cpp:
+        (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Create a
+        cairo surface for the given image.
+        * WebKitTestRunner/cg/TestInvocationCG.cpp:
+        (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Create a
+        CGContext for the given image.
+
</ins><span class="cx"> 2015-09-28  Dean Johnson  &lt;dean_johnson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix JS errors on dashboard metrics page
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -186,6 +186,7 @@
</span><span class="cx"> 
</span><span class="cx">         m_state = Idle;
</span><span class="cx">         m_dumpPixels = false;
</span><ins>+        m_pixelResultIsPending = false;
</ins><span class="cx"> 
</span><span class="cx">         resetLocalSettings();
</span><span class="cx">         m_testRunner-&gt;removeAllWebNotificationPermissions();
</span><span class="lines">@@ -338,9 +339,15 @@
</span><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; doneMessageName(AdoptWK, WKStringCreateWithUTF8CString(&quot;Done&quot;));
</span><span class="cx">     WKRetainPtr&lt;WKMutableDictionaryRef&gt; doneMessageBody(AdoptWK, WKMutableDictionaryCreate());
</span><span class="cx"> 
</span><del>-    WKRetainPtr&lt;WKStringRef&gt; pixelResultKey = adoptWK(WKStringCreateWithUTF8CString(&quot;PixelResult&quot;));
-    WKDictionarySetItem(doneMessageBody.get(), pixelResultKey.get(), m_pixelResult.get());
</del><ins>+    WKRetainPtr&lt;WKStringRef&gt; pixelResultIsPendingKey = adoptWK(WKStringCreateWithUTF8CString(&quot;PixelResultIsPending&quot;));
+    WKRetainPtr&lt;WKBooleanRef&gt; pixelResultIsPending(AdoptWK, WKBooleanCreate(m_pixelResultIsPending));
+    WKDictionarySetItem(doneMessageBody.get(), pixelResultIsPendingKey.get(), pixelResultIsPending.get());
</ins><span class="cx"> 
</span><ins>+    if (!m_pixelResultIsPending) {
+        WKRetainPtr&lt;WKStringRef&gt; pixelResultKey = adoptWK(WKStringCreateWithUTF8CString(&quot;PixelResult&quot;));
+        WKDictionarySetItem(doneMessageBody.get(), pixelResultKey.get(), m_pixelResult.get());
+    }
+
</ins><span class="cx">     WKRetainPtr&lt;WKStringRef&gt; repaintRectsKey = adoptWK(WKStringCreateWithUTF8CString(&quot;RepaintRects&quot;));
</span><span class="cx">     WKDictionarySetItem(doneMessageBody.get(), repaintRectsKey.get(), m_repaintRects.get());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -66,7 +66,8 @@
</span><span class="cx"> 
</span><span class="cx">     void done();
</span><span class="cx">     void setAudioResult(WKDataRef audioData) { m_audioResult = audioData; }
</span><del>-    void setPixelResult(WKImageRef image) { m_pixelResult = image; }
</del><ins>+    void setPixelResult(WKImageRef image) { m_pixelResult = image; m_pixelResultIsPending = false; }
+    void setPixelResultIsPending(bool isPending) { m_pixelResultIsPending = isPending; }
</ins><span class="cx">     void setRepaintRects(WKArrayRef rects) { m_repaintRects = rects; }
</span><span class="cx"> 
</span><span class="cx">     bool isTestRunning() { return m_state == Testing; }
</span><span class="lines">@@ -164,6 +165,7 @@
</span><span class="cx">     bool m_useWaitToDumpWatchdogTimer;
</span><span class="cx">     bool m_useWorkQueue;
</span><span class="cx">     int m_timeout;
</span><ins>+    bool m_pixelResultIsPending { false };
</ins><span class="cx"> 
</span><span class="cx">     WKRetainPtr&lt;WKDataRef&gt; m_audioResult;
</span><span class="cx">     WKRetainPtr&lt;WKImageRef&gt; m_pixelResult;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -892,11 +892,16 @@
</span><span class="cx">         injectedBundle.dumpBackForwardListsForAllPages(stringBuilder);
</span><span class="cx"> 
</span><span class="cx">     if (injectedBundle.shouldDumpPixels() &amp;&amp; injectedBundle.testRunner()-&gt;shouldDumpPixels()) {
</span><ins>+#if PLATFORM(IOS)
+        // IOS doesn't implement PlatformWebView::windowSnapshotImage() yet, so we need to generate the snapshot in the web process.
</ins><span class="cx">         WKSnapshotOptions options = kWKSnapshotOptionsShareable | kWKSnapshotOptionsInViewCoordinates;
</span><span class="cx">         if (injectedBundle.testRunner()-&gt;shouldDumpSelectionRect())
</span><span class="cx">             options |= kWKSnapshotOptionsPaintSelectionRectangle;
</span><span class="cx"> 
</span><span class="cx">         injectedBundle.setPixelResult(adoptWK(WKBundlePageCreateSnapshotWithOptions(m_page, WKBundleFrameGetVisibleContentBounds(WKBundlePageGetMainFrame(m_page)), options)).get());
</span><ins>+#else
+        injectedBundle.setPixelResultIsPending(true);
+#endif
</ins><span class="cx">         if (WKBundlePageIsTrackingRepaints(m_page))
</span><span class="cx">             injectedBundle.setRepaintRects(adoptWK(WKBundlePageCopyTrackedRepaintRects(m_page)).get());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -288,16 +288,22 @@
</span><span class="cx">     else
</span><span class="cx">         dumpAudio(m_audioResult.get());
</span><span class="cx"> 
</span><del>-    if (m_dumpPixels &amp;&amp; m_pixelResult) {
-        m_gotRepaint = false;
-        WKPageForceRepaint(TestController::singleton().mainWebView()-&gt;page(), this, TestInvocation::forceRepaintDoneCallback);
-        TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
-        if (!m_gotRepaint) {
-            m_errorMessage = &quot;Timed out waiting for pre-pixel dump repaint\n&quot;;
-            m_webProcessIsUnresponsive = true;
-            return;
</del><ins>+    if (m_dumpPixels) {
+        if (m_pixelResult)
+            dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get(), TestInvocation::SnapshotResultType::WebContents);
+        else if (m_pixelResultIsPending) {
+            m_gotRepaint = false;
+            WKPageForceRepaint(TestController::singleton().mainWebView()-&gt;page(), this, TestInvocation::forceRepaintDoneCallback);
+            TestController::singleton().runUntil(m_gotRepaint, TestController::shortTimeout);
+            if (!m_gotRepaint) {
+                m_errorMessage = &quot;Timed out waiting for pre-pixel dump repaint\n&quot;;
+                m_webProcessIsUnresponsive = true;
+                return;
+            }
+            WKRetainPtr&lt;WKImageRef&gt; windowSnapshot = TestController::singleton().mainWebView()-&gt;windowSnapshotImage();
+            ASSERT(windowSnapshot);
+            dumpPixelsAndCompareWithExpected(windowSnapshot.get(), m_repaintRects.get(), TestInvocation::SnapshotResultType::WebView);
</ins><span class="cx">         }
</span><del>-        dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get());
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     fputs(&quot;#EOF\n&quot;, stdout);
</span><span class="lines">@@ -364,10 +370,16 @@
</span><span class="cx">         ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
</span><span class="cx">         WKDictionaryRef messageBodyDictionary = static_cast&lt;WKDictionaryRef&gt;(messageBody);
</span><span class="cx"> 
</span><del>-        WKRetainPtr&lt;WKStringRef&gt; pixelResultKey = adoptWK(WKStringCreateWithUTF8CString(&quot;PixelResult&quot;));
-        m_pixelResult = static_cast&lt;WKImageRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, pixelResultKey.get()));
-        ASSERT(!m_pixelResult || m_dumpPixels);
</del><ins>+        WKRetainPtr&lt;WKStringRef&gt; pixelResultIsPendingKey = adoptWK(WKStringCreateWithUTF8CString(&quot;PixelResultIsPending&quot;));
+        WKBooleanRef pixelResultIsPending = static_cast&lt;WKBooleanRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, pixelResultIsPendingKey.get()));
+        m_pixelResultIsPending = WKBooleanGetValue(pixelResultIsPending);
</ins><span class="cx"> 
</span><ins>+        if (!m_pixelResultIsPending) {
+            WKRetainPtr&lt;WKStringRef&gt; pixelResultKey = adoptWK(WKStringCreateWithUTF8CString(&quot;PixelResult&quot;));
+            m_pixelResult = static_cast&lt;WKImageRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, pixelResultKey.get()));
+            ASSERT(!m_pixelResult || m_dumpPixels);
+        }
+
</ins><span class="cx">         WKRetainPtr&lt;WKStringRef&gt; repaintRectsKey = adoptWK(WKStringCreateWithUTF8CString(&quot;RepaintRects&quot;));
</span><span class="cx">         m_repaintRects = static_cast&lt;WKArrayRef&gt;(WKDictionaryGetItemForKey(messageBodyDictionary, repaintRectsKey.get()));
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.h (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.h        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.h        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -69,7 +69,8 @@
</span><span class="cx"> private:
</span><span class="cx">     void dumpResults();
</span><span class="cx">     static void dump(const char* textToStdout, const char* textToStderr = 0, bool seenError = false);
</span><del>-    void dumpPixelsAndCompareWithExpected(WKImageRef, WKArrayRef repaintRects);
</del><ins>+    enum class SnapshotResultType { WebView, WebContents };
+    void dumpPixelsAndCompareWithExpected(WKImageRef, WKArrayRef repaintRects, SnapshotResultType);
</ins><span class="cx">     void dumpAudio(WKDataRef);
</span><span class="cx">     bool compareActualHashToExpectedAndDumpResults(const char[33]);
</span><span class="cx"> 
</span><span class="lines">@@ -93,6 +94,7 @@
</span><span class="cx">     WTF::String m_urlString;
</span><span class="cx"> 
</span><span class="cx">     bool m_dumpPixels;
</span><ins>+    bool m_pixelResultIsPending { false };
</ins><span class="cx">     std::string m_expectedPixelHash;
</span><span class="cx"> 
</span><span class="cx">     int m_timeout;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnercairoTestInvocationCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -106,9 +106,9 @@
</span><span class="cx">     cairo_destroy(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef, WKArrayRef repaintRects)
</del><ins>+void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef image, WKArrayRef repaintRects, SnapshotResultType)
</ins><span class="cx"> {
</span><del>-    cairo_surface_t* surface = WKImageCreateCairoSurface(TestController::singleton().mainWebView()-&gt;windowSnapshotImage().get());
</del><ins>+    cairo_surface_t* surface = WKImageCreateCairoSurface(image);
</ins><span class="cx"> 
</span><span class="cx">     if (repaintRects)
</span><span class="cx">         paintRepaintRectOverlay(surface, repaintRects);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnercgTestInvocationCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/cg/TestInvocationCG.cpp (190303 => 190304)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/cg/TestInvocationCG.cpp        2015-09-29 04:31:16 UTC (rev 190303)
+++ trunk/Tools/WebKitTestRunner/cg/TestInvocationCG.cpp        2015-09-29 06:51:22 UTC (rev 190304)
</span><span class="lines">@@ -154,17 +154,10 @@
</span><span class="cx">     CGContextRestoreGState(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef image, WKArrayRef repaintRects)
</del><ins>+void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef image, WKArrayRef repaintRects, SnapshotResultType snapshotType)
</ins><span class="cx"> {
</span><del>-    PlatformWebView* webView = TestController::singleton().mainWebView();
-    WKRetainPtr&lt;WKImageRef&gt; windowSnapshot = webView-&gt;windowSnapshotImage();
</del><ins>+    RetainPtr&lt;CGContextRef&gt; context = adoptCF(createCGContextFromImage(image, snapshotType == SnapshotResultType::WebView ? DontFlipGraphicsContext : FlipGraphicsContext));
</ins><span class="cx"> 
</span><del>-    RetainPtr&lt;CGContextRef&gt; context;
-    if (windowSnapshot)
-        context = adoptCF(createCGContextFromImage(windowSnapshot.get(), DontFlipGraphicsContext));
-    else
-        context = adoptCF(createCGContextFromImage(image));
-
</del><span class="cx">     // A non-null repaintRects array means we're doing a repaint test.
</span><span class="cx">     if (repaintRects)
</span><span class="cx">         paintRepaintRectOverlay(context.get(), image, repaintRects);
</span></span></pre>
</div>
</div>

</body>
</html>