| Index: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| index 8dff34918e0290990363a0997a55cd6d60c9d125..fe6a938782cd6ca1f86190c25fa67313aa743eff 100644
|
| --- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| @@ -2404,4 +2404,24 @@ TEST_P(VisualViewportTest, ResizeNonFixedBackgroundNoLayoutOrInvalidation) {
|
| RuntimeEnabledFeatures::setInertTopControlsEnabled(originalInertTopControls);
|
| }
|
|
|
| +// Make sure we don't crash when the visual viewport's height is 0. This can
|
| +// happen transiently in autoresize mode and cause a crash. This test passes if
|
| +// it doesn't crash.
|
| +TEST_P(VisualViewportTest, AutoResizeNoHeightUsesMinimumHeight) {
|
| + initializeWithDesktopSettings();
|
| + webViewImpl()->resizeWithBrowserControls(WebSize(0, 0), 0, false);
|
| + webViewImpl()->enableAutoResizeMode(WebSize(25, 25), WebSize(100, 100));
|
| + WebURL baseURL = URLTestHelpers::toKURL("http://example.com/");
|
| + FrameTestHelpers::loadHTMLString(webViewImpl()->mainFrame(),
|
| + "<!DOCTYPE html>"
|
| + "<style>"
|
| + " body {"
|
| + " margin: 0px;"
|
| + " }"
|
| + " div { height:110vh; width: 110vw; }"
|
| + "</style>"
|
| + "<div></div>",
|
| + baseURL);
|
| +}
|
| +
|
| } // namespace
|
|
|