2011-02-26 Vsevolod Vlasov <vsevik@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Feb 2011 08:16:26 +0000 (08:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Feb 2011 08:16:26 +0000 (08:16 +0000)
        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        No new tests. (no code affected, just exporting a method for DumpRenderTree use)

        * WebCore.exp.in:
2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>

        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        Added clearOpener method to WebFrame.

        * public/WebFrame.h:
        * src/WebFrameImpl.cpp:
        (WebKit::WebFrameImpl::clearOpener):
        * src/WebFrameImpl.h:
2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>

        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        Added clearOpener method to DumpRenderTreeSupportGTK.

        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
        (DumpRenderTreeSupportGtk::clearOpener):
        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>

        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        Added clearOpener method to WebFramePrivate.

        * WebView/WebFrame.mm:
        (-[WebFrame _clearOpener]):
        * WebView/WebFramePrivate.h:
2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>

        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        Added clearOpener method to DumpRenderTreeSupportQT.

        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
        (DumpRenderTreeSupportQt::clearOpener):
        * WebCoreSupport/DumpRenderTreeSupportQt.h:
2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>

        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        Added clearOpener method to IWebFramePrivate.
        Touched WebKit.idl to trigger build scripts.

        * Interfaces/IWebFramePrivate.idl:
        * Interfaces/WebKit.idl:
        * WebFrame.cpp:
        (WebFrame::clearOpener):
        * WebFrame.h:
2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>

        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        Added clearOpener method to WKBundleWebFramePrivate.

        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
        (WKBundleFrameClearOpener):
        * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>

        Reviewed by Pavel Feldman.

        DumpRenderTree should reset frame opener between tests.
        https://bugs.webkit.org/show_bug.cgi?id=54874

        Added clearOpener() calls between tests.
        Some tests are using window.open() to change current window location.
        This changes window.opener property whose nullity is checked before
        showing xml viewer.

        * DumpRenderTree/chromium/TestShell.cpp:
        (TestShell::resetTestController):
        * DumpRenderTree/gtk/DumpRenderTree.cpp:
        (resetDefaultsToConsistentValues):
        * DumpRenderTree/mac/DumpRenderTree.mm:
        (resetWebViewToConsistentStateBeforeTesting):
        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
        (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
        * DumpRenderTree/win/DumpRenderTree.cpp:
        (resetWebViewToConsistentStateBeforeTesting):
        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
        (WTR::InjectedBundlePage::reset):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79764 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebFrame.h
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/chromium/src/WebFrameImpl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebFramePrivate.h
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebFramePrivate.idl
Source/WebKit/win/Interfaces/WebKit.idl
Source/WebKit/win/WebFrame.cpp
Source/WebKit/win/WebFrame.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestShell.cpp
Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

index 3ed2ff8..38725e0 100644 (file)
@@ -1,3 +1,14 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        No new tests. (no code affected, just exporting a method for DumpRenderTree use)
+
+        * WebCore.exp.in:
+
 2011-02-26  Chang Shu  <chang.shu@nokia.com>
 
         Reviewed by Antonio Gomes.
index bc49f87..efcb7bf 100644 (file)
@@ -178,6 +178,7 @@ __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKN3WTF6StringEb
 __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestERKNS_14SubstituteDataEb
 __ZN7WebCore11FrameLoader4loadERKNS_15ResourceRequestEb
 __ZN7WebCore11FrameLoader6reloadEb
+__ZN7WebCore11FrameLoader9setOpenerEPNS_5FrameE
 __ZN7WebCore11Geolocation12setIsAllowedEb
 __ZN7WebCore11GeolocationD1Ev
 __ZN7WebCore11HistoryItem10targetItemEv
index 08e5d05..84dac04 100644 (file)
@@ -1,3 +1,17 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        Added clearOpener method to WebFrame.
+
+        * public/WebFrame.h:
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::clearOpener):
+        * src/WebFrameImpl.h:
+
 2011-02-25  Tony Chang  <tony@chromium.org>
 
         Roll chromium deps to include RBGToHSL fix and ICU update.
index 86fdec2..183493d 100644 (file)
@@ -169,6 +169,10 @@ public:
     // Returns the frame that opened this frame or 0 if there is none.
     virtual WebFrame* opener() const = 0;
 
+    // Reset the frame that opened this frame to 0.
+    // This is executed between layout tests runs
+    virtual void clearOpener() = 0;
+
     // Returns the parent frame or 0 if this is a top-most frame.
     virtual WebFrame* parent() const = 0;
 
index 849b55c..cfbc55a 100644 (file)
@@ -579,6 +579,11 @@ WebView* WebFrameImpl::view() const
     return viewImpl();
 }
 
