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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 | 810 |
811 ASSERT_EQ(80.f, webView->topControls().contentOffset()); | 811 ASSERT_EQ(80.f, webView->topControls().contentOffset()); |
812 EXPECT_EQ(expectedRootOffset, rootViewport->scrollPosition().y()); | 812 EXPECT_EQ(expectedRootOffset, rootViewport->scrollPosition().y()); |
813 | 813 |
814 webView->handleInputEvent( | 814 webView->handleInputEvent( |
815 generateEvent(WebInputEvent::GestureScrollEnd)); | 815 generateEvent(WebInputEvent::GestureScrollEnd)); |
816 } | 816 } |
817 } | 817 } |
818 | 818 |
819 } // namespace blink | 819 } // namespace blink |
OLD | NEW |