Title: [185400] trunk
Revision
185400
Author
[email protected]
Date
2015-06-09 20:34:24 -0700 (Tue, 09 Jun 2015)

Log Message

Implement dumpProgressFinishedCallback() for Win layoutTestController.
https://bugs.webkit.org/show_bug.cgi?id=66773

Patch by Hyungwook Lee <[email protected]> on 2015-06-09
Reviewed by Darin Adler.

Source/WebKit/win:

* WebView.cpp:
(WebView::setFrameLoadDelegatePrivate):

Tools:

* DumpRenderTree/win/FrameLoadDelegate.cpp:
* DumpRenderTree/win/FrameLoadDelegate.h:

LayoutTests:

* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (185399 => 185400)


--- trunk/LayoutTests/ChangeLog	2015-06-10 02:00:40 UTC (rev 185399)
+++ trunk/LayoutTests/ChangeLog	2015-06-10 03:34:24 UTC (rev 185400)
@@ -1,3 +1,12 @@
+2015-06-09  Hyungwook Lee  <[email protected]>
+
+        Implement dumpProgressFinishedCallback() for Win layoutTestController.
+        https://bugs.webkit.org/show_bug.cgi?id=66773
+
+        Reviewed by Darin Adler.
+
+        * platform/win/TestExpectations:
+
 2015-06-09  Ryosuke Niwa  <[email protected]>
 
         REGRESSION(r180867): Tabbing to login field on iCloud.com doesn't have highlight for text

Modified: trunk/LayoutTests/platform/win/TestExpectations (185399 => 185400)


--- trunk/LayoutTests/platform/win/TestExpectations	2015-06-10 02:00:40 UTC (rev 185399)
+++ trunk/LayoutTests/platform/win/TestExpectations	2015-06-10 03:34:24 UTC (rev 185400)
@@ -457,9 +457,6 @@
 # Font feature settings is not implemented.
 css3/font-feature-settings-rendering.html [ Skip ]
 
-# TODO Implement dumpProgressFinishedCallback
-webkit.org/b/66773 http/tests/loading/progress-finished-callback.html
-
 # TODO HiDPI tests require test infrastructure enhancements (e.g. testRunner.setBackingScaleFactor)
 # https://bugs.webkit.org/show_bug.cgi?id=87919
 webkit.org/b/87919 compositing/tiled-layers-hidpi.html

Modified: trunk/Source/WebKit/win/ChangeLog (185399 => 185400)


--- trunk/Source/WebKit/win/ChangeLog	2015-06-10 02:00:40 UTC (rev 185399)
+++ trunk/Source/WebKit/win/ChangeLog	2015-06-10 03:34:24 UTC (rev 185400)
@@ -1,3 +1,13 @@
+2015-06-09  Hyungwook Lee  <[email protected]>
+
+        Implement dumpProgressFinishedCallback() for Win layoutTestController.
+        https://bugs.webkit.org/show_bug.cgi?id=66773
+
+        Reviewed by Darin Adler.
+
+        * WebView.cpp:
+        (WebView::setFrameLoadDelegatePrivate):
+
 2015-06-08  Chris Dumez  <[email protected]>
 
         Access GCController instance via GCController::singleton() instead of a free function

Modified: trunk/Source/WebKit/win/WebView.cpp (185399 => 185400)


--- trunk/Source/WebKit/win/WebView.cpp	2015-06-10 02:00:40 UTC (rev 185399)
+++ trunk/Source/WebKit/win/WebView.cpp	2015-06-10 03:34:24 UTC (rev 185400)
@@ -5249,7 +5249,23 @@
 HRESULT STDMETHODCALLTYPE WebView::setFrameLoadDelegatePrivate( 
     /* [in] */ IWebFrameLoadDelegatePrivate* d)
 {
+    if (m_frameLoadDelegatePrivate == d)
+        return S_OK;
+
+    static BSTR webViewProgressFinishedNotificationName = SysAllocString(WebViewProgressFinishedNotification);
+
+    IWebNotificationCenter* notifyCenter = WebNotificationCenter::defaultCenterInternal();
+
+    COMPtr<IWebNotificationObserver> wasObserver(Query, m_frameLoadDelegatePrivate);
+    if (wasObserver)
+        notifyCenter->removeObserver(wasObserver.get(), webViewProgressFinishedNotificationName, nullptr);
+
     m_frameLoadDelegatePrivate = d;
+
+    COMPtr<IWebNotificationObserver> isObserver(Query, m_frameLoadDelegatePrivate);
+    if (isObserver)
+        notifyCenter->addObserver(isObserver.get(), webViewProgressFinishedNotificationName, nullptr);
+
     return S_OK;
 }
 

