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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 1710403003: Clean up WebTaskRunner::Task subclasses in web/tests/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 7242f225202833f92d52ce6c06fe41aeb562b8e0..3df78bc9a838c111f6ce978dadb7e65ca7a3506c 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -3234,23 +3234,14 @@ TEST_P(ParameterizedWebFrameTest, ReloadDoesntSetRedirect)
FrameTestHelpers::reloadFrameIgnoringCache(webViewHelper.webView()->mainFrame());
}
-class ReloadWithOverrideURLTask : public WebTaskRunner::Task {
-public:
- ReloadWithOverrideURLTask(WebFrame* frame, const KURL& url, bool ignoreCache)
- : m_frame(frame), m_url(url), m_ignoreCache(ignoreCache)
- {
- }
+namespace {
- void run() override
- {
- m_frame->reloadWithOverrideURL(m_url, m_ignoreCache);
- }
+void runReloadWithOverrideURLTask(WebFrame* frame, const KURL& url, bool ignoreCache)
+{
+ frame->reloadWithOverrideURL(url, ignoreCache);
+}
-private:
- WebFrame* const m_frame;
- const KURL m_url;
- const bool m_ignoreCache;
-};
+} // namespace
class ClearScrollStateOnCommitWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
public:
@@ -3285,7 +3276,7 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState)
// Reload the page and end up at the same url. State should be propagated.
Platform::current()->currentThread()->taskRunner()->postTask(
- BLINK_FROM_HERE, new ReloadWithOverrideURLTask(webViewHelper.webViewImpl()->mainFrame(), toKURL(m_baseURL + firstURL), false));
+ BLINK_FROM_HERE, bind(&runReloadWithOverrideURLTask, webViewHelper.webViewImpl()->mainFrame(), toKURL(m_baseURL + firstURL), false));
FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webViewImpl()->mainFrame());
EXPECT_EQ(previousOffset.width, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().width);
EXPECT_EQ(previousOffset.height, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().height);
@@ -3293,7 +3284,7 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState)
// Reload the page using the cache. State should not be propagated.
Platform::current()->currentThread()->taskRunner()->postTask(
- BLINK_FROM_HERE, new ReloadWithOverrideURLTask(webViewHelper.webViewImpl()->mainFrame(), toKURL(m_baseURL + secondURL), false));
+ BLINK_FROM_HERE, bind(&runReloadWithOverrideURLTask, webViewHelper.webViewImpl()->mainFrame(), toKURL(m_baseURL + secondURL), false));
FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webViewImpl()->mainFrame());
EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().width);
EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().height);
@@ -3301,7 +3292,7 @@ TEST_F(WebFrameTest, ReloadWithOverrideURLPreservesState)
// Reload the page while ignoring the cache. State should not be propagated.
Platform::current()->currentThread()->taskRunner()->postTask(
- BLINK_FROM_HERE, new ReloadWithOverrideURLTask(webViewHelper.webViewImpl()->mainFrame(), toKURL(m_baseURL + thirdURL), true));
+ BLINK_FROM_HERE, bind(&runReloadWithOverrideURLTask, webViewHelper.webViewImpl()->mainFrame(), toKURL(m_baseURL + thirdURL), true));
FrameTestHelpers::pumpPendingRequestsDoNotUse(webViewHelper.webViewImpl()->mainFrame());
EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().width);
EXPECT_EQ(0, webViewHelper.webViewImpl()->mainFrame()->scrollOffset().height);
« no previous file with comments | « third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698