+void WebFrameImpl::clearOpener()
+{
+    m_frame->loader()->setOpener(0);
+}
+
 WebFrame* WebFrameImpl::opener() const
 {
     Frame* opener = 0;
index 55a9f54..169dae4 100644 (file)
@@ -80,6 +80,7 @@ public:
     virtual bool hasVisibleContent() const;
     virtual WebView* view() const;
     virtual WebFrame* opener() const;
+    virtual void clearOpener();
     virtual WebFrame* parent() const;
     virtual WebFrame* top() const;
     virtual WebFrame* firstChild() const;
index 87e381b..17a0556 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        Added clearOpener method to DumpRenderTreeSupportGTK.
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::clearOpener):
+        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+
 2011-02-24  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Eric Seidel.
index a72525c..37cbab8 100644 (file)
@@ -633,6 +633,13 @@ void DumpRenderTreeSupportGtk::dumpConfigurationForViewport(WebKitWebView* webVi
     fprintf(stdout, "viewport size %dx%d scale %f with limits [%f, %f]\n", attrs.layoutSize.width(), attrs.layoutSize.height(), attrs.initialScale, attrs.minimumScale, attrs.maximumScale);
 }
 
+void DumpRenderTreeSupportGtk::clearOpener(WebKitWebFrame* frame)
+{
+    Frame* coreFrame = core(frame);
+    if (coreFrame)
+        coreFrame->loader()->setOpener(0);
+}
+
 unsigned int DumpRenderTreeSupportGtk::workerThreadCount()
 {
 #if ENABLE(WORKERS)
index f85a785..3e5de1c 100644 (file)
@@ -60,6 +60,8 @@ public:
     static JSValueRef nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
     static void dumpConfigurationForViewport(WebKitWebView* webView, gint availableWidth, gint availableHeight);
 
+    static void clearOpener(WebKitWebFrame*);
+
     // FIXME: Move these to webkitwebframe.h once their API has been discussed.
     static GSList* getFrameChildren(WebKitWebFrame*);
     static WTF::CString getInnerText(WebKitWebFrame*);
index 8267609..6f72059 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        Added clearOpener method to WebFramePrivate.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _clearOpener]):
+        * WebView/WebFramePrivate.h:
+
 2011-02-25  Mark Rowe  <mrowe@apple.com>
 
         <rdar://problem/8902546> Build fix.
index 6fc0cd3..0764a4a 100644 (file)
@@ -1374,6 +1374,13 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 #endif
 }
 
+- (void)_clearOpener
+{
+    Frame* coreFrame = _private->coreFrame;
+    if (coreFrame)
+        coreFrame->loader()->setOpener(0);
+}
+
 @end
 
 @implementation WebFrame
index ddfa5cc..75b57c7 100644 (file)
@@ -145,4 +145,8 @@ typedef enum {
 // The top of the accessibility tree.
 - (id)accessibilityRoot;
 
+// Clears frame opener. This is executed between layout tests runs
+- (void)_clearOpener;
+
+
 @end
index d992816..965f6b3 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        Added clearOpener method to DumpRenderTreeSupportQT.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::clearOpener):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
 2011-02-25  Andras Becsi  <abecsi@webkit.org>
 
         Reviewed by Csaba Osztrogon√°c.
