| OLD | NEW |
| 1 #include "config.h" | 1 #include "config.h" |
| 2 | 2 |
| 3 #include "core/frame/FrameView.h" | 3 #include "core/frame/FrameView.h" |
| 4 #include "core/layout/LayoutView.h" | 4 #include "core/layout/LayoutView.h" |
| 5 #include "core/loader/DocumentLoader.h" | 5 #include "core/loader/DocumentLoader.h" |
| 6 #include "core/loader/FrameLoader.h" | 6 #include "core/loader/FrameLoader.h" |
| 7 #include "platform/testing/URLTestHelpers.h" | 7 #include "platform/testing/URLTestHelpers.h" |
| 8 #include "public/platform/Platform.h" | 8 #include "public/platform/Platform.h" |
| 9 #include "public/platform/WebUnitTestSupport.h" | 9 #include "public/platform/WebUnitTestSupport.h" |
| 10 #include "public/web/WebFrame.h" | 10 #include "public/web/WebFrame.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 | 40 |
| 41 void registerMockedHttpURLLoad(const std::string& fileName) | 41 void registerMockedHttpURLLoad(const std::string& fileName) |
| 42 { | 42 { |
| 43 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU
RL.c_str()), WebString::fromUTF8(fileName.c_str())); | 43 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU
RL.c_str()), WebString::fromUTF8(fileName.c_str())); |
| 44 } | 44 } |
| 45 | 45 |
| 46 std::string m_baseURL; | 46 std::string m_baseURL; |
| 47 MockWebFrameClient m_mockWebFrameClient; | 47 MockWebFrameClient m_mockWebFrameClient; |
| 48 FrameTestHelpers::UseMockScrollbarSettings m_mockScrollbarSettings; |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale) | 51 TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale) |
| 51 { | 52 { |
| 52 registerMockedHttpURLLoad("long_scroll.html"); | 53 registerMockedHttpURLLoad("long_scroll.html"); |
| 53 | 54 |
| 54 FrameTestHelpers::WebViewHelper webViewHelper; | 55 FrameTestHelpers::WebViewHelper webViewHelper; |
| 55 WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.
html", true, 0, 0); | 56 WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "long_scroll.
html", true, 0, 0); |
| 56 webView->resize(WebSize(1000, 1000)); | 57 webView->resize(WebSize(1000, 1000)); |
| 57 webView->layout(); | 58 webView->layout(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 98 |
| 98 // FrameLoader::restoreScrollPositionAndViewState flows differently if scale
is zero. | 99 // FrameLoader::restoreScrollPositionAndViewState flows differently if scale
is zero. |
| 99 loader.restoreScrollPositionAndViewState(); | 100 loader.restoreScrollPositionAndViewState(); |
| 100 | 101 |
| 101 // Expect that only the scroll position was restored. | 102 // Expect that only the scroll position was restored. |
| 102 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor()); | 103 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor()); |
| 103 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height); | 104 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height); |
| 104 } | 105 } |
| 105 | 106 |
| 106 } // namespace blink | 107 } // namespace blink |
| OLD | NEW |