| 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 74884f37fc6a0d69fd905dc5edd84b482f88c574..278679204656fdf8893fe185a3f2b783bd86f888 100644
|
| --- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
|
| @@ -22,6 +22,7 @@
|
| #include "platform/graphics/CompositorElementId.h"
|
| #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
|
| #include "platform/testing/URLTestHelpers.h"
|
| +#include "platform/testing/UnitTestHelpers.h"
|
| #include "public/platform/Platform.h"
|
| #include "public/platform/WebCachePolicy.h"
|
| #include "public/platform/WebInputEvent.h"
|
| @@ -109,8 +110,8 @@ namespace {
|
|
|
| typedef bool TestParamRootLayerScrolling;
|
| class VisualViewportTest
|
| - : public testing::Test,
|
| - public testing::WithParamInterface<TestParamRootLayerScrolling>,
|
| + : public ::testing::Test,
|
| + public ::testing::WithParamInterface<TestParamRootLayerScrolling>,
|
| private ScopedRootLayerScrollingForTest {
|
| public:
|
| VisualViewportTest()
|
| @@ -149,9 +150,15 @@ class VisualViewportTest
|
| }
|
|
|
| void registerMockedHttpURLLoad(const std::string& fileName) {
|
| - URLTestHelpers::registerMockedURLFromBaseURL(
|
| - WebString::fromUTF8(m_baseURL.c_str()),
|
| - WebString::fromUTF8(fileName.c_str()));
|
| + URLTestHelpers::registerMockedURLLoadFromBase(
|
| + WebString::fromUTF8(m_baseURL), blink::testing::webTestDataPath(),
|
| + WebString::fromUTF8(fileName));
|
| + }
|
| +
|
| + void registerMockedHttpURLLoad(const std::string& url,
|
| + const std::string& fileName) {
|
| + URLTestHelpers::registerMockedURLLoad(
|
| + toKURL(url), blink::testing::webTestDataPath(fileName));
|
| }
|
|
|
| WebLayer* getRootScrollLayer() {
|
| @@ -2147,8 +2154,7 @@ TEST_P(VisualViewportTest, ResizeCompositedAndFixedBackground) {
|
| webViewImpl->resizeWithBrowserControls(WebSize(pageWidth, pageHeight),
|
| browserControlsHeight, false);
|
|
|
| - URLTestHelpers::registerMockedURLLoad(toKURL("http://example.com/foo.png"),
|
| - "white-1x1.png");
|
| + registerMockedHttpURLLoad("http://example.com/foo.png", "white-1x1.png");
|
| WebURL baseURL = URLTestHelpers::toKURL("http://example.com/");
|
| FrameTestHelpers::loadHTMLString(webViewImpl->mainFrame(),
|
| "<!DOCTYPE html>"
|
| @@ -2230,8 +2236,7 @@ TEST_P(VisualViewportTest, ResizeNonCompositedAndFixedBackground) {
|
| webViewImpl->resizeWithBrowserControls(WebSize(pageWidth, pageHeight),
|
| browserControlsHeight, false);
|
|
|
| - URLTestHelpers::registerMockedURLLoad(toKURL("http://example.com/foo.png"),
|
| - "white-1x1.png");
|
| + registerMockedHttpURLLoad("http://example.com/foo.png", "white-1x1.png");
|
| WebURL baseURL = URLTestHelpers::toKURL("http://example.com/");
|
| FrameTestHelpers::loadHTMLString(webViewImpl->mainFrame(),
|
| "<!DOCTYPE html>"
|
| @@ -2338,8 +2343,7 @@ TEST_P(VisualViewportTest, ResizeNonFixedBackgroundNoLayoutOrInvalidation) {
|
| webViewImpl->resizeWithBrowserControls(WebSize(pageWidth, pageHeight),
|
| browserControlsHeight, false);
|
|
|
| - URLTestHelpers::registerMockedURLLoad(toKURL("http://example.com/foo.png"),
|
| - "white-1x1.png");
|
| + registerMockedHttpURLLoad("http://example.com/foo.png", "white-1x1.png");
|
| WebURL baseURL = URLTestHelpers::toKURL("http://example.com/");
|
| // This time the background is the default attachment.
|
| FrameTestHelpers::loadHTMLString(webViewImpl->mainFrame(),
|
|
|