| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 71 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
| 72 WebCache::clear(); | 72 WebCache::clear(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 WebViewImpl* initialize(const std::string& pageName = "large-div.html") | 75 WebViewImpl* initialize(const std::string& pageName = "large-div.html") |
| 76 { | 76 { |
| 77 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); | 77 RuntimeEnabledFeatures::setInertTopControlsEnabled(true); |
| 78 | 78 |
| 79 // Load a page with large body and set viewport size to 400x400 to ensur
e | 79 // Load a page with large body and set viewport size to 400x400 to ensur
e |
| 80 // main frame is scrollable. | 80 // main frame is scrollable. |
| 81 m_helper.initializeAndLoad(m_baseURL + pageName, true, 0, 0, &configureS
ettings); | 81 m_helper.initializeAndLoad(m_baseURL + pageName, true, nullptr, nullptr,
nullptr, &configureSettings); |
| 82 | 82 |
| 83 webViewImpl()->resize(IntSize(400, 400)); | 83 webViewImpl()->resize(IntSize(400, 400)); |
| 84 return webViewImpl(); | 84 return webViewImpl(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 static void configureSettings(WebSettings* settings) | 87 static void configureSettings(WebSettings* settings) |
| 88 { | 88 { |
| 89 settings->setJavaScriptEnabled(true); | 89 settings->setJavaScriptEnabled(true); |
| 90 settings->setAcceleratedCompositingEnabled(true); | 90 settings->setAcceleratedCompositingEnabled(true); |
| 91 settings->setPreferCompositingToLCDTextEnabled(true); | 91 settings->setPreferCompositingToLCDTextEnabled(true); |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 // that's 1600px wide so the minimum scale is 0.25 to encompass that. | 727 // that's 1600px wide so the minimum scale is 0.25 to encompass that. |
| 728 ASSERT_EQ(0.25f, webView->minimumPageScaleFactor()); | 728 ASSERT_EQ(0.25f, webView->minimumPageScaleFactor()); |
| 729 | 729 |
| 730 // The viewport will match the layout width at scale=0.5 so the height used | 730 // The viewport will match the layout width at scale=0.5 so the height used |
| 731 // for vh should be (300 / 0.5) for the layout height + (100 / 0.5) for top | 731 // for vh should be (300 / 0.5) for the layout height + (100 / 0.5) for top |
| 732 // controls = 800. | 732 // controls = 800. |
| 733 EXPECT_EQ(800, frame()->view()->viewportSizeForViewportUnits().height()); | 733 EXPECT_EQ(800, frame()->view()->viewportSizeForViewportUnits().height()); |
| 734 } | 734 } |
| 735 | 735 |
| 736 } // namespace blink | 736 } // namespace blink |
| OLD | NEW |