Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(861)

Unified Diff: Source/web/tests/ProgrammaticScrollTest.cpp

Issue 23506013: Make the embedder responsible for creating the WebFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix lifetime on frame detach Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/tests/PrerenderingTest.cpp ('k') | Source/web/tests/RenderLayerBackingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/ProgrammaticScrollTest.cpp
diff --git a/Source/web/tests/ProgrammaticScrollTest.cpp b/Source/web/tests/ProgrammaticScrollTest.cpp
index 19052dcc693b5514154a132f5a32f2e77130ce31..db8dd3c3eef8ee419a8a991e23ccbf0e63eef6da 100644
--- a/Source/web/tests/ProgrammaticScrollTest.cpp
+++ b/Source/web/tests/ProgrammaticScrollTest.cpp
@@ -82,7 +82,8 @@ TEST_F(ProgrammaticScrollTest, UserScroll)
registerMockedHttpURLLoad("short_scroll.html");
TestProgrammaticScrollClient client;
- WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "short_scroll.html", false, 0, &client);
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "short_scroll.html", false, 0, &client);
webView->resize(WebSize(1000, 1000));
webView->layout();
@@ -91,8 +92,6 @@ TEST_F(ProgrammaticScrollTest, UserScroll)
// Non zero page scale and scroll.
toWebViewImpl(webView)->applyScrollAndScale(WebSize(9, 13), 2.0f);
EXPECT_FALSE(client.eventReceived());
-
- webView->close();
}
TEST_F(ProgrammaticScrollTest, ProgrammaticScroll)
@@ -100,7 +99,8 @@ TEST_F(ProgrammaticScrollTest, ProgrammaticScroll)
registerMockedHttpURLLoad("long_scroll.html");
TestProgrammaticScrollClient client;
- WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
webView->resize(WebSize(1000, 1000));
webView->layout();
@@ -126,8 +126,6 @@ TEST_F(ProgrammaticScrollTest, ProgrammaticScroll)
frameImpl->executeScript(WebScriptSource("window.scrollBy(0, 0);"));
EXPECT_FALSE(client.eventReceived());
client.reset();
-
- webView->close();
}
TEST_F(ProgrammaticScrollTest, UserScrollOnMainThread)
@@ -135,7 +133,8 @@ TEST_F(ProgrammaticScrollTest, UserScrollOnMainThread)
registerMockedHttpURLLoad("long_scroll.html");
TestProgrammaticScrollClient client;
- WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
webView->resize(WebSize(1000, 1000));
webView->layout();
@@ -156,8 +155,6 @@ TEST_F(ProgrammaticScrollTest, UserScrollOnMainThread)
webView->handleInputEvent(gesture);
FrameTestHelpers::runPendingTasks();
EXPECT_FALSE(client.eventReceived());
-
- webView->close();
}
TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale)
@@ -165,7 +162,8 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale)
registerMockedHttpURLLoad("long_scroll.html");
TestProgrammaticScrollClient client;
- WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
webView->resize(WebSize(1000, 1000));
webView->layout();
@@ -187,8 +185,6 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale)
EXPECT_EQ(200, webViewImpl->mainFrameImpl()->scrollOffset().height);
EXPECT_TRUE(frameView->wasScrolledByUser());
EXPECT_FALSE(client.eventReceived());
-
- webView->close();
}
TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale)
@@ -196,7 +192,8 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale)
registerMockedHttpURLLoad("long_scroll.html");
TestProgrammaticScrollClient client;
- WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.html", true, 0, &client);
webView->resize(WebSize(1000, 1000));
webView->layout();
@@ -221,8 +218,6 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale)
EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height);
EXPECT_TRUE(frameView->wasScrolledByUser());
EXPECT_FALSE(client.eventReceived());
-
- webView->close();
}
}
« no previous file with comments | « Source/web/tests/PrerenderingTest.cpp ('k') | Source/web/tests/RenderLayerBackingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698