index 4004a19..80d6bc1 100644 (file)
@@ -914,6 +914,12 @@ QString DumpRenderTreeSupportQt::responseMimeType(QWebFrame* frame)
     return docLoader->responseMIMEType();
 }
 
+void DumpRenderTreeSupportQt::clearOpener(QWebFrame* frame)
+{
+    WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
+    coreFrame->loader()->setOpener(0);
+}
+
 void DumpRenderTreeSupportQt::addURLToRedirect(const QString& origin, const QString& destination)
 {
     FrameLoaderClientQt::URLsToRedirect[origin] = destination;
index e639456..69f1b45 100644 (file)
@@ -188,6 +188,7 @@ public:
 
     static QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
     static QString responseMimeType(QWebFrame*);
+    static void clearOpener(QWebFrame*);
     static void addURLToRedirect(const QString& origin, const QString& destination);
     static QStringList contextMenu(QWebPage*);
 
index 9e7023f..605ff35 100644 (file)
@@ -1,3 +1,19 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        Added clearOpener method to IWebFramePrivate.
+        Touched WebKit.idl to trigger build scripts.
+
+        * Interfaces/IWebFramePrivate.idl:
+        * Interfaces/WebKit.idl:
+        * WebFrame.cpp:
+        (WebFrame::clearOpener):
+        * WebFrame.h:
+
 2011-02-24  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Eric Seidel.
index 279cbbf..9a1c333 100644 (file)
@@ -119,4 +119,6 @@ interface IWebFramePrivate : IUnknown
     HRESULT loadPlainTextString([in] BSTR string, [in] BSTR url);
 
     HRESULT hasSpellingMarker([in] UINT from, [in] UINT length, [out, retval] BOOL* result);
+    
+    HRESULT clearOpener();
 }
index 88158a4..3f401be 100644 (file)
@@ -301,3 +301,4 @@ library WebKit
         [default] interface IWebUserContentURLPattern;
     }
 }
+
index 80b91cd..16b9a8f 100644 (file)
@@ -1033,6 +1033,15 @@ HRESULT STDMETHODCALLTYPE WebFrame::hasSpellingMarker(
     return S_OK;
 }
 
+HRESULT STDMETHODCALLTYPE WebFrame::clearOpener()
+{
+    HRESULT hr = S_OK;
+    if (Frame* coreFrame = core(this))
+        coreFrame->loader()->setOpener(0);
+
+    return hr;
+}
+
 // IWebDocumentText -----------------------------------------------------------
 
 HRESULT STDMETHODCALLTYPE WebFrame::supportsTextEncoding( 
index 0095590..71f9e52 100644 (file)
@@ -278,6 +278,8 @@ public:
         /* [in] */ UINT length,
         /* [retval][out] */ BOOL *result);
 
+    virtual HRESULT STDMETHODCALLTYPE clearOpener();
+
     // IWebDocumentText
     virtual HRESULT STDMETHODCALLTYPE supportsTextEncoding( 
         /* [retval][out] */ BOOL* result);
index 257f93e..8fbb02f 100644 (file)
@@ -1,3 +1,16 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        Added clearOpener method to WKBundleWebFramePrivate.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+        (WKBundleFrameClearOpener):
+        * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
+
 2011-02-25  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin Adler.
index 82f616a..dd44e93 100644 (file)
@@ -164,6 +164,13 @@ WKBundlePageRef WKBundleFrameGetPage(WKBundleFrameRef frameRef)
     return toAPI(toImpl(frameRef)->page());
 }
 
