Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: third_party/WebKit/Source/web/tests/WebSearchableFormDataTest.cpp

Issue 2654933003: platform/testing/{URL|Unit}TestHelpers improvements (Closed)
Patch Set: header changes Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c9d1ef532e3963d51a0d76a7ac1a37bd93e1f98f 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),
+ testing::webTestDataPath(),
+ WebString::fromUTF8(fileName));
+}
+
+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");
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698