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 "web/WebViewImpl.h" | 5 #include "web/WebViewImpl.h" |
6 | 6 |
7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
8 #include "platform/graphics/compositing/PaintArtifactCompositor.h" | 8 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
9 #include "public/platform/WebLayerTreeView.h" | 9 #include "public/platform/WebLayerTreeView.h" |
10 #include "public/web/WebViewClient.h" | 10 #include "public/web/WebViewClient.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 private: | 62 private: |
63 RuntimeEnabledFeatures::Backup m_featuresBackup; | 63 RuntimeEnabledFeatures::Backup m_featuresBackup; |
64 MockWebLayerTreeView m_webLayerTreeView; | 64 MockWebLayerTreeView m_webLayerTreeView; |
65 TestWebViewClientWithLayerTreeView m_webViewClient; | 65 TestWebViewClientWithLayerTreeView m_webViewClient; |
66 FrameTestHelpers::WebViewHelper m_helper; | 66 FrameTestHelpers::WebViewHelper m_helper; |
67 }; | 67 }; |
68 | 68 |
69 TEST_F(WebViewImplPaintArtifactCompositorTest, AttachAndDetach) | 69 TEST_F(WebViewImplPaintArtifactCompositorTest, AttachAndDetach) |
70 { | 70 { |
71 paintArtifactCompositor().initializeIfNeeded(); | |
72 cc::Layer* rootLayer = paintArtifactCompositor().rootLayer(); | 71 cc::Layer* rootLayer = paintArtifactCompositor().rootLayer(); |
73 ASSERT_TRUE(rootLayer); | 72 ASSERT_TRUE(rootLayer); |
74 | 73 |
75 EXPECT_CALL(webLayerTreeView(), setRootLayer(Property(&WebLayer::ccLayer, ro
otLayer))); | 74 EXPECT_CALL(webLayerTreeView(), setRootLayer(Property(&WebLayer::ccLayer, ro
otLayer))); |
76 webViewImpl().attachPaintArtifactCompositor(); | 75 webViewImpl().attachPaintArtifactCompositor(); |
77 testing::Mock::VerifyAndClearExpectations(&webLayerTreeView()); | 76 testing::Mock::VerifyAndClearExpectations(&webLayerTreeView()); |
78 | 77 |
79 EXPECT_CALL(webLayerTreeView(), clearRootLayer()); | 78 EXPECT_CALL(webLayerTreeView(), clearRootLayer()); |
80 webViewImpl().detachPaintArtifactCompositor(); | 79 webViewImpl().detachPaintArtifactCompositor(); |
81 testing::Mock::VerifyAndClearExpectations(&webLayerTreeView()); | 80 testing::Mock::VerifyAndClearExpectations(&webLayerTreeView()); |
82 } | 81 } |
83 | 82 |
84 } // namespace | 83 } // namespace |
85 } // namespace blink | 84 } // namespace blink |
OLD | NEW |