Changeset 83021 in webkit
- Timestamp:
- Apr 5, 2011 11:01:02 PM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r83008 r83021 1 2011-04-05 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r83007. 4 http://trac.webkit.org/changeset/83007 5 https://bugs.webkit.org/show_bug.cgi?id=57920 6 7 Broke WebFrameTest.FrameForEnteredContext on Chromium-win and 8 Chromium-mac (Requested by tkent on #webkit). 9 10 * WebKit.gyp: 11 * WebKit.gypi: 12 * public/WebFrame.h: 13 * src/WebFrameImpl.cpp: 14 * tests/WebFrameTest.cpp: 15 (WebKit::WebFrameTest::WebFrameTest): 16 (WebKit::WebFrameTest::registerMockedURLLoad): 17 (WebKit::WebFrameTest::serveRequests): 18 (WebKit::TEST_F): 19 1 20 2011-04-05 James Kozianski <koz@chromium.org> 2 21 -
trunk/Source/WebKit/chromium/WebKit.gyp
r83007 r83021 816 816 ['OS=="win"', { 817 817 'sources': [ 818 # FIXME: Port PopupMenuTest to Linux and Mac.818 # FIXME: Port PopupMenuTest and WebFrameTest to Linux and Mac. 819 819 'tests/PopupMenuTest.cpp', 820 820 'tests/TransparencyWinTest.cpp', 821 821 'tests/UniscribeHelperTest.cpp', 822 'tests/WebFrameTest.cpp', 822 823 'tests/WebPageSerializerTest.cpp', 823 824 ], -
trunk/Source/WebKit/chromium/WebKit.gypi
r83007 r83021 65 65 'tests/TreeTestHelpers.cpp', 66 66 'tests/TreeTestHelpers.h', 67 'tests/WebFrameTest.cpp',68 67 ], 69 68 }, -
trunk/Source/WebKit/chromium/public/WebFrame.h
r83007 r83021 98 98 WEBKIT_API static WebFrame* frameForCurrentContext(); 99 99 100 #if WEBKIT_USING_V8101 // Returns the frame corresponding to the given context. This can return 0102 // if the context is detached from the frame, or if the context doesn't103 // correspond to a frame (e.g., workers).104 WEBKIT_API static WebFrame* frameForContext(v8::Handle<v8::Context>);105 #endif106 107 100 // Returns the frame inside a given frame or iframe element. Returns 0 if 108 101 // the given element is not a frame, iframe or if the frame is empty. -
trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp
r83007 r83021 474 474 } 475 475 476 #if WEBKIT_USING_V8477 WebFrame* WebFrame::frameForContext(v8::Handle<v8::Context> context)478 {479 return WebFrameImpl::fromFrame(V8Proxy::retrieveFrame(context));480 }481 #endif482 483 476 WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element) 484 477 { -
trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp
r83007 r83021 36 36 #include "WebFrame.h" 37 37 #include "WebFrameClient.h" 38 #include "WebSettings.h"39 38 #include "WebString.h" 40 39 #include "WebURL.h" … … 42 41 #include "WebURLResponse.h" 43 42 #include "WebView.h" 44 #include "v8.h"45 43 46 44 using namespace WebKit; … … 50 48 class WebFrameTest : public testing::Test { 51 49 public: 52 WebFrameTest() 53 : baseURL("http://www.test.com/") 54 { 55 } 50 WebFrameTest() {} 56 51 57 52 virtual void TearDown() … … 60 55 } 61 56 62 void registerMockedURLLoad(const std::string& fileName)57 void registerMockedURLLoad(const WebURL& url, const WebURLResponse& response, const WebString& fileName) 63 58 { 64 WebURLResponse response;65 response.initialize();66 response.setMIMEType("text/html");67 68 59 std::string filePath = webkit_support::GetWebKitRootDir().utf8(); 69 filePath += "/Source/WebKit/chromium/tests/data/"; 70 filePath += fileName; 71 72 webkit_support::RegisterMockedURL(WebURL(GURL(baseURL + fileName)), response, WebString::fromUTF8(filePath)); 60 filePath.append("/Source/WebKit/chromium/tests/data/"); 61 filePath.append(fileName.utf8()); 62 webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath)); 73 63 } 74 64 … … 77 67 webkit_support::ServeAsynchronousMockedRequests(); 78 68 } 79 80 void loadFrame(WebFrame* frame, const std::string& fileName)81 {82 WebURLRequest urlRequest;83 urlRequest.initialize();84 urlRequest.setURL(WebURL(GURL(baseURL + fileName)));85 frame->loadRequest(urlRequest);86 }87 88 protected:89 std::string baseURL;90 69 }; 91 70 … … 95 74 TEST_F(WebFrameTest, ContentText) 96 75 { 97 registerMockedURLLoad("iframes_test.html"); 98 registerMockedURLLoad("visible_iframe.html"); 99 registerMockedURLLoad("invisible_iframe.html"); 100 registerMockedURLLoad("zero_sized_iframe.html"); 76 // Register our resources. 77 WebURLResponse response; 78 response.initialize(); 79 response.setMIMEType("text/html"); 80 std::string rootURL = "http://www.test.com/"; 81 const char* files[] = { "iframes_test.html", "visible_iframe.html", 82 "invisible_iframe.html", "zero_sized_iframe.html" }; 83 for (int i = 0; i < (sizeof(files) / sizeof(char*)); ++i) { 84 WebURL webURL = GURL(rootURL + files[i]); 85 registerMockedURLLoad(webURL, response, WebString::fromUTF8(files[i])); 86 } 101 87 102 // Create and initialize the WebView. 88 // Create and initialize the WebView. 103 89 TestWebFrameClient webFrameClient; 104 90 WebView* webView = WebView::create(0); 105 91 webView->initializeMainFrame(&webFrameClient); 106 92 107 loadFrame(webView->mainFrame(), "iframes_test.html"); 93 // Load the main frame URL. 94 WebURL testURL(GURL(rootURL + files[0])); 95 WebURLRequest urlRequest; 96 urlRequest.initialize(); 97 urlRequest.setURL(testURL); 98 webView->mainFrame()->loadRequest(urlRequest); 99 100 // Load all pending asynchronous requests. 108 101 serveRequests(); 109 102 … … 119 112 } 120 113 121 TEST_F(WebFrameTest, FrameForEnteredContext)122 {123 registerMockedURLLoad("iframes_test.html");124 registerMockedURLLoad("visible_iframe.html");125 registerMockedURLLoad("invisible_iframe.html");126 registerMockedURLLoad("zero_sized_iframe.html");127 128 // Create and initialize the WebView.129 TestWebFrameClient webFrameClient;130 WebView* webView = WebView::create(0);131 webView->settings()->setJavaScriptEnabled(true);132 webView->initializeMainFrame(&webFrameClient);133 134 loadFrame(webView->mainFrame(), "iframes_test.html");135 serveRequests();136 137 v8::HandleScope scope;138 EXPECT_EQ(webView->mainFrame(),139 WebFrame::frameForContext(140 webView->mainFrame()->mainWorldScriptContext()));141 EXPECT_EQ(webView->mainFrame()->firstChild(),142 WebFrame::frameForContext(143 webView->mainFrame()->firstChild()->mainWorldScriptContext()));144 145 webView->close();146 114 } 147 148 }
Note: See TracChangeset
for help on using the changeset viewer.