| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 registerMockedHttpURLLoad("vh-height-width-800-extra-wide.html"); | 65 registerMockedHttpURLLoad("vh-height-width-800-extra-wide.html"); |
| 66 } | 66 } |
| 67 | 67 |
| 68 ~TopControlsTest() override | 68 ~TopControlsTest() override |
| 69 { | 69 { |
| 70 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 70 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 WebViewImpl* initialize(const std::string& pageName = "large-div.html") | 73 WebViewImpl* initialize(const std::string& pageName = "large-div.html") |
| 74 { | 74 { |
| 75 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); |
| 76 |
| 75 // Load a page with large body and set viewport size to 400x400 to ensur
e | 77 // Load a page with large body and set viewport size to 400x400 to ensur
e |
| 76 // main frame is scrollable. | 78 // main frame is scrollable. |
| 77 m_helper.initializeAndLoad(m_baseURL + pageName, true, 0, 0, &configureS
ettings); | 79 m_helper.initializeAndLoad(m_baseURL + pageName, true, 0, 0, &configureS
ettings); |
| 78 | 80 |
| 79 webViewImpl()->resize(IntSize(400, 400)); | 81 webViewImpl()->resize(IntSize(400, 400)); |
| 80 return webViewImpl(); | 82 return webViewImpl(); |
| 81 } | 83 } |
| 82 | 84 |
| 83 static void configureSettings(WebSettings* settings) | 85 static void configureSettings(WebSettings* settings) |
| 84 { | 86 { |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 // that's 1600px wide so the minimum scale is 0.25 to encompass that. | 725 // that's 1600px wide so the minimum scale is 0.25 to encompass that. |
| 724 ASSERT_EQ(0.25f, webView->minimumPageScaleFactor()); | 726 ASSERT_EQ(0.25f, webView->minimumPageScaleFactor()); |
| 725 | 727 |
| 726 // The viewport will match the layout width at scale=0.5 so the height used | 728 // The viewport will match the layout width at scale=0.5 so the height used |
| 727 // for vh should be (300 / 0.5) for the layout height + (100 / 0.5) for top | 729 // for vh should be (300 / 0.5) for the layout height + (100 / 0.5) for top |
| 728 // controls = 800. | 730 // controls = 800. |
| 729 EXPECT_EQ(800, frame()->view()->viewportSizeForViewportUnits().height()); | 731 EXPECT_EQ(800, frame()->view()->viewportSizeForViewportUnits().height()); |
| 730 } | 732 } |
| 731 | 733 |
| 732 } // namespace blink | 734 } // namespace blink |
| OLD | NEW |