2011-04-05 Sheriff Bot <webkit.review.bot@gmail.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 06:01:02 +0000 (06:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2011 06:01:02 +0000 (06:01 +0000)
        Unreviewed, rolling out r83007.
        http://trac.webkit.org/changeset/83007
        https://bugs.webkit.org/show_bug.cgi?id=57920

        Broke WebFrameTest.FrameForEnteredContext on Chromium-win and
        Chromium-mac (Requested by tkent on #webkit).

        * WebKit.gyp:
        * WebKit.gypi:
        * public/WebFrame.h:
        * src/WebFrameImpl.cpp:
        * tests/WebFrameTest.cpp:
        (WebKit::WebFrameTest::WebFrameTest):
        (WebKit::WebFrameTest::registerMockedURLLoad):
        (WebKit::WebFrameTest::serveRequests):
        (WebKit::TEST_F):

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

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/public/WebFrame.h
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/chromium/tests/WebFrameTest.cpp

index 3d908a3..23582f7 100644 (file)
@@ -1,3 +1,22 @@
+2011-04-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r83007.
+        http://trac.webkit.org/changeset/83007
+        https://bugs.webkit.org/show_bug.cgi?id=57920
+
+        Broke WebFrameTest.FrameForEnteredContext on Chromium-win and
+        Chromium-mac (Requested by tkent on #webkit).
+
+        * WebKit.gyp:
+        * WebKit.gypi:
+        * public/WebFrame.h:
+        * src/WebFrameImpl.cpp:
+        * tests/WebFrameTest.cpp:
+        (WebKit::WebFrameTest::WebFrameTest):
+        (WebKit::WebFrameTest::registerMockedURLLoad):
+        (WebKit::WebFrameTest::serveRequests):
+        (WebKit::TEST_F):
+
 2011-04-05  James Kozianski  <koz@chromium.org>
 
         Unreviewed, rolling out r82976.
index 8003ed4..263b49e 100644 (file)
                     'conditions': [
                         ['OS=="win"', {
                             'sources': [
-                                # FIXME: Port PopupMenuTest to Linux and Mac.
+                                # FIXME: Port PopupMenuTest and WebFrameTest to Linux and Mac.
                                 'tests/PopupMenuTest.cpp',
                                 'tests/TransparencyWinTest.cpp',
                                 'tests/UniscribeHelperTest.cpp',
+                                'tests/WebFrameTest.cpp',
                                 'tests/WebPageSerializerTest.cpp',
                             ],
                         }],
index 88101a3..016cf1a 100644 (file)
@@ -64,7 +64,6 @@
             'tests/TilingDataTest.cpp',
             'tests/TreeTestHelpers.cpp',
             'tests/TreeTestHelpers.h',
-            'tests/WebFrameTest.cpp',
         ],
     },
 }
index 1111422..d5d2ff4 100644 (file)
@@ -97,13 +97,6 @@ public:
     WEBKIT_API static WebFrame* frameForEnteredContext();
     WEBKIT_API static WebFrame* frameForCurrentContext();
 
-#if WEBKIT_USING_V8
-    // Returns the frame corresponding to the given context. This can return 0
-    // if the context is detached from the frame, or if the context doesn't
-    // correspond to a frame (e.g., workers).
-    WEBKIT_API static WebFrame* frameForContext(v8::Handle<v8::Context>);
-#endif
-
     // Returns the frame inside a given frame or iframe element. Returns 0 if
     // the given element is not a frame, iframe or if the frame is empty.
     WEBKIT_API static WebFrame* fromFrameOwnerElement(const WebElement&);
index a96bb0b..9c5e05f 100644 (file)
@@ -473,13 +473,6 @@ WebFrame* WebFrame::frameForCurrentContext()
     return WebFrameImpl::fromFrame(frame);
 }
 
