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

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

Issue 2683033005: URLLoaderMockFactory: clear MemoryCache in unregisterAllURLs (Closed)
Patch Set: fix Created 3 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 unified diff | Download patch
OLDNEW
1 #include "core/frame/FrameView.h" 1 #include "core/frame/FrameView.h"
2 #include "core/loader/DocumentLoader.h" 2 #include "core/loader/DocumentLoader.h"
3 #include "core/loader/FrameLoader.h" 3 #include "core/loader/FrameLoader.h"
4 #include "platform/testing/URLTestHelpers.h" 4 #include "platform/testing/URLTestHelpers.h"
5 #include "platform/testing/UnitTestHelpers.h" 5 #include "platform/testing/UnitTestHelpers.h"
6 #include "public/platform/Platform.h" 6 #include "public/platform/Platform.h"
7 #include "public/platform/WebCache.h"
8 #include "public/platform/WebInputEvent.h" 7 #include "public/platform/WebInputEvent.h"
9 #include "public/platform/WebURLLoaderMockFactory.h" 8 #include "public/platform/WebURLLoaderMockFactory.h"
10 #include "public/web/WebFrame.h" 9 #include "public/web/WebFrame.h"
11 #include "public/web/WebFrameClient.h" 10 #include "public/web/WebFrameClient.h"
12 #include "public/web/WebHistoryItem.h" 11 #include "public/web/WebHistoryItem.h"
13 #include "public/web/WebScriptSource.h" 12 #include "public/web/WebScriptSource.h"
14 #include "public/web/WebSettings.h" 13 #include "public/web/WebSettings.h"
15 #include "public/web/WebView.h" 14 #include "public/web/WebView.h"
16 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
17 #include "web/WebLocalFrameImpl.h" 16 #include "web/WebLocalFrameImpl.h"
18 #include "web/WebViewImpl.h" 17 #include "web/WebViewImpl.h"
19 #include "web/tests/FrameTestHelpers.h" 18 #include "web/tests/FrameTestHelpers.h"
20 19
21 namespace blink { 20 namespace blink {
22 21
23 class ProgrammaticScrollTest : public ::testing::Test { 22 class ProgrammaticScrollTest : public ::testing::Test {
24 public: 23 public:
25 ProgrammaticScrollTest() : m_baseURL("http://www.test.com/") {} 24 ProgrammaticScrollTest() : m_baseURL("http://www.test.com/") {}
26 25
27 void TearDown() override { 26 void TearDown() override {
28 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 27 Platform::current()
29 WebCache::clear(); 28 ->getURLLoaderMockFactory()
29 ->unregisterAllURLsAndClearMemoryCache();
30 } 30 }
31 31
32 protected: 32 protected:
33 void registerMockedHttpURLLoad(const std::string& fileName) { 33 void registerMockedHttpURLLoad(const std::string& fileName) {
34 URLTestHelpers::registerMockedURLLoadFromBase( 34 URLTestHelpers::registerMockedURLLoadFromBase(
35 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(), 35 WebString::fromUTF8(m_baseURL), testing::webTestDataPath(),
36 WebString::fromUTF8(fileName)); 36 WebString::fromUTF8(fileName));
37 } 37 }
38 38
39 std::string m_baseURL; 39 std::string m_baseURL;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // FrameLoader::restoreScrollPositionAndViewState flows differently if scale 92 // FrameLoader::restoreScrollPositionAndViewState flows differently if scale
93 // is zero. 93 // is zero.
94 loader.restoreScrollPositionAndViewState(); 94 loader.restoreScrollPositionAndViewState();
95 95
96 // Expect that only the scroll position was restored. 96 // Expect that only the scroll position was restored.
97 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor()); 97 EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor());
98 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->getScrollOffset().height); 98 EXPECT_EQ(400, webViewImpl->mainFrameImpl()->getScrollOffset().height);
99 } 99 }
100 100
101 } // namespace blink 101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/PrerenderingTest.cpp ('k') | third_party/WebKit/Source/web/tests/RootScrollerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698