OLD | NEW |
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" |
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 | 2123 |
2124 // Make sure a composited background-attachment:fixed background gets resized | 2124 // Make sure a composited background-attachment:fixed background gets resized |
2125 // when using inert (non-layout affecting) browser controls. | 2125 // when using inert (non-layout affecting) browser controls. |
2126 TEST_P(VisualViewportTest, ResizeCompositedAndFixedBackground) { | 2126 TEST_P(VisualViewportTest, ResizeCompositedAndFixedBackground) { |
2127 bool originalInertTopControls = | 2127 bool originalInertTopControls = |
2128 RuntimeEnabledFeatures::inertTopControlsEnabled(); | 2128 RuntimeEnabledFeatures::inertTopControlsEnabled(); |
2129 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); | 2129 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); |
2130 | 2130 |
2131 std::unique_ptr<FrameTestHelpers::TestWebViewClient> | 2131 std::unique_ptr<FrameTestHelpers::TestWebViewClient> |
2132 fakeCompositingWebViewClient = | 2132 fakeCompositingWebViewClient = |
2133 makeUnique<FrameTestHelpers::TestWebViewClient>(); | 2133 WTF::makeUnique<FrameTestHelpers::TestWebViewClient>(); |
2134 FrameTestHelpers::WebViewHelper webViewHelper; | 2134 FrameTestHelpers::WebViewHelper webViewHelper; |
2135 WebViewImpl* webViewImpl = webViewHelper.initialize( | 2135 WebViewImpl* webViewImpl = webViewHelper.initialize( |
2136 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, | 2136 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, |
2137 &configureAndroidCompositing); | 2137 &configureAndroidCompositing); |
2138 | 2138 |
2139 int pageWidth = 640; | 2139 int pageWidth = 640; |
2140 int pageHeight = 480; | 2140 int pageHeight = 480; |
2141 float browserControlsHeight = 50.0f; | 2141 float browserControlsHeight = 50.0f; |
2142 int smallestHeight = pageHeight - browserControlsHeight; | 2142 int smallestHeight = pageHeight - browserControlsHeight; |
2143 | 2143 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2314 | 2314 |
2315 // Make sure a browser control resize with background-attachment:not-fixed | 2315 // Make sure a browser control resize with background-attachment:not-fixed |
2316 // background doesn't cause invalidation or layout. | 2316 // background doesn't cause invalidation or layout. |
2317 TEST_P(VisualViewportTest, ResizeNonFixedBackgroundNoLayoutOrInvalidation) { | 2317 TEST_P(VisualViewportTest, ResizeNonFixedBackgroundNoLayoutOrInvalidation) { |
2318 bool originalInertTopControls = | 2318 bool originalInertTopControls = |
2319 RuntimeEnabledFeatures::inertTopControlsEnabled(); | 2319 RuntimeEnabledFeatures::inertTopControlsEnabled(); |
2320 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); | 2320 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); |
2321 | 2321 |
2322 std::unique_ptr<FrameTestHelpers::TestWebViewClient> | 2322 std::unique_ptr<FrameTestHelpers::TestWebViewClient> |
2323 fakeCompositingWebViewClient = | 2323 fakeCompositingWebViewClient = |
2324 makeUnique<FrameTestHelpers::TestWebViewClient>(); | 2324 WTF::makeUnique<FrameTestHelpers::TestWebViewClient>(); |
2325 FrameTestHelpers::WebViewHelper webViewHelper; | 2325 FrameTestHelpers::WebViewHelper webViewHelper; |
2326 WebViewImpl* webViewImpl = webViewHelper.initialize( | 2326 WebViewImpl* webViewImpl = webViewHelper.initialize( |
2327 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, | 2327 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, |
2328 &configureAndroidCompositing); | 2328 &configureAndroidCompositing); |
2329 | 2329 |
2330 int pageWidth = 640; | 2330 int pageWidth = 640; |
2331 int pageHeight = 480; | 2331 int pageHeight = 480; |
2332 float browserControlsHeight = 50.0f; | 2332 float browserControlsHeight = 50.0f; |
2333 int smallestHeight = pageHeight - browserControlsHeight; | 2333 int smallestHeight = pageHeight - browserControlsHeight; |
2334 | 2334 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2393 if (rootLayerScrolling) | 2393 if (rootLayerScrolling) |
2394 EXPECT_TRUE(invalidationTracking); | 2394 EXPECT_TRUE(invalidationTracking); |
2395 else | 2395 else |
2396 EXPECT_FALSE(invalidationTracking); | 2396 EXPECT_FALSE(invalidationTracking); |
2397 | 2397 |
2398 document->view()->setTracksPaintInvalidations(false); | 2398 document->view()->setTracksPaintInvalidations(false); |
2399 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); | 2399 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); |
2400 } | 2400 } |
2401 | 2401 |
2402 } // namespace | 2402 } // namespace |
OLD | NEW |