Chromium Code Reviews| 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..1d4ac0e1a4927353ad3207aefc3ae56053275f27 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,11 +150,18 @@ class VisualViewportTest |
| } |
| void registerMockedHttpURLLoad(const std::string& fileName) { |
| - URLTestHelpers::registerMockedURLFromBaseURL( |
| + URLTestHelpers::registerMockedURLLoadFromBase( |
| WebString::fromUTF8(m_baseURL.c_str()), |
|
Takashi Toyoshima
2017/01/26 10:57:58
removing c_str
|
| + blink::testing::webTestDataPath(), |
| WebString::fromUTF8(fileName.c_str())); |
| } |
| + void registerMockedHttpURLLoad(const std::string& url, |
| + const std::string& fileName) { |
| + URLTestHelpers::registerMockedURLLoad( |
| + toKURL(url), blink::testing::webTestDataPath(fileName)); |
| + } |
| + |
| WebLayer* getRootScrollLayer() { |
| PaintLayerCompositor* compositor = |
| frame()->contentLayoutItem().compositor(); |
| @@ -2147,8 +2155,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 +2237,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 +2344,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(), |