Chromium Code Reviews| Index: third_party/WebKit/Source/web/tests/WebSearchableFormDataTest.cpp |
| diff --git a/third_party/WebKit/Source/web/tests/WebSearchableFormDataTest.cpp b/third_party/WebKit/Source/web/tests/WebSearchableFormDataTest.cpp |
| index 0fb06453946827901ad974b77fdc9079277e6cfa..f4caeb45d10ebccd97a2c71968737109fef7778a 100644 |
| --- a/third_party/WebKit/Source/web/tests/WebSearchableFormDataTest.cpp |
| +++ b/third_party/WebKit/Source/web/tests/WebSearchableFormDataTest.cpp |
| @@ -31,6 +31,7 @@ |
| #include "public/web/WebSearchableFormData.h" |
| #include "platform/testing/URLTestHelpers.h" |
| +#include "platform/testing/UnitTestHelpers.h" |
| #include "public/platform/Platform.h" |
| #include "public/platform/WebURLLoaderMockFactory.h" |
| #include "public/web/WebCache.h" |
| @@ -42,7 +43,16 @@ |
| namespace blink { |
| -class WebSearchableFormDataTest : public testing::Test { |
| +namespace { |
| + |
| +void registerMockedURLLoadFromBaseURL(const std::string& baseURL, |
| + const std::string& fileName) { |
| + URLTestHelpers::registerMockedURLLoadFromBase( |
| + WebString::fromUTF8(baseURL.c_str()), testing::webTestDataPath(), |
|
Takashi Toyoshima
2017/01/26 10:57:58
removing c_str
|
| + WebString::fromUTF8(fileName.c_str())); |
| +} |
| + |
| +class WebSearchableFormDataTest : public ::testing::Test { |
| protected: |
| WebSearchableFormDataTest() {} |
| @@ -54,10 +64,10 @@ class WebSearchableFormDataTest : public testing::Test { |
| FrameTestHelpers::WebViewHelper m_webViewHelper; |
| }; |
| +} // namespace |
| TEST_F(WebSearchableFormDataTest, HttpSearchString) { |
| std::string baseURL("http://www.test.com/"); |
| - URLTestHelpers::registerMockedURLFromBaseURL( |
| - WebString::fromUTF8(baseURL.c_str()), "search_form_http.html"); |
| + registerMockedURLLoadFromBaseURL(baseURL, "search_form_http.html"); |
| WebView* webView = |
| m_webViewHelper.initializeAndLoad(baseURL + "search_form_http.html"); |
| @@ -73,8 +83,7 @@ TEST_F(WebSearchableFormDataTest, HttpSearchString) { |
| TEST_F(WebSearchableFormDataTest, HttpsSearchString) { |
| std::string baseURL("https://www.test.com/"); |
| - URLTestHelpers::registerMockedURLFromBaseURL( |
| - WebString::fromUTF8(baseURL.c_str()), "search_form_https.html"); |
| + registerMockedURLLoadFromBaseURL(baseURL, "search_form_https.html"); |
| WebView* webView = |
| m_webViewHelper.initializeAndLoad(baseURL + "search_form_https.html"); |