| 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 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2130 | 2130 |
| 2131 // Make sure a composited background-attachment:fixed background gets resized | 2131 // Make sure a composited background-attachment:fixed background gets resized |
| 2132 // when using inert (non-layout affecting) browser controls. | 2132 // when using inert (non-layout affecting) browser controls. |
| 2133 TEST_P(VisualViewportTest, ResizeCompositedAndFixedBackground) { | 2133 TEST_P(VisualViewportTest, ResizeCompositedAndFixedBackground) { |
| 2134 bool originalInertTopControls = | 2134 bool originalInertTopControls = |
| 2135 RuntimeEnabledFeatures::inertTopControlsEnabled(); | 2135 RuntimeEnabledFeatures::inertTopControlsEnabled(); |
| 2136 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); | 2136 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); |
| 2137 | 2137 |
| 2138 std::unique_ptr<FrameTestHelpers::TestWebViewClient> | 2138 std::unique_ptr<FrameTestHelpers::TestWebViewClient> |
| 2139 fakeCompositingWebViewClient = | 2139 fakeCompositingWebViewClient = |
| 2140 wrapUnique(new FrameTestHelpers::TestWebViewClient()); | 2140 makeUnique<FrameTestHelpers::TestWebViewClient>(); |
| 2141 FrameTestHelpers::WebViewHelper webViewHelper; | 2141 FrameTestHelpers::WebViewHelper webViewHelper; |
| 2142 WebViewImpl* webViewImpl = webViewHelper.initialize( | 2142 WebViewImpl* webViewImpl = webViewHelper.initialize( |
| 2143 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, | 2143 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, |
| 2144 &configureAndroidCompositing); | 2144 &configureAndroidCompositing); |
| 2145 | 2145 |
| 2146 int pageWidth = 640; | 2146 int pageWidth = 640; |
| 2147 int pageHeight = 480; | 2147 int pageHeight = 480; |
| 2148 float browserControlsHeight = 50.0f; | 2148 float browserControlsHeight = 50.0f; |
| 2149 int smallestHeight = pageHeight - browserControlsHeight; | 2149 int smallestHeight = pageHeight - browserControlsHeight; |
| 2150 | 2150 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2320 | 2320 |
| 2321 // Make sure a browser control resize with background-attachment:not-fixed | 2321 // Make sure a browser control resize with background-attachment:not-fixed |
| 2322 // background doesn't cause invalidation or layout. | 2322 // background doesn't cause invalidation or layout. |
| 2323 TEST_P(VisualViewportTest, ResizeNonFixedBackgroundNoLayoutOrInvalidation) { | 2323 TEST_P(VisualViewportTest, ResizeNonFixedBackgroundNoLayoutOrInvalidation) { |
| 2324 bool originalInertTopControls = | 2324 bool originalInertTopControls = |
| 2325 RuntimeEnabledFeatures::inertTopControlsEnabled(); | 2325 RuntimeEnabledFeatures::inertTopControlsEnabled(); |
| 2326 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); | 2326 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); |
| 2327 | 2327 |
| 2328 std::unique_ptr<FrameTestHelpers::TestWebViewClient> | 2328 std::unique_ptr<FrameTestHelpers::TestWebViewClient> |
| 2329 fakeCompositingWebViewClient = | 2329 fakeCompositingWebViewClient = |
| 2330 wrapUnique(new FrameTestHelpers::TestWebViewClient()); | 2330 makeUnique<FrameTestHelpers::TestWebViewClient>(); |
| 2331 FrameTestHelpers::WebViewHelper webViewHelper; | 2331 FrameTestHelpers::WebViewHelper webViewHelper; |
| 2332 WebViewImpl* webViewImpl = webViewHelper.initialize( | 2332 WebViewImpl* webViewImpl = webViewHelper.initialize( |
| 2333 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, | 2333 true, nullptr, fakeCompositingWebViewClient.get(), nullptr, |
| 2334 &configureAndroidCompositing); | 2334 &configureAndroidCompositing); |
| 2335 | 2335 |
| 2336 int pageWidth = 640; | 2336 int pageWidth = 640; |
| 2337 int pageHeight = 480; | 2337 int pageHeight = 480; |
| 2338 float browserControlsHeight = 50.0f; | 2338 float browserControlsHeight = 50.0f; |
| 2339 int smallestHeight = pageHeight - browserControlsHeight; | 2339 int smallestHeight = pageHeight - browserControlsHeight; |
| 2340 | 2340 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2397 if (rootLayerScrolling) | 2397 if (rootLayerScrolling) |
| 2398 EXPECT_TRUE(invalidationTracking); | 2398 EXPECT_TRUE(invalidationTracking); |
| 2399 else | 2399 else |
| 2400 EXPECT_FALSE(invalidationTracking); | 2400 EXPECT_FALSE(invalidationTracking); |
| 2401 | 2401 |
| 2402 document->view()->setTracksPaintInvalidations(false); | 2402 document->view()->setTracksPaintInvalidations(false); |
| 2403 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); | 2403 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); |
| 2404 } | 2404 } |
| 2405 | 2405 |
| 2406 } // namespace | 2406 } // namespace |
| OLD | NEW |