Modified: trunk/Tools/ChangeLog (185399 => 185400)


--- trunk/Tools/ChangeLog	2015-06-10 02:00:40 UTC (rev 185399)
+++ trunk/Tools/ChangeLog	2015-06-10 03:34:24 UTC (rev 185400)
@@ -1,3 +1,13 @@
+2015-06-09  Hyungwook Lee  <[email protected]>
+
+        Implement dumpProgressFinishedCallback() for Win layoutTestController.
+        https://bugs.webkit.org/show_bug.cgi?id=66773
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/win/FrameLoadDelegate.cpp:
+        * DumpRenderTree/win/FrameLoadDelegate.h:
+
 2015-06-09  Ryosuke Niwa  <[email protected]>
 
         run-benchmark should either checkout JetStream 1.0.1 or support running the latest version

Modified: trunk/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp (185399 => 185400)


--- trunk/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp	2015-06-10 02:00:40 UTC (rev 185399)
+++ trunk/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp	2015-06-10 03:34:24 UTC (rev 185400)
@@ -96,6 +96,8 @@
         *ppvObject = static_cast<IWebFrameLoadDelegatePrivate*>(this);
     else if (IsEqualGUID(riid, IID_IWebFrameLoadDelegatePrivate2))
         *ppvObject = static_cast<IWebFrameLoadDelegatePrivate2*>(this);
+    else if (IsEqualGUID(riid, IID_IWebNotificationObserver))
+        *ppvObject = static_cast<IWebNotificationObserver*>(this);
     else
         return E_NOINTERFACE;
 
@@ -424,3 +426,24 @@
 
     return S_OK;
 }
+
+HRESULT FrameLoadDelegate::onNotify(IWebNotification* notification)
+{
+    _bstr_t notificationName;
+    HRESULT hr = notification->name(&notificationName.GetBSTR());
+    if (FAILED(hr))
+        return hr;
+
+    static _bstr_t webViewProgressFinishedNotificationName(WebViewProgressFinishedNotification);
+
+    if (!wcscmp(notificationName, webViewProgressFinishedNotificationName))
+        webViewProgressFinishedNotification();
+
+    return S_OK;
+}
+
+void FrameLoadDelegate::webViewProgressFinishedNotification()
+{
+    if (!done && gTestRunner->dumpProgressFinishedCallback())
+        printf("postProgressFinishedNotification\n");
+}

Modified: trunk/Tools/DumpRenderTree/win/FrameLoadDelegate.h (185399 => 185400)


--- trunk/Tools/DumpRenderTree/win/FrameLoadDelegate.h	2015-06-10 02:00:40 UTC (rev 185399)
+++ trunk/Tools/DumpRenderTree/win/FrameLoadDelegate.h	2015-06-10 03:34:24 UTC (rev 185400)
@@ -35,7 +35,7 @@
 class TextInputController;
 class GCController;
 
-class FrameLoadDelegate : public IWebFrameLoadDelegate, public IWebFrameLoadDelegatePrivate2 {
+class FrameLoadDelegate : public IWebFrameLoadDelegate, public IWebFrameLoadDelegatePrivate2, public IWebNotificationObserver {
 public:
     FrameLoadDelegate();
     virtual ~FrameLoadDelegate();
@@ -150,11 +150,15 @@
         /* [in] */ IWebView *sender,
         /* [in] */ IWebFrame *frame) { return E_NOTIMPL; } 
 
+    // IWebNotificationObserver
+    virtual HRESULT STDMETHODCALLTYPE onNotify(IWebNotification*);
+
 private:
     void didClearWindowObjectForFrameInIsolatedWorld(IWebFrame*, IWebScriptWorld*);
     void didClearWindowObjectForFrameInStandardWorld(IWebFrame*);
 
     void locationChangeDone(IWebError*, IWebFrame*);
+    void webViewProgressFinishedNotification();
 
     ULONG m_refCount;
     std::unique_ptr<GCController> m_gcController;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to