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

Side by Side Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/VisualViewport.h" 5 #include "core/frame/VisualViewport.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/BrowserControls.h" 8 #include "core/frame/BrowserControls.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
11 #include "core/frame/LocalFrame.h" 11 #include "core/frame/LocalFrame.h"
12 #include "core/html/HTMLBodyElement.h" 12 #include "core/html/HTMLBodyElement.h"
13 #include "core/html/HTMLElement.h" 13 #include "core/html/HTMLElement.h"
14 #include "core/input/EventHandler.h" 14 #include "core/input/EventHandler.h"
15 #include "core/layout/LayoutObject.h" 15 #include "core/layout/LayoutObject.h"
16 #include "core/layout/api/LayoutViewItem.h" 16 #include "core/layout/api/LayoutViewItem.h"
17 #include "core/layout/compositing/PaintLayerCompositor.h" 17 #include "core/layout/compositing/PaintLayerCompositor.h"
18 #include "core/page/Page.h" 18 #include "core/page/Page.h"
19 #include "core/paint/PaintLayer.h" 19 #include "core/paint/PaintLayer.h"
20 #include "platform/geometry/DoublePoint.h" 20 #include "platform/geometry/DoublePoint.h"
21 #include "platform/geometry/DoubleRect.h" 21 #include "platform/geometry/DoubleRect.h"
22 #include "platform/graphics/CompositorElementId.h" 22 #include "platform/graphics/CompositorElementId.h"
23 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" 23 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
24 #include "platform/testing/URLTestHelpers.h" 24 #include "platform/testing/URLTestHelpers.h"
25 #include "platform/testing/UnitTestHelpers.h" 25 #include "platform/testing/UnitTestHelpers.h"
26 #include "public/platform/Platform.h" 26 #include "public/platform/Platform.h"
27 #include "public/platform/WebCache.h"
28 #include "public/platform/WebCachePolicy.h" 27 #include "public/platform/WebCachePolicy.h"
29 #include "public/platform/WebInputEvent.h" 28 #include "public/platform/WebInputEvent.h"
30 #include "public/platform/WebLayerTreeView.h" 29 #include "public/platform/WebLayerTreeView.h"
31 #include "public/platform/WebURLLoaderMockFactory.h" 30 #include "public/platform/WebURLLoaderMockFactory.h"
32 #include "public/web/WebContextMenuData.h" 31 #include "public/web/WebContextMenuData.h"
33 #include "public/web/WebDocument.h" 32 #include "public/web/WebDocument.h"
34 #include "public/web/WebFrameClient.h" 33 #include "public/web/WebFrameClient.h"
35 #include "public/web/WebScriptSource.h" 34 #include "public/web/WebScriptSource.h"
36 #include "public/web/WebSettings.h" 35 #include "public/web/WebSettings.h"
37 #include "public/web/WebViewClient.h" 36 #include "public/web/WebViewClient.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void initializeWithAndroidSettings( 123 void initializeWithAndroidSettings(
125 void (*overrideSettingsFunc)(WebSettings*) = 0) { 124 void (*overrideSettingsFunc)(WebSettings*) = 0) {
126 if (!overrideSettingsFunc) 125 if (!overrideSettingsFunc)
127 overrideSettingsFunc = &configureAndroidSettings; 126 overrideSettingsFunc = &configureAndroidSettings;
128 m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr, 127 m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr,
129 overrideSettingsFunc); 128 overrideSettingsFunc);
130 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5); 129 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5);
131 } 130 }
132 131
133 ~VisualViewportTest() override { 132 ~VisualViewportTest() override {
134 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 133 Platform::current()
135 WebCache::clear(); 134 ->getURLLoaderMockFactory()
135 ->unregisterAllURLsAndClearMemoryCache();
136 } 136 }
137 137
138 void navigateTo(const std::string& url) { 138 void navigateTo(const std::string& url) {
139 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url); 139 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url);
140 } 140 }
141 141
142 void forceFullCompositingUpdate() { 142 void forceFullCompositingUpdate() {
143 webViewImpl()->updateAllLifecyclePhases(); 143 webViewImpl()->updateAllLifecyclePhases();
144 } 144 }
145 145
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2472 " body {" 2472 " body {"
2473 " margin: 0px;" 2473 " margin: 0px;"
2474 " }" 2474 " }"
2475 " div { height:110vh; width: 110vw; }" 2475 " div { height:110vh; width: 110vw; }"
2476 "</style>" 2476 "</style>"
2477 "<div></div>", 2477 "<div></div>",
2478 baseURL); 2478 baseURL);
2479 } 2479 }
2480 2480
2481 } // namespace 2481 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698