diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
commit | 49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch) | |
tree | 5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit/chromium/tests/WebFrameTest.cpp | |
parent | b211c645d8ab690f713515dfdc84d80b11c27d2c (diff) | |
download | qtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz |
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebKit/chromium/tests/WebFrameTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/WebFrameTest.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp index 4aa905c78..40705808d 100644 --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp @@ -36,6 +36,7 @@ #include "FrameTestHelpers.h" #include "FrameView.h" #include "ResourceError.h" +#include "WebDataSource.h" #include "WebDocument.h" #include "WebFindOptions.h" #include "WebFormElement.h" @@ -225,13 +226,12 @@ TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag) int viewportHeight = 480; FixedLayoutTestWebViewClient client; - client.m_screenInfo.horizontalDPI = 160; + client.m_screenInfo.horizontalDPI = 320; client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); WebView* webView = static_cast<WebView*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client)); webView->settings()->setViewportEnabled(true); - webView->settings()->setDefaultDeviceScaleFactor(2); webView->enableFixedLayoutMode(true); webView->resize(WebSize(viewportWidth, viewportHeight)); webView->layout(); @@ -397,6 +397,28 @@ TEST_F(WebFrameTest, ReloadDoesntSetRedirect) webkit_support::ServeAsynchronousMockedRequests(); } +TEST_F(WebFrameTest, IframeRedirect) +{ + registerMockedHttpURLLoad("iframe_redirect.html"); + registerMockedHttpURLLoad("visible_iframe.html"); + + WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "iframe_redirect.html", true); + webkit_support::RunAllPendingMessages(); // Queue the iframe. + webkit_support::ServeAsynchronousMockedRequests(); // Load the iframe. + + WebFrame* iframe = webView->findFrameByName(WebString::fromUTF8("ifr")); + ASSERT_TRUE(iframe); + WebDataSource* iframeDataSource = iframe->dataSource(); + ASSERT_TRUE(iframeDataSource); + WebVector<WebURL> redirects; + iframeDataSource->redirectChain(redirects); + ASSERT_EQ(2U, redirects.size()); + EXPECT_EQ(GURL("about:blank"), GURL(redirects[0])); + EXPECT_EQ(GURL("http://www.test.com/visible_iframe.html"), GURL(redirects[1])); + + webView->close(); +} + TEST_F(WebFrameTest, ClearFocusedNodeTest) { registerMockedHttpURLLoad("iframe_clear_focused_node_test.html"); |