| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |