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

Side by Side Diff: Source/web/tests/ProgrammaticScrollTest.cpp

Issue 1174283002: Fix unit test style in Source/web/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove static Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/PageSerializerTest.cpp ('k') | Source/web/tests/ScrollAnimatorNoneTest.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 "core/frame/FrameView.h" 3 #include "core/frame/FrameView.h"
4 #include "core/layout/LayoutView.h" 4 #include "core/layout/LayoutView.h"
5 #include "platform/testing/URLTestHelpers.h" 5 #include "platform/testing/URLTestHelpers.h"
6 #include "public/platform/Platform.h" 6 #include "public/platform/Platform.h"
7 #include "public/platform/WebUnitTestSupport.h" 7 #include "public/platform/WebUnitTestSupport.h"
8 #include "public/web/WebFrame.h" 8 #include "public/web/WebFrame.h"
9 #include "public/web/WebFrameClient.h" 9 #include "public/web/WebFrameClient.h"
10 #include "public/web/WebHistoryItem.h" 10 #include "public/web/WebHistoryItem.h"
11 #include "public/web/WebInputEvent.h" 11 #include "public/web/WebInputEvent.h"
12 #include "public/web/WebScriptSource.h" 12 #include "public/web/WebScriptSource.h"
13 #include "public/web/WebSettings.h" 13 #include "public/web/WebSettings.h"
14 #include "public/web/WebView.h" 14 #include "public/web/WebView.h"
15 #include "web/WebLocalFrameImpl.h" 15 #include "web/WebLocalFrameImpl.h"
16 #include "web/WebViewImpl.h" 16 #include "web/WebViewImpl.h"
17 #include "web/tests/FrameTestHelpers.h" 17 #include "web/tests/FrameTestHelpers.h"
18 #include <gtest/gtest.h> 18 #include <gtest/gtest.h>
19 19
20 using namespace blink; 20 namespace blink {
21
22 namespace {
23 21
24 class MockWebFrameClient : public WebFrameClient { 22 class MockWebFrameClient : public WebFrameClient {
25 }; 23 };
26 24
27 class ProgrammaticScrollTest : public testing::Test { 25 class ProgrammaticScrollTest : public testing::Test {
28 public: 26 public:
29 ProgrammaticScrollTest() 27 ProgrammaticScrollTest()
30 : m_baseURL("http://www.test.com/") 28 : m_baseURL("http://www.test.com/")
31 { 29 {
32 } 30 }
33 31
34 virtual void TearDown() 32 void TearDown() override
35 { 33 {
36 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); 34 Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
37 } 35 }
38 36
39 protected: 37 protected:
40 38
41 void registerMockedHttpURLLoad(const std::string& fileName) 39 void registerMockedHttpURLLoad(const std::string& fileName)
42 { 40 {
43 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str())); 41 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseU RL.c_str()), WebString::fromUTF8(fileName.c_str()));
44 } 42 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 frame->loader().currentItem()->setScrollPoint(WebPoint(0, 400)); 94 frame->loader().currentItem()->setScrollPoint(WebPoint(0, 400));
97 95
98 // FrameLoader::restoreScrollPositionAndViewState flows differently if scale is zero. 96 // FrameLoader::restoreScrollPositionAndViewState flows differently if scale is zero.
99 frame->loader().restoreScrollPositionAndViewState(); 97 frame->loader().restoreScrollPositionAndViewState();
100 98
101 // Expect that only the scroll position was restored. 99 // Expect that only the scroll position was restored.
102 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor()); 100 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor());
103 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height); 101 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height);
104 } 102 }
105 103
106 } 104 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/tests/PageSerializerTest.cpp ('k') | Source/web/tests/ScrollAnimatorNoneTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698