-#if WEBKIT_USING_V8
-WebFrame* WebFrame::frameForContext(v8::Handle<v8::Context> context)
-{
-    return WebFrameImpl::fromFrame(V8Proxy::retrieveFrame(context));
-}
-#endif
-
 WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element)
 {
     return WebFrameImpl::fromFrameOwnerElement(
index b38d544..891fa83 100644 (file)
 #include <webkit/support/webkit_support.h>
 #include "WebFrame.h"
 #include "WebFrameClient.h"
-#include "WebSettings.h"
 #include "WebString.h"
 #include "WebURL.h"
 #include "WebURLRequest.h"
 #include "WebURLResponse.h"
 #include "WebView.h"
-#include "v8.h"
 
 using namespace WebKit;
 
@@ -49,44 +47,25 @@ namespace {
 
 class WebFrameTest : public testing::Test {
 public:
-    WebFrameTest()
-        : baseURL("http://www.test.com/")
-    {
-    }
+    WebFrameTest() {}
 
     virtual void TearDown()
     {
         webkit_support::UnregisterAllMockedURLs();
     }
 
-    void registerMockedURLLoad(const std::string& fileName)
+    void registerMockedURLLoad(const WebURL& url, const WebURLResponse& response, const WebString& fileName)
     {
-        WebURLResponse response;
-        response.initialize();
-        response.setMIMEType("text/html");
-
         std::string filePath = webkit_support::GetWebKitRootDir().utf8();
-        filePath += "/Source/WebKit/chromium/tests/data/";
-        filePath += fileName;
-
-        webkit_support::RegisterMockedURL(WebURL(GURL(baseURL + fileName)), response, WebString::fromUTF8(filePath));
+        filePath.append("/Source/WebKit/chromium/tests/data/");
+        filePath.append(fileName.utf8());
+        webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath));
     }
 
     void serveRequests()
     {
         webkit_support::ServeAsynchronousMockedRequests();
     }
-
-    void loadFrame(WebFrame* frame, const std::string& fileName)
-    {
-        WebURLRequest urlRequest;
-        urlRequest.initialize();
-        urlRequest.setURL(WebURL(GURL(baseURL + fileName)));
-        frame->loadRequest(urlRequest);
-    }
-
-protected:
-    std::string baseURL;
 };
 
 class TestWebFrameClient : public WebFrameClient {
@@ -94,17 +73,31 @@ class TestWebFrameClient : public WebFrameClient {
 
 TEST_F(WebFrameTest, ContentText)
 {
-    registerMockedURLLoad("iframes_test.html");
-    registerMockedURLLoad("visible_iframe.html");
-    registerMockedURLLoad("invisible_iframe.html");
-    registerMockedURLLoad("zero_sized_iframe.html");
+    // Register our resources.
+    WebURLResponse response;
+    response.initialize();
+    response.setMIMEType("text/html");
+    std::string rootURL = "http://www.test.com/";
+    const char* files[] = { "iframes_test.html", "visible_iframe.html",
+                            "invisible_iframe.html", "zero_sized_iframe.html" };
+    for (int i = 0; i < (sizeof(files) / sizeof(char*)); ++i) {
+        WebURL webURL = GURL(rootURL + files[i]);
+        registerMockedURLLoad(webURL, response, WebString::fromUTF8(files[i]));
+    }
 
-    // Create and initialize the WebView.
+    // Create and initialize the WebView.    
     TestWebFrameClient webFrameClient;
     WebView* webView = WebView::create(0);
     webView->initializeMainFrame(&webFrameClient);
 
-    loadFrame(webView->mainFrame(), "iframes_test.html");
+    // Load the main frame URL.
+    WebURL testURL(GURL(rootURL + files[0]));
+    WebURLRequest urlRequest;
+    urlRequest.initialize();
+    urlRequest.setURL(testURL);
+    webView->mainFrame()->loadRequest(urlRequest);
+
+    // Load all pending asynchronous requests.
     serveRequests();
 
     // Now retrieve the frames text and test it only includes visible elements.
@@ -118,31 +111,4 @@ TEST_F(WebFrameTest, ContentText)
     webView->close();
 }
 
-TEST_F(WebFrameTest, FrameForEnteredContext)
-{
-    registerMockedURLLoad("iframes_test.html");
-    registerMockedURLLoad("visible_iframe.html");
-    registerMockedURLLoad("invisible_iframe.html");
-    registerMockedURLLoad("zero_sized_iframe.html");
-
-    // Create and initialize the WebView.
-    TestWebFrameClient webFrameClient;
-    WebView* webView = WebView::create(0);
-    webView->settings()->setJavaScriptEnabled(true);
-    webView->initializeMainFrame(&webFrameClient);
-
-    loadFrame(webView->mainFrame(), "iframes_test.html");
-    serveRequests();
-
-    v8::HandleScope scope;
-    EXPECT_EQ(webView->mainFrame(),
-              WebFrame::frameForContext(
-                  webView->mainFrame()->mainWorldScriptContext()));
-    EXPECT_EQ(webView->mainFrame()->firstChild(),
-              WebFrame::frameForContext(
-                  webView->mainFrame()->firstChild()->mainWorldScriptContext()));
-
-    webView->close();
-}
-
 }