| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |