Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Side by Side Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp

Issue 2619173003: Fix crash with viewport units when using auto resize mode. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698