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

Side by Side Diff: Source/WebKit/chromium/tests/ProgrammaticScrollTest.cpp

Issue 18358004: Call didProgrammaticallyScroll only when ProgrammaticScrollNotifications is enabled, which is an ex… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test. Created 7 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/page/FrameView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "config.h" 1 #include "config.h"
2 2
3 #include <gtest/gtest.h> 3 #include <gtest/gtest.h>
4 #include "FrameTestHelpers.h" 4 #include "FrameTestHelpers.h"
5 #include "RuntimeEnabledFeatures.h"
5 #include "URLTestHelpers.h" 6 #include "URLTestHelpers.h"
6 #include "WebFrame.h" 7 #include "WebFrame.h"
7 #include "WebFrameClient.h" 8 #include "WebFrameClient.h"
8 #include "WebFrameImpl.h" 9 #include "WebFrameImpl.h"
9 #include "WebHistoryItem.h" 10 #include "WebHistoryItem.h"
10 #include "WebInputEvent.h" 11 #include "WebInputEvent.h"
11 #include "WebScriptSource.h" 12 #include "WebScriptSource.h"
12 #include "WebSettings.h" 13 #include "WebSettings.h"
13 #include "WebView.h" 14 #include "WebView.h"
14 #include "WebViewClient.h" 15 #include "WebViewClient.h"
(...skipping 11 matching lines...) Expand all
26 class MockWebFrameClient : public WebFrameClient { 27 class MockWebFrameClient : public WebFrameClient {
27 }; 28 };
28 29
29 class ProgrammaticScrollTest : public testing::Test { 30 class ProgrammaticScrollTest : public testing::Test {
30 public: 31 public:
31 ProgrammaticScrollTest() 32 ProgrammaticScrollTest()
32 : m_baseURL("http://www.test.com/") 33 : m_baseURL("http://www.test.com/")
33 { 34 {
34 } 35 }
35 36
37 virtual void SetUp()
38 {
39 RuntimeEnabledFeatures::setProgrammaticScrollNotificationsEnabled(true);
40 }
41
36 virtual void TearDown() 42 virtual void TearDown()
37 { 43 {
38 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); 44 Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
39 } 45 }
40 46
41 protected: 47 protected:
42 48
43 void registerMockedHttpURLLoad(const std::string& fileName) 49 void registerMockedHttpURLLoad(const std::string& fileName)
44 { 50 {
45 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str())); 51 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str()));
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // Expect that only the scroll position was restored, and that it was not a programmatic scroll. 221 // Expect that only the scroll position was restored, and that it was not a programmatic scroll.
216 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor()); 222 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor());
217 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height); 223 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height);
218 EXPECT_TRUE(frameView->wasScrolledByUser()); 224 EXPECT_TRUE(frameView->wasScrolledByUser());
219 EXPECT_FALSE(client.eventReceived()); 225 EXPECT_FALSE(client.eventReceived());
220 226
221 webView->close(); 227 webView->close();
222 } 228 }
223 229
224 } 230 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/page/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698