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

Side by Side Diff: third_party/WebKit/Source/web/tests/CompositorWorkerTest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 #include <memory> 6 #include <memory>
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/layout/api/LayoutViewItem.h" 8 #include "core/layout/api/LayoutViewItem.h"
9 #include "core/layout/compositing/CompositedLayerMapping.h" 9 #include "core/layout/compositing/CompositedLayerMapping.h"
10 #include "core/layout/compositing/PaintLayerCompositor.h" 10 #include "core/layout/compositing/PaintLayerCompositor.h"
11 #include "core/page/Page.h" 11 #include "core/page/Page.h"
12 #include "platform/graphics/CompositorMutableProperties.h" 12 #include "platform/graphics/CompositorMutableProperties.h"
13 #include "platform/graphics/CompositorMutation.h" 13 #include "platform/graphics/CompositorMutation.h"
14 #include "platform/graphics/GraphicsLayer.h" 14 #include "platform/graphics/GraphicsLayer.h"
15 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" 15 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
16 #include "platform/testing/URLTestHelpers.h" 16 #include "platform/testing/URLTestHelpers.h"
17 #include "platform/testing/UnitTestHelpers.h" 17 #include "platform/testing/UnitTestHelpers.h"
18 #include "public/platform/Platform.h" 18 #include "public/platform/Platform.h"
19 #include "public/platform/WebCache.h"
20 #include "public/platform/WebLayer.h" 19 #include "public/platform/WebLayer.h"
21 #include "public/platform/WebLayerTreeView.h" 20 #include "public/platform/WebLayerTreeView.h"
22 #include "public/platform/WebURLLoaderMockFactory.h" 21 #include "public/platform/WebURLLoaderMockFactory.h"
23 #include "public/web/WebSettings.h" 22 #include "public/web/WebSettings.h"
24 #include "public/web/WebViewClient.h" 23 #include "public/web/WebViewClient.h"
25 #include "testing/gtest/include/gtest/gtest.h" 24 #include "testing/gtest/include/gtest/gtest.h"
26 #include "web/WebLocalFrameImpl.h" 25 #include "web/WebLocalFrameImpl.h"
27 #include "web/WebViewImpl.h" 26 #include "web/WebViewImpl.h"
28 #include "web/tests/FrameTestHelpers.h" 27 #include "web/tests/FrameTestHelpers.h"
29 #include "wtf/PtrUtil.h" 28 #include "wtf/PtrUtil.h"
(...skipping 12 matching lines...) Expand all
42 ScopedCompositorWorkerForTest(true), 41 ScopedCompositorWorkerForTest(true),
43 m_baseURL("http://www.test.com/") {} 42 m_baseURL("http://www.test.com/") {}
44 43
45 void SetUp() override { 44 void SetUp() override {
46 m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr, 45 m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr,
47 &configureSettings); 46 &configureSettings);
48 webViewImpl()->resize(IntSize(320, 240)); 47 webViewImpl()->resize(IntSize(320, 240));
49 } 48 }
50 49
51 ~CompositorWorkerTest() override { 50 ~CompositorWorkerTest() override {
52 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 51 Platform::current()
53 WebCache::clear(); 52 ->getURLLoaderMockFactory()
53 ->unregisterAllURLsAndClearMemoryCache();
54 } 54 }
55 55
56 void navigateTo(const String& url) { 56 void navigateTo(const String& url) {
57 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url.utf8().data()); 57 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url.utf8().data());
58 } 58 }
59 59
60 void forceFullCompositingUpdate() { 60 void forceFullCompositingUpdate() {
61 webViewImpl()->updateAllLifecyclePhases(); 61 webViewImpl()->updateAllLifecyclePhases();
62 } 62 }
63 63
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 const String& opacityValue = 368 const String& opacityValue =
369 document->domWindow() 369 document->domWindow()
370 ->getComputedStyle(proxiedElement, String()) 370 ->getComputedStyle(proxiedElement, String())
371 ->getPropertyValueInternal(CSSPropertyOpacity); 371 ->getPropertyValueInternal(CSSPropertyOpacity);
372 EXPECT_EQ("0.8", opacityValue); 372 EXPECT_EQ("0.8", opacityValue);
373 } 373 }
374 } 374 }
375 375
376 } // namespace blink 376 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698