+void WKBundleFrameClearOpener(WKBundleFrameRef frameRef)
+{
+    Frame* coreFrame = toImpl(frameRef)->coreFrame();
+    if (coreFrame)
+        coreFrame->loader()->setOpener(0);
+}
+
 WKStringRef WKBundleFrameCopyLayerTreeAsText(WKBundleFrameRef frameRef)
 {
     return toCopiedAPI(toImpl(frameRef)->layerTreeAsText());
index 3f83a61..a31e4ae 100644 (file)
@@ -47,6 +47,7 @@ WK_EXPORT void WKBundleFrameSuspendAnimations(WKBundleFrameRef frame);
 WK_EXPORT void WKBundleFrameResumeAnimations(WKBundleFrameRef frame);
 WK_EXPORT unsigned WKBundleFrameGetPendingUnloadCount(WKBundleFrameRef frame);
 WK_EXPORT WKStringRef WKBundleFrameCopyLayerTreeAsText(WKBundleFrameRef frame);
+WK_EXPORT void WKBundleFrameClearOpener(WKBundleFrameRef frame);
 
 #ifdef __cplusplus
 }
index 1f50a2f..11fd3c0 100644 (file)
@@ -1,3 +1,28 @@
+2011-02-26  Vsevolod Vlasov  <vsevik@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        DumpRenderTree should reset frame opener between tests.
+        https://bugs.webkit.org/show_bug.cgi?id=54874
+
+        Added clearOpener() calls between tests.
+        Some tests are using window.open() to change current window location.
+        This changes window.opener property whose nullity is checked before
+        showing xml viewer.
+
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::resetTestController):
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::reset):
+
 2011-02-25  Lukasz Slachciak  <l.slachciak@samsung.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index 14f9ab8..24cae24 100644 (file)
@@ -227,6 +227,7 @@ void TestShell::resetTestController()
     m_drtDevToolsAgent->reset();
     if (m_drtDevToolsClient)
         m_drtDevToolsClient->reset();
+    webView()->mainFrame()->clearOpener();
 }
 
 void TestShell::loadURL(const WebURL& url)
index ca62402..3f70b49 100644 (file)
@@ -463,6 +463,8 @@ static void resetDefaultsToConsistentValues()
 
     if (axController)
         axController->resetToConsistentState();
+
+    DumpRenderTreeSupportGtk::clearOpener(mainFrame);
 }
 
 static bool useLongRunningServerMode(int argc, char *argv[])
index 49f58a2..dca0d38 100644 (file)
@@ -1037,6 +1037,8 @@ static void resetWebViewToConsistentStateBeforeTesting()
     
     // Clear the contents of the general pasteboard
     [[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
+
+    [mainFrame _clearOpener];
 }
 
 static void runTest(const string& testPathOrURL)
index 490b1b8..79ba39c 100644 (file)
@@ -580,6 +580,8 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url)
 #ifndef Q_OS_WINCE
     setlocale(LC_ALL, "");
 #endif
+
+    DumpRenderTreeSupportQt::clearOpener(m_page->mainFrame());
 }
 
 static bool isGlobalHistoryTest(const QUrl& url)
index 8f7a16c..dbf04bd 100644 (file)
@@ -895,6 +895,10 @@ static void resetWebViewToConsistentStateBeforeTesting()
     sharedUIDelegate->resetUndoManager();
 
     sharedFrameLoadDelegate->resetToConsistentState();
+
+    COMPtr<IWebFramePrivate> framePrivate;
+    if (SUCCEEDED(frame->QueryInterface(&framePrivate)))
+        framePrivate->clearOpener();
 }
 
 static void runTest(const string& testPathOrURL)
index 94de0d7..f1f4693 100644 (file)
@@ -256,6 +256,8 @@ void InjectedBundlePage::reset()
     WKBundlePageSetTextZoomFactor(m_page, 1);
 
     m_previousTestBackForwardListItem = adoptWK(WKBundleBackForwardListCopyItemAtIndex(WKBundlePageGetBackForwardList(m_page), 0));
+
+    WKBundleFrameClearOpener(WKBundlePageGetMainFrame(m_page));
 }
 
 // Loader Client Callbacks