| 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 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2397 bool rootLayerScrolling = GetParam(); | 2397 bool rootLayerScrolling = GetParam(); |
| 2398 if (rootLayerScrolling) | 2398 if (rootLayerScrolling) |
| 2399 EXPECT_TRUE(invalidationTracking); | 2399 EXPECT_TRUE(invalidationTracking); |
| 2400 else | 2400 else |
| 2401 EXPECT_FALSE(invalidationTracking); | 2401 EXPECT_FALSE(invalidationTracking); |
| 2402 | 2402 |
| 2403 document->view()->setTracksPaintInvalidations(false); | 2403 document->view()->setTracksPaintInvalidations(false); |
| 2404 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); | 2404 RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls); |
| 2405 } | 2405 } |
| 2406 | 2406 |
| 2407 // Make sure we don't crash when the visual viewport's height is 0. This can |
| 2408 // happen transiently in autoresize mode and cause a crash. This test passes if |
| 2409 // it doesn't crash. |
| 2410 TEST_P(VisualViewportTest, AutoResizeNoHeightUsesMinimumHeight) { |
| 2411 initializeWithDesktopSettings(); |
| 2412 webViewImpl()->resizeWithBrowserControls(WebSize(0, 0), 0, false); |
| 2413 webViewImpl()->enableAutoResizeMode(WebSize(25, 25), WebSize(100, 100)); |
| 2414 WebURL baseURL = URLTestHelpers::toKURL("http://example.com/"); |
| 2415 FrameTestHelpers::loadHTMLString(webViewImpl()->mainFrame(), |
| 2416 "<!DOCTYPE html>" |
| 2417 "<style>" |
| 2418 " body {" |
| 2419 " margin: 0px;" |
| 2420 " }" |
| 2421 " div { height:110vh; width: 110vw; }" |
| 2422 "</style>" |
| 2423 "<div></div>", |
| 2424 baseURL); |
| 2425 } |
| 2426 |
| 2407 } // namespace | 2427 } // namespace |
| OLD | NEW |