<!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>[177542] trunk</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/177542">177542</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-12-18 17:00:23 -0800 (Thu, 18 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Win] Update DumpRenderTree to more closely match Mac version
https://bugs.webkit.org/show_bug.cgi?id=139799

Reviewed by Tim Horton.

Source/WebKit/win:

* Interfaces/IWebSecurityOrigin.idl: Add initializer from URL.
* Interfaces/WebKit.idl: Add CLSID so we can instantiate a
WebSecurityOrigin from COM.
* WebApplicationCache.h: Decorate class declaration with CLSID
to support COM introspection.
* WebSecurityOrigin.cpp: Get rid of meaningless STDMETHODCALLTYPE
declarations inside implementation.
(WebSecurityOrigin::QueryInterface):
(WebSecurityOrigin::AddRef):
(WebSecurityOrigin::Release):
(WebSecurityOrigin::protocol):
(WebSecurityOrigin::host):
(WebSecurityOrigin::port):
(WebSecurityOrigin::usage):
(WebSecurityOrigin::quota):
(WebSecurityOrigin::setQuota):
(WebSecurityOrigin::initWithURL): Added.
* WebSecurityOrigin.h:

Tools:

* DumpRenderTree/win/AccessibilityControllerWin.cpp:
(AccessibilityController::accessibleElementById): Correct
use of BSTR to avoid leak.
* DumpRenderTree/win/DumpRenderTree.cpp: Reorder methods and
update to match Mac version more closely.
(dumpFramesAsText):
(dump):
(resetDefaultsToConsistentValues):
(resetWebViewToConsistentStateBeforeTesting):
(sizeWebViewForCurrentTest):
(runTest):
(openWindows):
(windowToWebViewMap):
(createWebViewAndOffscreenWindow):
(sharedCFURLCache):
(initializeGlobalsFromCommandLineOptions):
(main):
* DumpRenderTree/win/TestRunnerWin.cpp: Ditto.
(TestRunner::addDisallowedURL):
(TestRunner::applicationCacheDiskUsageForOrigin):
(TestRunner::syncLocalStorage):
(TestRunner::localStorageDiskUsageForOrigin):
(TestRunner::observeStorageTrackerNotifications):
(TestRunner::clearApplicationCacheForOrigin):
(TestRunner::originsWithApplicationCache):
(TestRunner::deleteAllLocalStorage):
(TestRunner::setStorageDatabaseIdleInterval):
(TestRunner::closeIdleLocalStorageDatabases):
(TestRunner::originsWithLocalStorage):
(TestRunner::deleteLocalStorageForOrigin):
(TestRunner::copyDecodedHostName):
(TestRunner::copyEncodedHostName):
(TestRunner::keepWebHistory):
(TestRunner::numberOfPendingGeolocationPermissionRequests):
(TestRunner::setAppCacheMaximumSize):
(TestRunner::setCustomPolicyDelegate):
(TestRunner::goBack):
(TestRunner::setDefersLoading):
(TestRunner::setDomainRelaxationForbiddenForURLScheme):
(TestRunner::setMockDeviceOrientation):
(TestRunner::setMockGeolocationPosition):
(TestRunner::setMockGeolocationPositionUnavailableError):
(TestRunner::setIconDatabaseEnabled):
(TestRunner::setMainFrameIsFirstResponder):
(TestRunner::setSpatialNavigationEnabled):
(TestRunner::setPluginsEnabled):
(TestRunner::setAutomaticLinkDetectionEnabled):
(TestRunner::setUseDashboardCompatibilityMode):
(TestRunner::dispatchPendingLoadRequests):
(TestRunner::findString):
(TestRunner::setCacheModel):
(TestRunner::apiTestNewWindowDataLoadBaseURL):
(TestRunner::setWebViewEditable):
(TestRunner::authenticateSession):
(TestRunner::abortModal):
(TestRunner::setSerializeHTTPLoads):
(TestRunner::addChromeInputField):
(TestRunner::removeChromeInputField):
(TestRunner::focusWebView):
(TestRunner::setBackingScaleFactor):
(TestRunner::grantWebNotificationPermission):
(TestRunner::denyWebNotificationPermission):
(TestRunner::removeAllWebNotificationPermissions):
(TestRunner::simulateWebNotificationClick):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinInterfacesIWebSecurityOriginidl">trunk/Source/WebKit/win/Interfaces/IWebSecurityOrigin.idl</a></li>
<li><a href="#trunkSourceWebKitwinInterfacesWebKitidl">trunk/Source/WebKit/win/Interfaces/WebKit.idl</a></li>
<li><a href="#trunkSourceWebKitwinWebApplicationCacheh">trunk/Source/WebKit/win/WebApplicationCache.h</a></li>
<li><a href="#trunkSourceWebKitwinWebSecurityOrigincpp">trunk/Source/WebKit/win/WebSecurityOrigin.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebSecurityOriginh">trunk/Source/WebKit/win/WebSecurityOrigin.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreewinAccessibilityControllerWincpp">trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinDumpRenderTreecpp">trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinTestRunnerWincpp">trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -354,7 +354,7 @@
</span><span class="cx"> 
</span><span class="cx">         return JSObject::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
</span><span class="cx">     }
</span><del>-
</del><ins>+    I
</ins><span class="cx">     static NO_RETURN_DUE_TO_CRASH void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&amp;)
</span><span class="cx">     {
</span><span class="cx">         RELEASE_ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Source/WebKit/win/ChangeLog        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2014-12-18  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [Win] Update DumpRenderTree to more closely match Mac version
+        https://bugs.webkit.org/show_bug.cgi?id=139799
+
+        Reviewed by Tim Horton.
+
+        * Interfaces/IWebSecurityOrigin.idl: Add initializer from URL.
+        * Interfaces/WebKit.idl: Add CLSID so we can instantiate a
+        WebSecurityOrigin from COM.
+        * WebApplicationCache.h: Decorate class declaration with CLSID
+        to support COM introspection.
+        * WebSecurityOrigin.cpp: Get rid of meaningless STDMETHODCALLTYPE
+        declarations inside implementation.
+        (WebSecurityOrigin::QueryInterface):
+        (WebSecurityOrigin::AddRef):
+        (WebSecurityOrigin::Release):
+        (WebSecurityOrigin::protocol):
+        (WebSecurityOrigin::host):
+        (WebSecurityOrigin::port):
+        (WebSecurityOrigin::usage):
+        (WebSecurityOrigin::quota):
+        (WebSecurityOrigin::setQuota):
+        (WebSecurityOrigin::initWithURL): Added.
+        * WebSecurityOrigin.h:
+
+2014-12-18  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
</ins><span class="cx">         [Win] Correct Windows tests after Bug 139149.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=139781
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesIWebSecurityOriginidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Interfaces/IWebSecurityOrigin.idl (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/IWebSecurityOrigin.idl        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Source/WebKit/win/Interfaces/IWebSecurityOrigin.idl        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -47,4 +47,6 @@
</span><span class="cx"> 
</span><span class="cx">     HRESULT quota([out, retval] unsigned long long* result);
</span><span class="cx">     HRESULT setQuota([in] unsigned long long quota);
</span><ins>+
+    HRESULT initWithURL([in] BSTR);
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesWebKitidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Interfaces/WebKit.idl (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/WebKit.idl        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Source/WebKit/win/Interfaces/WebKit.idl        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -295,4 +295,9 @@
</span><span class="cx">     coclass WebUserContentURLPattern {
</span><span class="cx">         [default] interface IWebUserContentURLPattern;
</span><span class="cx">     }
</span><ins>+
+    [uuid(6eb8d98f-2723-4472-88d3-5936f9d6e631)]
+    coclass WebSecurityOrigin {
+        [default] interface IWebSecurityOrigin;
+    };
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebApplicationCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebApplicationCache.h (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebApplicationCache.h        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Source/WebKit/win/WebApplicationCache.h        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebKit.h&quot;
</span><span class="cx"> 
</span><del>-class WebApplicationCache : public IWebApplicationCache {
</del><ins>+class DECLSPEC_UUID(&quot;1119E970-4B13-4B9A-A049-41096104B689&quot;) WebApplicationCache : public IWebApplicationCache {
</ins><span class="cx"> public:
</span><span class="cx">     static WebApplicationCache* createInstance();
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebSecurityOrigincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebSecurityOrigin.cpp (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebSecurityOrigin.cpp        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Source/WebKit/win/WebSecurityOrigin.cpp        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -29,8 +29,10 @@
</span><span class="cx"> #include &quot;WebSecurityOrigin.h&quot;
</span><span class="cx"> #include &quot;WebKitDLL.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;MarshallingHelpers.h&quot;
</ins><span class="cx"> #include &lt;WebCore/BString.h&gt;
</span><span class="cx"> #include &lt;WebCore/DatabaseManager.h&gt;
</span><ins>+#include &lt;WebCore/URL.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -57,7 +59,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // IUnknown ------------------------------------------------------------------------
</span><del>-HRESULT STDMETHODCALLTYPE WebSecurityOrigin::QueryInterface(REFIID riid, void** ppvObject)
</del><ins>+HRESULT WebSecurityOrigin::QueryInterface(REFIID riid, void** ppvObject)
</ins><span class="cx"> {
</span><span class="cx">     *ppvObject = 0;
</span><span class="cx">     if (IsEqualGUID(riid, IID_IUnknown))
</span><span class="lines">@@ -73,12 +75,12 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ULONG STDMETHODCALLTYPE WebSecurityOrigin::AddRef()
</del><ins>+ULONG WebSecurityOrigin::AddRef()
</ins><span class="cx"> {
</span><span class="cx">     return ++m_refCount;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ULONG STDMETHODCALLTYPE WebSecurityOrigin::Release()
</del><ins>+ULONG WebSecurityOrigin::Release()
</ins><span class="cx"> {
</span><span class="cx">     ULONG newRef = --m_refCount;
</span><span class="cx">     if (!newRef)
</span><span class="lines">@@ -89,8 +91,7 @@
</span><span class="cx"> 
</span><span class="cx"> // IWebSecurityOrigin --------------------------------------------------------------
</span><span class="cx"> 
</span><del>-HRESULT STDMETHODCALLTYPE WebSecurityOrigin::protocol( 
-    /* [retval][out] */ BSTR* result)
</del><ins>+HRESULT WebSecurityOrigin::protocol(/* [retval][out] */ BSTR* result)
</ins><span class="cx"> {
</span><span class="cx">     if (!result)
</span><span class="cx">         return E_POINTER;
</span><span class="lines">@@ -100,8 +101,7 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx">         
</span><del>-HRESULT STDMETHODCALLTYPE WebSecurityOrigin::host( 
-    /* [retval][out] */ BSTR* result)
</del><ins>+HRESULT WebSecurityOrigin::host(/* [retval][out] */ BSTR* result)
</ins><span class="cx"> {
</span><span class="cx">     if (!result)
</span><span class="cx">         return E_POINTER;
</span><span class="lines">@@ -111,8 +111,7 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx">       
</span><del>-HRESULT STDMETHODCALLTYPE WebSecurityOrigin::port( 
-    /* [retval][out] */ unsigned short* result)
</del><ins>+HRESULT WebSecurityOrigin::port(/* [retval][out] */ unsigned short* result)
</ins><span class="cx"> {
</span><span class="cx">     if (!result)
</span><span class="cx">         return E_POINTER;
</span><span class="lines">@@ -122,8 +121,7 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx">         
</span><del>-HRESULT STDMETHODCALLTYPE WebSecurityOrigin::usage( 
-    /* [retval][out] */ unsigned long long* result)
</del><ins>+HRESULT WebSecurityOrigin::usage(/* [retval][out] */ unsigned long long* result)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(SQL_DATABASE)
</span><span class="cx">     if (!result)
</span><span class="lines">@@ -138,8 +136,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">         
</span><del>-HRESULT STDMETHODCALLTYPE WebSecurityOrigin::quota( 
-    /* [retval][out] */ unsigned long long* result)
</del><ins>+HRESULT WebSecurityOrigin::quota(/* [retval][out] */ unsigned long long* result)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(SQL_DATABASE)
</span><span class="cx">     if (!result)
</span><span class="lines">@@ -153,8 +150,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">         
</span><del>-HRESULT STDMETHODCALLTYPE WebSecurityOrigin::setQuota( 
-    /* [in] */ unsigned long long quota) 
</del><ins>+HRESULT WebSecurityOrigin::setQuota(/* [in] */ unsigned long long quota) 
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(SQL_DATABASE)
</span><span class="cx">     DatabaseManager::manager().setQuota(m_securityOrigin.get(), quota);
</span><span class="lines">@@ -165,3 +161,10 @@
</span><span class="cx">     return E_NOTIMPL;
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><ins>+
+HRESULT WebSecurityOrigin::initWithURL(/* [in] */ BSTR urlBstr)
+{
+    m_securityOrigin = WebCore::SecurityOrigin::create(MarshallingHelpers::BSTRToKURL(urlBstr));
+
+    return S_OK;
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitwinWebSecurityOriginh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebSecurityOrigin.h (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebSecurityOrigin.h        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Source/WebKit/win/WebSecurityOrigin.h        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -67,6 +67,8 @@
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE setQuota( 
</span><span class="cx">         /* [in] */ unsigned long long quota);
</span><span class="cx"> 
</span><ins>+    virtual HRESULT STDMETHODCALLTYPE initWithURL(/*[in]*/ BSTR);
+
</ins><span class="cx"> private:
</span><span class="cx">     WebSecurityOrigin(WebCore::SecurityOrigin*);
</span><span class="cx">     ~WebSecurityOrigin();
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Tools/ChangeLog        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -1,3 +1,75 @@
</span><ins>+2014-12-18  Brent Fulgham  &lt;bfulgham@apple.com&gt;
+
+        [Win] Update DumpRenderTree to more closely match Mac version
+        https://bugs.webkit.org/show_bug.cgi?id=139799
+
+        Reviewed by Tim Horton.
+
+        * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+        (AccessibilityController::accessibleElementById): Correct
+        use of BSTR to avoid leak.
+        * DumpRenderTree/win/DumpRenderTree.cpp: Reorder methods and
+        update to match Mac version more closely.
+        (dumpFramesAsText):
+        (dump):
+        (resetDefaultsToConsistentValues):
+        (resetWebViewToConsistentStateBeforeTesting):
+        (sizeWebViewForCurrentTest):
+        (runTest):
+        (openWindows):
+        (windowToWebViewMap):
+        (createWebViewAndOffscreenWindow):
+        (sharedCFURLCache):
+        (initializeGlobalsFromCommandLineOptions):
+        (main):
+        * DumpRenderTree/win/TestRunnerWin.cpp: Ditto.
+        (TestRunner::addDisallowedURL):
+        (TestRunner::applicationCacheDiskUsageForOrigin):
+        (TestRunner::syncLocalStorage):
+        (TestRunner::localStorageDiskUsageForOrigin):
+        (TestRunner::observeStorageTrackerNotifications):
+        (TestRunner::clearApplicationCacheForOrigin):
+        (TestRunner::originsWithApplicationCache):
+        (TestRunner::deleteAllLocalStorage):
+        (TestRunner::setStorageDatabaseIdleInterval):
+        (TestRunner::closeIdleLocalStorageDatabases):
+        (TestRunner::originsWithLocalStorage):
+        (TestRunner::deleteLocalStorageForOrigin):
+        (TestRunner::copyDecodedHostName):
+        (TestRunner::copyEncodedHostName):
+        (TestRunner::keepWebHistory):
+        (TestRunner::numberOfPendingGeolocationPermissionRequests):
+        (TestRunner::setAppCacheMaximumSize):
+        (TestRunner::setCustomPolicyDelegate):
+        (TestRunner::goBack):
+        (TestRunner::setDefersLoading):
+        (TestRunner::setDomainRelaxationForbiddenForURLScheme):
+        (TestRunner::setMockDeviceOrientation):
+        (TestRunner::setMockGeolocationPosition):
+        (TestRunner::setMockGeolocationPositionUnavailableError):
+        (TestRunner::setIconDatabaseEnabled):
+        (TestRunner::setMainFrameIsFirstResponder):
+        (TestRunner::setSpatialNavigationEnabled):
+        (TestRunner::setPluginsEnabled):
+        (TestRunner::setAutomaticLinkDetectionEnabled):
+        (TestRunner::setUseDashboardCompatibilityMode):
+        (TestRunner::dispatchPendingLoadRequests):
+        (TestRunner::findString):
+        (TestRunner::setCacheModel):
+        (TestRunner::apiTestNewWindowDataLoadBaseURL):
+        (TestRunner::setWebViewEditable):
+        (TestRunner::authenticateSession):
+        (TestRunner::abortModal):
+        (TestRunner::setSerializeHTTPLoads):
+        (TestRunner::addChromeInputField):
+        (TestRunner::removeChromeInputField):
+        (TestRunner::focusWebView):
+        (TestRunner::setBackingScaleFactor):
+        (TestRunner::grantWebNotificationPermission):
+        (TestRunner::denyWebNotificationPermission):
+        (TestRunner::removeAllWebNotificationPermissions):
+        (TestRunner::simulateWebNotificationClick):
+
</ins><span class="cx"> 2014-12-18  Gavin Barraclough  &lt;barraclough@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add strong typing to RefCounter interface, return value as a bool.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinAccessibilityControllerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -123,12 +123,9 @@
</span><span class="cx"> {
</span><span class="cx">     AccessibilityUIElement rootAccessibilityUIElement = rootElement();
</span><span class="cx"> 
</span><del>-    BSTR idAttribute = JSStringCopyBSTR(id);
</del><ins>+    _bstr_t idAttribute(JSStringCopyBSTR(id), false);
</ins><span class="cx"> 
</span><span class="cx">     COMPtr&lt;IAccessible&gt; result = findAccessibleObjectById(rootAccessibilityUIElement, idAttribute);
</span><del>-
-    ::SysFreeString(idAttribute);
-
</del><span class="cx">     if (result)
</span><span class="cx">         return AccessibilityUIElement(result);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinDumpRenderTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2014 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -50,8 +50,10 @@
</span><span class="cx"> #include &lt;stdio.h&gt;
</span><span class="cx"> #include &lt;string.h&gt;
</span><span class="cx"> #include &lt;tchar.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><ins>+#include &lt;wtf/text/CString.h&gt;
</ins><span class="cx"> #include &lt;windows.h&gt;
</span><span class="cx"> #include &lt;CoreFoundation/CoreFoundation.h&gt;
</span><span class="cx"> #include &lt;WebCore/FileSystem.h&gt;
</span><span class="lines">@@ -81,14 +83,17 @@
</span><span class="cx"> 
</span><span class="cx"> const LPCWSTR kDumpRenderTreeClassName = L&quot;DumpRenderTreeWindow&quot;;
</span><span class="cx"> 
</span><ins>+static bool dumpPixelsForAllTests = false;
+static bool dumpPixelsForCurrentTest = false;
+static bool threaded = false;
</ins><span class="cx"> static bool dumpTree = true;
</span><del>-static bool dumpPixelsForAllTests = false;
-static bool dumpPixelsForCurrentTest;
</del><ins>+static bool useTimeoutWatchdog = true;
+static bool forceComplexText = false;
</ins><span class="cx"> static bool dumpAllPixels;
</span><del>-static bool printSeparators;
</del><ins>+static bool useAcceleratedDrawing = true; // Not used
+static bool gcBetweenTests = false;
+static bool printSeparators = false;
</ins><span class="cx"> static bool leakChecking = false;
</span><del>-static bool threaded = false;
-static bool forceComplexText = false;
</del><span class="cx"> static bool printSupportedFeatures = false;
</span><span class="cx"> static RetainPtr&lt;CFStringRef&gt; persistentUserStyleSheetLocation;
</span><span class="cx"> 
</span><span class="lines">@@ -433,6 +438,7 @@
</span><span class="cx">     COMPtr&lt;IWebFrame&gt; parent;
</span><span class="cx">     if (FAILED(frame-&gt;parentFrame(&amp;parent)))
</span><span class="cx">         return L&quot;&quot;;
</span><ins>+
</ins><span class="cx">     if (parent) {
</span><span class="cx">         _bstr_t name;
</span><span class="cx">         if (FAILED(frame-&gt;name(&amp;name.GetBSTR())))
</span><span class="lines">@@ -455,14 +461,15 @@
</span><span class="cx">         COMPtr&lt;IEnumVARIANT&gt; enumKids;
</span><span class="cx">         if (FAILED(frame-&gt;childFrames(&amp;enumKids)))
</span><span class="cx">             return L&quot;&quot;;
</span><ins>+
</ins><span class="cx">         VARIANT var;
</span><del>-        VariantInit(&amp;var);
</del><ins>+        ::VariantInit(&amp;var);
</ins><span class="cx">         while (enumKids-&gt;Next(1, &amp;var, 0) == S_OK) {
</span><span class="cx">             ASSERT(V_VT(&amp;var) == VT_UNKNOWN);
</span><span class="cx">             COMPtr&lt;IWebFrame&gt; framePtr;
</span><span class="cx">             V_UNKNOWN(&amp;var)-&gt;QueryInterface(IID_IWebFrame, (void**)&amp;framePtr);
</span><span class="cx">             result.append(dumpFramesAsText(framePtr.get()));
</span><del>-            VariantClear(&amp;var);
</del><ins>+            ::VariantClear(&amp;var);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -667,25 +674,26 @@
</span><span class="cx"> 
</span><span class="cx"> void dump()
</span><span class="cx"> {
</span><ins>+    ::InvalidateRect(webViewWindow, 0, TRUE);
+    ::SendMessage(webViewWindow, WM_PAINT, 0, 0);
+
</ins><span class="cx">     invalidateAnyPreviousWaitToDumpWatchdog();
</span><ins>+    ASSERT(!gTestRunner-&gt;hasPendingWebNotificationClick());
</ins><span class="cx"> 
</span><del>-    COMPtr&lt;IWebDataSource&gt; dataSource;
-    if (SUCCEEDED(frame-&gt;dataSource(&amp;dataSource))) {
-        COMPtr&lt;IWebURLResponse&gt; response;
-        if (SUCCEEDED(dataSource-&gt;response(&amp;response)) &amp;&amp; response) {
-            _bstr_t mimeType;
-            if (SUCCEEDED(response-&gt;MIMEType(&amp;mimeType.GetBSTR())) &amp;&amp; !_tcscmp(static_cast&lt;TCHAR*&gt;(mimeType), TEXT(&quot;text/plain&quot;))) {
-                ::gTestRunner-&gt;setDumpAsText(true);
-                ::gTestRunner-&gt;setGeneratePixelResults(false);
-            }
-        }
-    }
-
</del><span class="cx">     _bstr_t resultString;
</span><span class="cx"> 
</span><span class="cx">     if (dumpTree) {
</span><del>-        ::InvalidateRect(webViewWindow, 0, TRUE);
-        ::SendMessage(webViewWindow, WM_PAINT, 0, 0);
</del><ins>+        COMPtr&lt;IWebDataSource&gt; dataSource;
+        if (SUCCEEDED(frame-&gt;dataSource(&amp;dataSource))) {
+            COMPtr&lt;IWebURLResponse&gt; response;
+            if (SUCCEEDED(dataSource-&gt;response(&amp;response)) &amp;&amp; response) {
+                _bstr_t mimeType;
+                if (SUCCEEDED(response-&gt;MIMEType(&amp;mimeType.GetBSTR())) &amp;&amp; !_tcscmp(static_cast&lt;TCHAR*&gt;(mimeType), TEXT(&quot;text/plain&quot;))) {
+                    ::gTestRunner-&gt;setDumpAsText(true);
+                    ::gTestRunner-&gt;setGeneratePixelResults(false);
+                }
+            }
+        }
</ins><span class="cx"> 
</span><span class="cx">         if (::gTestRunner-&gt;dumpAsText()) {
</span><span class="cx">             resultString = dumpFramesAsText(frame).data();
</span><span class="lines">@@ -719,9 +727,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (dumpPixelsForCurrentTest
</span><del>-     &amp;&amp; gTestRunner-&gt;generatePixelResults()
-     &amp;&amp; !gTestRunner-&gt;dumpDOMAsWebArchive()
-     &amp;&amp; !gTestRunner-&gt;dumpSourceAsWebArchive())
</del><ins>+        &amp;&amp; gTestRunner-&gt;generatePixelResults()
+        &amp;&amp; !gTestRunner-&gt;dumpDOMAsWebArchive()
+        &amp;&amp; !gTestRunner-&gt;dumpSourceAsWebArchive())
</ins><span class="cx">         dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner-&gt;expectedPixelHash());
</span><span class="cx"> 
</span><span class="cx">     printf(&quot;#EOF\n&quot;);   // terminate the (possibly empty) pixels block
</span><span class="lines">@@ -730,7 +738,7 @@
</span><span class="cx"> 
</span><span class="cx"> fail:
</span><span class="cx">     // This will exit from our message loop.
</span><del>-    PostQuitMessage(0);
</del><ins>+    ::PostQuitMessage(0);
</ins><span class="cx">     done = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -756,6 +764,14 @@
</span><span class="cx"> 
</span><span class="cx"> static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
</span><span class="cx"> {
</span><ins>+    ASSERT(preferences);
+
+    preferences-&gt;setAutosaves(FALSE);
+
+    COMPtr&lt;IWebPreferencesPrivate&gt; prefsPrivate(Query, preferences);
+    ASSERT(prefsPrivate);
+    prefsPrivate-&gt;setFullScreenEnabled(TRUE);
+
</ins><span class="cx"> #ifdef USE_MAC_FONTS
</span><span class="cx">     static _bstr_t standardFamily(TEXT(&quot;Times&quot;));
</span><span class="cx">     static _bstr_t fixedFamily(TEXT(&quot;Courier&quot;));
</span><span class="lines">@@ -772,6 +788,8 @@
</span><span class="cx">     static _bstr_t pictographFamily(TEXT(&quot;Times New Roman&quot;));
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    prefsPrivate-&gt;setAllowUniversalAccessFromFileURLs(TRUE);
+    prefsPrivate-&gt;setAllowFileAccessFromFileURLs(TRUE);
</ins><span class="cx">     preferences-&gt;setStandardFontFamily(standardFamily);
</span><span class="cx">     preferences-&gt;setFixedFontFamily(fixedFamily);
</span><span class="cx">     preferences-&gt;setSerifFontFamily(standardFamily);
</span><span class="lines">@@ -779,28 +797,34 @@
</span><span class="cx">     preferences-&gt;setCursiveFontFamily(cursiveFamily);
</span><span class="cx">     preferences-&gt;setFantasyFontFamily(fantasyFamily);
</span><span class="cx">     preferences-&gt;setPictographFontFamily(pictographFamily);
</span><del>-
-    preferences-&gt;setAutosaves(FALSE);
</del><span class="cx">     preferences-&gt;setDefaultFontSize(16);
</span><span class="cx">     preferences-&gt;setDefaultFixedFontSize(13);
</span><span class="cx">     preferences-&gt;setMinimumFontSize(0);
</span><span class="cx">     preferences-&gt;setDefaultTextEncodingName(L&quot;ISO-8859-1&quot;);
</span><span class="cx">     preferences-&gt;setJavaEnabled(FALSE);
</span><del>-    preferences-&gt;setPlugInsEnabled(TRUE);
-    preferences-&gt;setDOMPasteAllowed(TRUE);
</del><ins>+    preferences-&gt;setJavaScriptEnabled(TRUE);
</ins><span class="cx">     preferences-&gt;setEditableLinkBehavior(WebKitEditableLinkOnlyLiveWithShiftKey);
</span><del>-    preferences-&gt;setFontSmoothing(FontSmoothingTypeStandard);
-    preferences-&gt;setUsesPageCache(FALSE);
-    preferences-&gt;setPrivateBrowsingEnabled(FALSE);
-    preferences-&gt;setJavaScriptCanOpenWindowsAutomatically(TRUE);
-    preferences-&gt;setJavaScriptEnabled(TRUE);
</del><span class="cx">     preferences-&gt;setTabsToLinks(FALSE);
</span><ins>+    preferences-&gt;setDOMPasteAllowed(TRUE);
</ins><span class="cx">     preferences-&gt;setShouldPrintBackgrounds(TRUE);
</span><span class="cx">     preferences-&gt;setCacheModel(WebCacheModelDocumentBrowser);
</span><del>-    preferences-&gt;setLoadsImagesAutomatically(TRUE);
</del><ins>+    prefsPrivate-&gt;setXSSAuditorEnabled(FALSE);
+    prefsPrivate-&gt;setExperimentalNotificationsEnabled(FALSE);
+    preferences-&gt;setPlugInsEnabled(TRUE);
</ins><span class="cx">     preferences-&gt;setTextAreasAreResizable(TRUE);
</span><del>-    preferences-&gt;setCSSRegionsEnabled(TRUE);
</del><span class="cx"> 
</span><ins>+    preferences-&gt;setPrivateBrowsingEnabled(FALSE);
+    prefsPrivate-&gt;setAuthorAndUserStylesEnabled(TRUE);
+    // Shrinks standalone images to fit: YES
+    preferences-&gt;setJavaScriptCanOpenWindowsAutomatically(TRUE);
+    prefsPrivate-&gt;setJavaScriptCanAccessClipboard(TRUE);
+    prefsPrivate-&gt;setOfflineWebApplicationCacheEnabled(TRUE);
+    prefsPrivate-&gt;setDeveloperExtrasEnabled(FALSE);
+    // Set JS experiments enabled: YES
+    preferences-&gt;setLoadsImagesAutomatically(TRUE);
+    prefsPrivate-&gt;setLoadsSiteIconsIgnoringImageLoadingPreference(FALSE);
+    prefsPrivate-&gt;setFrameFlatteningEnabled(FALSE);
+    // Set spatial navigation enabled: NO
</ins><span class="cx">     if (persistentUserStyleSheetLocation) {
</span><span class="cx">         Vector&lt;wchar_t&gt; urlCharacters(CFStringGetLength(persistentUserStyleSheetLocation.get()));
</span><span class="cx">         CFStringGetCharacters(persistentUserStyleSheetLocation.get(), CFRangeMake(0, CFStringGetLength(persistentUserStyleSheetLocation.get())), (UniChar *)urlCharacters.data());
</span><span class="lines">@@ -810,26 +834,19 @@
</span><span class="cx">     } else
</span><span class="cx">         preferences-&gt;setUserStyleSheetEnabled(FALSE);
</span><span class="cx"> 
</span><del>-    COMPtr&lt;IWebPreferencesPrivate&gt; prefsPrivate(Query, preferences);
-    if (prefsPrivate) {
-        prefsPrivate-&gt;setAllowUniversalAccessFromFileURLs(TRUE);
-        prefsPrivate-&gt;setAllowFileAccessFromFileURLs(TRUE);
-        prefsPrivate-&gt;setAuthorAndUserStylesEnabled(TRUE);
-        prefsPrivate-&gt;setDeveloperExtrasEnabled(FALSE);
-        prefsPrivate-&gt;setExperimentalNotificationsEnabled(TRUE);
-        prefsPrivate-&gt;setShouldPaintNativeControls(TRUE); // FIXME - need to make DRT pass with Windows native controls &lt;http://bugs.webkit.org/show_bug.cgi?id=25592&gt;
-        prefsPrivate-&gt;setJavaScriptCanAccessClipboard(TRUE);
-        prefsPrivate-&gt;setXSSAuditorEnabled(FALSE);
-        prefsPrivate-&gt;setOfflineWebApplicationCacheEnabled(TRUE);
-        prefsPrivate-&gt;setLoadsSiteIconsIgnoringImageLoadingPreference(FALSE);
-        prefsPrivate-&gt;setFrameFlatteningEnabled(FALSE);
-        prefsPrivate-&gt;setFullScreenEnabled(TRUE);
</del><span class="cx"> #if USE(CG)
</span><del>-        prefsPrivate-&gt;setAcceleratedCompositingEnabled(TRUE);
</del><ins>+    prefsPrivate-&gt;setAcceleratedCompositingEnabled(TRUE);
</ins><span class="cx"> #endif
</span><del>-        prefsPrivate-&gt;setMockScrollbarsEnabled(TRUE);
-        prefsPrivate-&gt;setScreenFontSubstitutionEnabled(TRUE);
-    }
</del><ins>+    // Set WebGL Enabled: NO
+    preferences-&gt;setCSSRegionsEnabled(TRUE);
+    // Set uses HTML5 parser quirks: NO
+    // Async spellcheck: NO
+    prefsPrivate-&gt;setShouldPaintNativeControls(TRUE); // FIXME - need to make DRT pass with Windows native controls &lt;http://bugs.webkit.org/show_bug.cgi?id=25592&gt;
+    prefsPrivate-&gt;setMockScrollbarsEnabled(TRUE);
+
+    preferences-&gt;setFontSmoothing(FontSmoothingTypeStandard);
+    prefsPrivate-&gt;setScreenFontSubstitutionEnabled(TRUE);
+
</ins><span class="cx">     setAlwaysAcceptCookies(false);
</span><span class="cx"> 
</span><span class="cx">     setlocale(LC_ALL, &quot;&quot;);
</span><span class="lines">@@ -841,17 +858,28 @@
</span><span class="cx">     if (FAILED(frame-&gt;webView(&amp;webView))) 
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    webView-&gt;setPolicyDelegate(0);
-    policyDelegate-&gt;setPermissive(false);
-    policyDelegate-&gt;setControllerToNotifyDone(0);
-
</del><span class="cx">     COMPtr&lt;IWebIBActions&gt; webIBActions(Query, webView);
</span><span class="cx">     if (webIBActions) {
</span><span class="cx">         webIBActions-&gt;makeTextStandardSize(0);
</span><span class="cx">         webIBActions-&gt;resetPageZoom(0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    COMPtr&lt;IWebViewPrivate&gt; webViewPrivate(Query, webView);
+    if (webViewPrivate)
+        webViewPrivate-&gt;setTabKeyCyclesThroughElements(TRUE);
</ins><span class="cx"> 
</span><ins>+    webView-&gt;setPolicyDelegate(nullptr);
+    policyDelegate-&gt;setPermissive(false);
+    policyDelegate-&gt;setControllerToNotifyDone(nullptr);
+    sharedFrameLoadDelegate-&gt;resetToConsistentState();
+
+    if (webViewPrivate) {
+        webViewPrivate-&gt;clearMainFrameName();
+        _bstr_t groupName;
+        if (SUCCEEDED(webView-&gt;groupName(&amp;groupName.GetBSTR())))
+            webViewPrivate-&gt;removeAllUserContentFromGroup(groupName);
+    }
+
</ins><span class="cx">     COMPtr&lt;IWebPreferences&gt; preferences;
</span><span class="cx">     if (SUCCEEDED(webView-&gt;preferences(&amp;preferences)))
</span><span class="cx">         resetDefaultsToConsistentValues(preferences.get());
</span><span class="lines">@@ -861,25 +889,14 @@
</span><span class="cx">         WebCoreTestSupport::resetInternalsObject(context);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    COMPtr&lt;IWebViewPrivate&gt; webViewPrivate(Query, webView);
-    if (!webViewPrivate)
-        return;
-
</del><span class="cx">     HWND viewWindow;
</span><del>-    if (SUCCEEDED(webViewPrivate-&gt;viewWindow(&amp;viewWindow)) &amp;&amp; viewWindow)
-        SetFocus(viewWindow);
</del><ins>+    if (webViewPrivate &amp;&amp; SUCCEEDED(webViewPrivate-&gt;viewWindow(&amp;viewWindow)) &amp;&amp; viewWindow)
+        ::SetFocus(viewWindow);
</ins><span class="cx"> 
</span><del>-    webViewPrivate-&gt;clearMainFrameName();
</del><span class="cx">     webViewPrivate-&gt;resetOriginAccessWhitelists();
</span><span class="cx"> 
</span><del>-    _bstr_t groupName;
-    if (SUCCEEDED(webView-&gt;groupName(&amp;groupName.GetBSTR())))
-        webViewPrivate-&gt;removeAllUserContentFromGroup(groupName);
-
</del><span class="cx">     sharedUIDelegate-&gt;resetUndoManager();
</span><span class="cx"> 
</span><del>-    sharedFrameLoadDelegate-&gt;resetToConsistentState();
-
</del><span class="cx">     COMPtr&lt;IWebFramePrivate&gt; framePrivate;
</span><span class="cx">     if (SUCCEEDED(frame-&gt;QueryInterface(&amp;framePrivate)))
</span><span class="cx">         framePrivate-&gt;clearOpener();
</span><span class="lines">@@ -888,15 +905,8 @@
</span><span class="cx"> static void sizeWebViewForCurrentTest()
</span><span class="cx"> {
</span><span class="cx">     bool isSVGW3CTest = (gTestRunner-&gt;testURL().find(&quot;svg\\W3C-SVG-1.1&quot;) != string::npos);
</span><del>-    unsigned width;
-    unsigned height;
-    if (isSVGW3CTest) {
-        width = TestRunner::w3cSVGViewWidth;
-        height = TestRunner::w3cSVGViewHeight;
-    } else {
-        width = TestRunner::viewWidth;
-        height = TestRunner::viewHeight;
-    }
</del><ins>+    unsigned width = isSVGW3CTest ? TestRunner::w3cSVGViewWidth : TestRunner::viewWidth;
+    unsigned height = isSVGW3CTest ? TestRunner::w3cSVGViewHeight : TestRunner::viewHeight;
</ins><span class="cx"> 
</span><span class="cx">     ::SetWindowPos(webViewWindow, 0, 0, 0, width, height, SWP_NOMOVE);
</span><span class="cx"> }
</span><span class="lines">@@ -1017,6 +1027,8 @@
</span><span class="cx"> 
</span><span class="cx">     addFontFallbackIfPresent(fallbackPath);
</span><span class="cx"> 
</span><ins>+    resetWebViewToConsistentStateBeforeTesting();
+
</ins><span class="cx">     sizeWebViewForCurrentTest();
</span><span class="cx">     gTestRunner-&gt;setIconDatabaseEnabled(false);
</span><span class="cx">     gTestRunner-&gt;clearAllApplicationCaches();
</span><span class="lines">@@ -1032,15 +1044,10 @@
</span><span class="cx">                 gTestRunner-&gt;setDumpHistoryDelegateCallbacks(true);            
</span><span class="cx">                 viewPrivate-&gt;setHistoryDelegate(sharedHistoryDelegate.get());
</span><span class="cx">             } else
</span><del>-                viewPrivate-&gt;setHistoryDelegate(0);
</del><ins>+                viewPrivate-&gt;setHistoryDelegate(nullptr);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    COMPtr&lt;IWebHistory&gt; history;
-    if (SUCCEEDED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast&lt;void**&gt;(&amp;history))))
-        history-&gt;setOptionalSharedHistory(0);
</del><span class="cx"> 
</span><del>-    resetWebViewToConsistentStateBeforeTesting();
-
</del><span class="cx">     if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
</span><span class="cx">         gTestRunner-&gt;setDeveloperExtrasEnabled(true);
</span><span class="cx">         if (shouldDumpAsText(pathOrURL.c_str())) {
</span><span class="lines">@@ -1049,13 +1056,15 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    prevTestBFItem = 0;
-    if (webView) {
-        COMPtr&lt;IWebBackForwardList&gt; bfList;
-        if (SUCCEEDED(webView-&gt;backForwardList(&amp;bfList)))
-            bfList-&gt;currentItem(&amp;prevTestBFItem);
-    }
</del><ins>+    COMPtr&lt;IWebHistory&gt; history;
+    if (SUCCEEDED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast&lt;void**&gt;(&amp;history))))
+        history-&gt;setOptionalSharedHistory(nullptr);
</ins><span class="cx"> 
</span><ins>+    prevTestBFItem = nullptr;
+    COMPtr&lt;IWebBackForwardList&gt; bfList;
+    if (webView &amp;&amp; SUCCEEDED(webView-&gt;backForwardList(&amp;bfList)))
+        bfList-&gt;currentItem(&amp;prevTestBFItem);
+
</ins><span class="cx">     WorkQueue::shared()-&gt;clear();
</span><span class="cx">     WorkQueue::shared()-&gt;setFrozen(false);
</span><span class="cx"> 
</span><span class="lines">@@ -1077,7 +1086,7 @@
</span><span class="cx"> #if USE(CF)
</span><span class="cx">         CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true);
</span><span class="cx"> #endif
</span><del>-        if (!GetMessage(&amp;msg, 0, 0, 0))
</del><ins>+        if (!::GetMessage(&amp;msg, 0, 0, 0))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         // We get spurious WM_MOUSELEAVE events which make event handling machinery think that mouse button
</span><span class="lines">@@ -1085,19 +1094,13 @@
</span><span class="cx">         // Mouse can never leave WebView during normal DumpRenderTree operation, so we just ignore all such events.
</span><span class="cx">         if (msg.message == WM_MOUSELEAVE)
</span><span class="cx">             continue;
</span><del>-        TranslateMessage(&amp;msg);
-        DispatchMessage(&amp;msg);
</del><ins>+        ::TranslateMessage(&amp;msg);
+        ::DispatchMessage(&amp;msg);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
-        gTestRunner-&gt;closeWebInspector();
-        gTestRunner-&gt;setDeveloperExtrasEnabled(false);
-    }
</del><ins>+    // EventSendingController clearSavedEvents
+    WorkQueue::shared()-&gt;clear();
</ins><span class="cx"> 
</span><del>-    resetWebViewToConsistentStateBeforeTesting();
-
-    frame-&gt;stopLoading();
-
</del><span class="cx">     if (::gTestRunner-&gt;closeRemainingWindowsWhenComplete()) {
</span><span class="cx">         Vector&lt;HWND&gt; windows = openWindows();
</span><span class="cx">         unsigned size = windows.size();
</span><span class="lines">@@ -1108,10 +1111,19 @@
</span><span class="cx">             if (window == hostWindow)
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            DestroyWindow(window);
</del><ins>+            ::DestroyWindow(window);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+        gTestRunner-&gt;closeWebInspector();
+        gTestRunner-&gt;setDeveloperExtrasEnabled(false);
+    }
+
+    resetWebViewToConsistentStateBeforeTesting();
+
+    frame-&gt;stopLoading();
+
</ins><span class="cx"> exit:
</span><span class="cx">     removeFontFallbackIfPresent(fallbackPath);
</span><span class="cx">     ::gTestRunner.clear();
</span><span class="lines">@@ -1121,13 +1133,13 @@
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;HWND&gt;&amp; openWindows()
</span><span class="cx"> {
</span><del>-    static Vector&lt;HWND&gt; vector;
</del><ins>+    static NeverDestroyed&lt;Vector&lt;HWND&gt;&gt; vector;
</ins><span class="cx">     return vector;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WindowToWebViewMap&amp; windowToWebViewMap()
</span><span class="cx"> {
</span><del>-    static WindowToWebViewMap map;
</del><ins>+    static NeverDestroyed&lt;WindowToWebViewMap&gt; map;
</ins><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1138,26 +1150,25 @@
</span><span class="cx">     HWND hostWindow = CreateWindowEx(WS_EX_TOOLWINDOW, kDumpRenderTreeClassName, TEXT(&quot;DumpRenderTree&quot;), WS_POPUP,
</span><span class="cx">       -maxViewWidth, -maxViewHeight, maxViewWidth, maxViewHeight, 0, 0, GetModuleHandle(0), 0);
</span><span class="cx"> 
</span><del>-    IWebView* webView;
-
</del><ins>+    IWebView* webView = nullptr;
</ins><span class="cx">     HRESULT hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, (void**)&amp;webView);
</span><span class="cx">     if (FAILED(hr)) {
</span><span class="cx">         fprintf(stderr, &quot;Failed to create CLSID_WebView instance, error 0x%x\n&quot;, hr);
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (FAILED(webView-&gt;setHostWindow(hostWindow)))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     RECT clientRect;
</span><span class="cx">     clientRect.bottom = clientRect.left = clientRect.top = clientRect.right = 0;
</span><span class="cx">     _bstr_t groupName(L&quot;org.webkit.DumpRenderTree&quot;);
</span><span class="cx">     if (FAILED(webView-&gt;initWithFrame(clientRect, 0, groupName)))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     COMPtr&lt;IWebViewPrivate&gt; viewPrivate;
</span><span class="cx">     if (FAILED(webView-&gt;QueryInterface(&amp;viewPrivate)))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     viewPrivate-&gt;setShouldApplyMacFontAscentHack(TRUE);
</span><span class="cx">     viewPrivate-&gt;setAlwaysUsesComplexTextCodePath(forceComplexText);
</span><span class="lines">@@ -1166,38 +1177,38 @@
</span><span class="cx">     _tcscpy(static_cast&lt;TCHAR*&gt;(pluginPath), exePath().c_str());
</span><span class="cx">     _tcscat(static_cast&lt;TCHAR*&gt;(pluginPath), TestPluginDir);
</span><span class="cx">     if (FAILED(viewPrivate-&gt;addAdditionalPluginDirectory(pluginPath)))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     HWND viewWindow;
</span><span class="cx">     if (FAILED(viewPrivate-&gt;viewWindow(&amp;viewWindow)))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     if (webViewWindow)
</span><span class="cx">         *webViewWindow = viewWindow;
</span><span class="cx"> 
</span><del>-    SetWindowPos(viewWindow, 0, 0, 0, maxViewWidth, maxViewHeight, 0);
-    ShowWindow(hostWindow, SW_SHOW);
</del><ins>+    ::SetWindowPos(viewWindow, 0, 0, 0, maxViewWidth, maxViewHeight, 0);
+    ::ShowWindow(hostWindow, SW_SHOW);
</ins><span class="cx"> 
</span><span class="cx">     if (FAILED(webView-&gt;setFrameLoadDelegate(sharedFrameLoadDelegate.get())))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     if (FAILED(viewPrivate-&gt;setFrameLoadDelegatePrivate(sharedFrameLoadDelegate.get())))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     if (FAILED(webView-&gt;setUIDelegate(sharedUIDelegate.get())))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     COMPtr&lt;IWebViewEditing&gt; viewEditing;
</span><span class="cx">     if (FAILED(webView-&gt;QueryInterface(&amp;viewEditing)))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     if (FAILED(viewEditing-&gt;setEditingDelegate(sharedEditingDelegate.get())))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     ResourceLoadDelegate* resourceLoadDelegate = new ResourceLoadDelegate();
</span><span class="cx">     HRESULT result = webView-&gt;setResourceLoadDelegate(resourceLoadDelegate);
</span><span class="cx">     resourceLoadDelegate-&gt;Release(); // The delegate is owned by the WebView, so release our reference to it.
</span><span class="cx">     if (FAILED(result))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     openWindows().append(hostWindow);
</span><span class="cx">     windowToWebViewMap().set(hostWindow, webView);
</span><span class="lines">@@ -1213,7 +1224,7 @@
</span><span class="cx">     HMODULE module = GetModuleHandle(TEXT(&quot;CFNetwork_debug.dll&quot;));
</span><span class="cx"> #endif
</span><span class="cx">     if (!module)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     typedef CFURLCacheRef (*CFURLCacheCopySharedURLCacheProcPtr)(void);
</span><span class="cx">     if (CFURLCacheCopySharedURLCacheProcPtr copyCache = reinterpret_cast&lt;CFURLCacheCopySharedURLCacheProcPtr&gt;(GetProcAddress(module, &quot;CFURLCacheCopySharedURLCache&quot;)))
</span><span class="lines">@@ -1223,7 +1234,7 @@
</span><span class="cx">     if (CFURLCacheSharedURLCacheProcPtr sharedCache = reinterpret_cast&lt;CFURLCacheSharedURLCacheProcPtr&gt;(GetProcAddress(module, &quot;CFURLCacheSharedURLCache&quot;)))
</span><span class="cx">         return sharedCache();
</span><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1234,42 +1245,53 @@
</span><span class="cx">     return EXCEPTION_CONTINUE_SEARCH;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int main(int argc, const char* argv[])
</del><ins>+static Vector&lt;const char*&gt; initializeGlobalsFromCommandLineOptions(int argc, const char* argv[])
</ins><span class="cx"> {
</span><del>-#ifdef _CRTDBG_MAP_ALLOC
-    _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
-    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
-#endif
</del><ins>+    Vector&lt;const char*&gt; tests;
</ins><span class="cx"> 
</span><del>-    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
-    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
-    // error mode here to work around Cygwin's behavior. See &lt;http://webkit.org/b/55222&gt;.
-    ::SetErrorMode(0);
</del><ins>+    for (int i = 1; i &lt; argc; ++i) {
+        if (!stricmp(argv[i], &quot;--notree&quot;)) {
+            dumpTree = false;
+            continue;
+        }
</ins><span class="cx"> 
</span><del>-    ::SetUnhandledExceptionFilter(exceptionFilter);
</del><ins>+        if (!stricmp(argv[i], &quot;--pixel-tests&quot;)) {
+            dumpPixelsForAllTests = true;
+            continue;
+        }
</ins><span class="cx"> 
</span><del>-    leakChecking = false;
</del><ins>+        if (!stricmp(argv[i], &quot;--tree&quot;)) {
+            dumpTree = true;
+            continue;
+        }
</ins><span class="cx"> 
</span><del>-    _setmode(1, _O_BINARY);
-    _setmode(2, _O_BINARY);
</del><ins>+        if (!stricmp(argv[i], &quot;--threaded&quot;)) {
+            threaded = true;
+            continue;
+        }
</ins><span class="cx"> 
</span><del>-    initialize();
</del><ins>+        if (!stricmp(argv[i], &quot;--complex-text&quot;)) {
+            forceComplexText = true;
+            continue;
+        }
</ins><span class="cx"> 
</span><del>-    Vector&lt;const char*&gt; tests;
</del><ins>+        if (!stricmp(argv[i], &quot;--accelerated-drawing&quot;)) {
+            useAcceleratedDrawing = true;
+            continue;
+        }
</ins><span class="cx"> 
</span><del>-    for (int i = 1; i &lt; argc; ++i) {
-        if (!stricmp(argv[i], &quot;--threaded&quot;)) {
-            threaded = true;
</del><ins>+        if (!stricmp(argv[i], &quot;--gc-between-tests&quot;)) {
+            gcBetweenTests = true;
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!stricmp(argv[i], &quot;--dump-all-pixels&quot;)) {
-            dumpAllPixels = true;
</del><ins>+        if (!stricmp(argv[i], &quot;--no-timeout&quot;)) {
+            useTimeoutWatchdog = false;
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!stricmp(argv[i], &quot;--complex-text&quot;)) {
-            forceComplexText = true;
</del><ins>+        if (!stricmp(argv[i], &quot;--dump-all-pixels&quot;)) {
+            dumpAllPixels = true;
</ins><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1278,14 +1300,35 @@
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!stricmp(argv[i], &quot;--pixel-tests&quot;)) {
-            dumpPixelsForAllTests = true;
-            continue;
-        }
-
</del><span class="cx">         tests.append(argv[i]);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    return tests;
+}
+
+int main(int argc, const char* argv[])
+{
+#ifdef _CRTDBG_MAP_ALLOC
+    _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
+    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
+#endif
+
+    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
+    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
+    // error mode here to work around Cygwin's behavior. See &lt;http://webkit.org/b/55222&gt;.
+    ::SetErrorMode(0);
+
+    ::SetUnhandledExceptionFilter(exceptionFilter);
+
+    leakChecking = false;
+
+    _setmode(1, _O_BINARY);
+    _setmode(2, _O_BINARY);
+
+    initialize();
+
+    Vector&lt;const char*&gt; tests = initializeGlobalsFromCommandLineOptions(argc, argv);
+
</ins><span class="cx">     policyDelegate = new PolicyDelegate();
</span><span class="cx">     sharedFrameLoadDelegate.adoptRef(new FrameLoadDelegate);
</span><span class="cx">     sharedUIDelegate.adoptRef(new UIDelegate);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinTestRunnerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp (177541 => 177542)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2014-12-19 00:51:47 UTC (rev 177541)
+++ trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2014-12-19 01:00:23 UTC (rev 177542)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx"> void TestRunner::addDisallowedURL(JSStringRef url)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement!
</span><ins>+    printf(&quot;ERROR: TestRunner::addDisallowedURL(JSStringRef) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool TestRunner::callShouldCloseOnWebView()
</span><span class="lines">@@ -108,36 +109,66 @@
</span><span class="cx">     applicationCache-&gt;deleteAllApplicationCaches();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name)
</del><ins>+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef url)
</ins><span class="cx"> {
</span><del>-    // FIXME: Implement to get disk usage by all application caches for an origin.
-    return 0;
</del><ins>+    COMPtr&lt;IWebSecurityOrigin&gt; origin;
+    if (FAILED(WebKitCreateInstance(CLSID_WebSecurityOrigin, 0, IID_IWebSecurityOrigin, reinterpret_cast&lt;void**&gt;(&amp;origin))))
+        return 0;
+
+    COMPtr&lt;IWebApplicationCache&gt; applicationCache;
+    if (FAILED(WebKitCreateInstance(CLSID_WebApplicationCache, 0, IID_IWebApplicationCache, reinterpret_cast&lt;void**&gt;(&amp;applicationCache))))
+        return 0;
+
+    _bstr_t urlBstr(JSStringCopyBSTR(url), false);
+    origin-&gt;initWithURL(urlBstr.GetBSTR());
+
+    long long usage = 0;
+    if (FAILED(applicationCache-&gt;diskUsageForOrigin(origin.get(), &amp;usage)))
+        return 0;
+
+    return usage;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::syncLocalStorage()
</span><span class="cx"> {
</span><del>-    // FIXME: Implement.
</del><ins>+    // FIXME: Implement. Requires non-existant (on Windows) WebStorageManager
+    printf(&quot;ERROR: TestRunner::syncLocalStorage() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement to support getting local storage disk usage for an origin.
</del><ins>+    // FIXME: Implement to support getting local storage disk usage for an origin. (Ditto WebStorageManager)
+    printf(&quot;ERROR: TestRunner::localStorageDiskUsageForOrigin(JSStringRef) not implemented\n&quot;);
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::observeStorageTrackerNotifications(unsigned number)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement.
</del><ins>+    // FIXME: Implement. Requires non-existant (on Windows) WebStorageManager
+    printf(&quot;ERROR: TestRunner::observeStorageTrackerNotifications(unsigned) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::clearApplicationCacheForOrigin(JSStringRef origin)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement to support deleting all application cache for an origin.
</del><ins>+    COMPtr&lt;IWebSecurityOrigin&gt; securityOrigin;
+    if (FAILED(WebKitCreateInstance(CLSID_WebSecurityOrigin, 0, IID_IWebSecurityOrigin, reinterpret_cast&lt;void**&gt;(&amp;securityOrigin))))
+        return;
+
+    _bstr_t originBstr(JSStringCopyBSTR(origin), false);
+    if (FAILED(securityOrigin-&gt;initWithURL(originBstr.GetBSTR())))
+        return;
+
+    COMPtr&lt;IWebApplicationCache&gt; applicationCache;
+    if (FAILED(WebKitCreateInstance(CLSID_WebApplicationCache, 0, IID_IWebApplicationCache, reinterpret_cast&lt;void**&gt;(&amp;applicationCache))))
+        return;
+
+    applicationCache-&gt;deleteCacheForOrigin(securityOrigin.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement to get origins that have application caches.
</span><ins>+    printf(&quot;ERROR: TestRunner::originsWithApplicationCache(JSContextRef) not implemented\n&quot;);
</ins><span class="cx">     return JSValueMakeUndefined(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -156,28 +187,33 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::deleteAllLocalStorage()
</span><span class="cx"> {
</span><del>-    // FIXME: Implement.
</del><ins>+    // FIXME: Implement. Requires non-existant (on Windows) WebStorageManager
+    printf(&quot;ERROR: TestRunner::deleteAllLocalStorage() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setStorageDatabaseIdleInterval(double)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement this.
</del><ins>+    // FIXME: Implement. Requires non-existant (on Windows) WebStorageManager
+    printf(&quot;ERROR: TestRunner::setStorageDatabaseIdleInterval(double) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::closeIdleLocalStorageDatabases()
</span><span class="cx"> {
</span><del>-    // FIXME: Implement this.
</del><ins>+    // FIXME: Implement. Requires non-existant (on Windows) WebStorageManager
+    printf(&quot;ERROR: TestRunner::closeIdleLocalStorageDatabases(double) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement.
</del><ins>+    // FIXME: Implement. Requires non-existant (on Windows) WebStorageManager
+    printf(&quot;ERROR: TestRunner::originsWithLocalStorage(JSContextRef) not implemented\n&quot;);
</ins><span class="cx">     return JSValueMakeUndefined(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement.
</del><ins>+    // FIXME: Implement. Requires non-existant (on Windows) WebStorageManager
+    printf(&quot;ERROR: TestRunner::deleteLocalStorageForOrigin(JSStringRef) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::clearBackForwardList()
</span><span class="lines">@@ -209,12 +245,14 @@
</span><span class="cx"> JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement!
</span><ins>+    printf(&quot;ERROR: TestRunner::copyDecodedHostName(JSStringRef) not implemented\n&quot;);
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement!
</span><ins>+    printf(&quot;ERROR: TestRunner::copyEncodedHostName(JSStringRef) not implemented\n&quot;);
</ins><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -230,6 +268,9 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     COMPtr&lt;IWebHistory&gt; sharedHistory;
</span><ins>+    if (SUCCEEDED(history-&gt;optionalSharedHistory(&amp;sharedHistory)) &amp;&amp; sharedHistory)
+        return;
+
</ins><span class="cx">     if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(sharedHistory), reinterpret_cast&lt;void**&gt;(&amp;sharedHistory))))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -239,6 +280,7 @@
</span><span class="cx"> int TestRunner::numberOfPendingGeolocationPermissionRequests()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement for Geolocation layout tests.
</span><ins>+    printf(&quot;ERROR: TestRunner::numberOfPendingGeolocationPermissionRequests() not implemented\n&quot;);
</ins><span class="cx">     return -1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -351,7 +393,11 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setAppCacheMaximumSize(unsigned long long size)
</span><span class="cx"> {
</span><del>-    printf(&quot;ERROR: TestRunner::setAppCacheMaximumSize() not implemented\n&quot;);
</del><ins>+    COMPtr&lt;IWebApplicationCache&gt; applicationCache;
+    if (FAILED(WebKitCreateInstance(CLSID_WebApplicationCache, 0, IID_IWebApplicationCache, reinterpret_cast&lt;void**&gt;(&amp;applicationCache))))
+        return;
+
+    applicationCache-&gt;setMaximumSize(size);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setAuthorAndUserStylesEnabled(bool flag)
</span><span class="lines">@@ -377,11 +423,13 @@
</span><span class="cx">     if (FAILED(frame-&gt;webView(&amp;webView)))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (setDelegate) {
-        policyDelegate-&gt;setPermissive(permissive);
-        webView-&gt;setPolicyDelegate(policyDelegate);
-    } else
-        webView-&gt;setPolicyDelegate(0);
</del><ins>+    if (!setDelegate) {
+        webView-&gt;setPolicyDelegate(nullptr);
+        return;
+    }
+
+    policyDelegate-&gt;setPermissive(permissive);
+    webView-&gt;setPolicyDelegate(policyDelegate);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setDatabaseQuota(unsigned long long quota)
</span><span class="lines">@@ -399,12 +447,25 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::goBack()
</span><span class="cx"> {
</span><del>-    // FIXME: implement to enable loader/navigation-while-deferring-loads.html
</del><ins>+    COMPtr&lt;IWebView&gt; webView;
+    if (FAILED(frame-&gt;webView(&amp;webView)))
+        return;
+
+    BOOL ignore = TRUE;
+    webView-&gt;goBack(&amp;ignore);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestRunner::setDefersLoading(bool)
</del><ins>+void TestRunner::setDefersLoading(bool defers)
</ins><span class="cx"> {
</span><del>-    // FIXME: implement to enable loader/navigation-while-deferring-loads.html
</del><ins>+    COMPtr&lt;IWebView&gt; webView;
+    if (FAILED(frame-&gt;webView(&amp;webView)))
+        return;
+
+    COMPtr&lt;IWebViewPrivate&gt; viewPrivate;
+    if (FAILED(webView-&gt;QueryInterface(&amp;viewPrivate)))
+        return;
+
+    viewPrivate-&gt;setDefersCallbacks(defers);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
</span><span class="lines">@@ -413,27 +474,29 @@
</span><span class="cx">     if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast&lt;void**&gt;(&amp;webView))))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    BSTR schemeBSTR = JSStringCopyBSTR(scheme);
-    webView-&gt;setDomainRelaxationForbiddenForURLScheme(forbidden, schemeBSTR);
-    SysFreeString(schemeBSTR);
</del><ins>+    _bstr_t schemeBSTR(JSStringCopyBSTR(scheme), false);
+    webView-&gt;setDomainRelaxationForbiddenForURLScheme(forbidden, schemeBSTR.GetBSTR());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement for DeviceOrientation layout tests.
</span><span class="cx">     // See https://bugs.webkit.org/show_bug.cgi?id=30335.
</span><ins>+    printf(&quot;ERROR: TestRunner::setMockDeviceOrientation() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement for Geolocation layout tests.
</span><span class="cx">     // See https://bugs.webkit.org/show_bug.cgi?id=28264.
</span><ins>+    printf(&quot;ERROR: TestRunner::setMockGeolocationPosition() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement for Geolocation layout tests.
</span><span class="cx">     // See https://bugs.webkit.org/show_bug.cgi?id=28264.
</span><ins>+    printf(&quot;ERROR: TestRunner::setMockGeolocationPositionUnavailableError() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setGeolocationPermission(bool allow)
</span><span class="lines">@@ -444,6 +507,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled)
</span><span class="cx"> {
</span><ins>+#if ENABLE(ICONDATABASE)
</ins><span class="cx">     // See also &lt;rdar://problem/6480108&gt;
</span><span class="cx">     COMPtr&lt;IWebIconDatabase&gt; iconDatabase;
</span><span class="cx">     COMPtr&lt;IWebIconDatabase&gt; tmpIconDatabase;
</span><span class="lines">@@ -453,11 +517,12 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     iconDatabase-&gt;setEnabled(iconDatabaseEnabled);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestRunner::setMainFrameIsFirstResponder(bool flag)
</del><ins>+void TestRunner::setMainFrameIsFirstResponder(bool)
</ins><span class="cx"> {
</span><del>-    // FIXME: Implement!
</del><ins>+    // Nothing to do here on Windows
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
</span><span class="lines">@@ -493,6 +558,7 @@
</span><span class="cx"> void TestRunner::setSpatialNavigationEnabled(bool enabled)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement for SpatialNavigation layout tests.
</span><ins>+    printf(&quot;ERROR: TestRunner::setSpatialNavigationEnabled(bool) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
</span><span class="lines">@@ -544,7 +610,15 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setPluginsEnabled(bool flag)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement
</del><ins>+    COMPtr&lt;IWebView&gt; webView;
+    if (FAILED(frame-&gt;webView(&amp;webView)))
+        return;
+
+    COMPtr&lt;IWebPreferences&gt; preferences;
+    if (FAILED(webView-&gt;preferences(&amp;preferences)))
+        return;
+
+    preferences-&gt;setPlugInsEnabled(flag);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setJavaScriptCanAccessClipboard(bool enabled)
</span><span class="lines">@@ -567,6 +641,7 @@
</span><span class="cx"> void TestRunner::setAutomaticLinkDetectionEnabled(bool)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement this.
</span><ins>+    printf(&quot;ERROR: TestRunner::setAutomaticLinkDetectionEnabled(bool) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setTabKeyCyclesThroughElements(bool shouldCycle)
</span><span class="lines">@@ -584,7 +659,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setUseDashboardCompatibilityMode(bool flag)
</span><span class="cx"> {
</span><del>-    // FIXME: Implement!
</del><ins>+    // Not implemented on Windows.
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setUserStyleSheetEnabled(bool flag)
</span><span class="lines">@@ -781,6 +856,7 @@
</span><span class="cx"> void TestRunner::dispatchPendingLoadRequests()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement for testing fix for 6727495
</span><ins>+    printf(&quot;ERROR: TestRunner::dispatchPendingLoadRequests() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
</span><span class="lines">@@ -884,12 +960,21 @@
</span><span class="cx"> bool TestRunner::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement
</span><ins>+    printf(&quot;ERROR: TestRunner::findString(...) not implemented\n&quot;);
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestRunner::setCacheModel(int)
</del><ins>+void TestRunner::setCacheModel(int cacheModel)
</ins><span class="cx"> {
</span><del>-    // FIXME: Implement
</del><ins>+    COMPtr&lt;IWebView&gt; webView;
+    if (FAILED(frame-&gt;webView(&amp;webView)))
+        return;
+
+    COMPtr&lt;IWebPreferences&gt; preferences;
+    if (FAILED(webView-&gt;preferences(&amp;preferences)))
+        return;
+
+    preferences-&gt;setCacheModel(static_cast&lt;WebCacheModel&gt;(cacheModel));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool TestRunner::isCommandEnabled(JSStringRef /*name*/)
</span><span class="lines">@@ -1083,7 +1168,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
</span><span class="cx"> {
</span><del>-
</del><ins>+    // Nothing implemented here (compare to Mac)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::apiTestGoToCurrentBackForwardItem()
</span><span class="lines">@@ -1104,21 +1189,33 @@
</span><span class="cx">     webView-&gt;goToBackForwardItem(item.get(), &amp;success);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestRunner::setWebViewEditable(bool)
</del><ins>+void TestRunner::setWebViewEditable(bool editable)
</ins><span class="cx"> {
</span><ins>+    COMPtr&lt;IWebView&gt; webView;
+    if (FAILED(frame-&gt;webView(&amp;webView)))
+        return;
+
+    COMPtr&lt;IWebViewEditing&gt; viewEditing;
+    if (FAILED(webView-&gt;QueryInterface(&amp;viewEditing)))
+        return;
+
+    viewEditing-&gt;setEditable(editable);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::authenticateSession() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::abortModal()
</span><span class="cx"> {
</span><ins>+    // Nothing to do
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setSerializeHTTPLoads(bool)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Implement.
</span><ins>+    printf(&quot;ERROR: TestRunner::setSerializeHTTPLoads() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setTextDirection(JSStringRef direction)
</span><span class="lines">@@ -1132,18 +1229,22 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::addChromeInputField()
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::addChromeInputField() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::removeChromeInputField()
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::removeChromeInputField() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::focusWebView()
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::focusWebView() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::setBackingScaleFactor(double)
</span><span class="cx"> {
</span><ins>+    // Not applicable
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::resetPageVisibility()
</span><span class="lines">@@ -1158,18 +1259,22 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::grantWebNotificationPermission(JSStringRef origin)
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::grantWebNotificationPermission(JSStringRef) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin)
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::denyWebNotificationPermission(JSStringRef) not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::removeAllWebNotificationPermissions()
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::removeAllWebNotificationPermissions() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification)
</span><span class="cx"> {
</span><ins>+    printf(&quot;ERROR: TestRunner::simulateWebNotificationClick() not implemented\n&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title)
</span></span></pre>
</div>
</div>

</body>
</html>