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

Unified Diff: third_party/WebKit/Source/platform/testing/URLTestHelpers.h

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/platform/testing/URLTestHelpers.h
diff --git a/third_party/WebKit/Source/platform/testing/URLTestHelpers.h b/third_party/WebKit/Source/platform/testing/URLTestHelpers.h
index 8dccc9cd3aa0e696b807469b6bc1adb931ed6af7..6cb59d353972b5338307f2817da604118c3add9a 100644
--- a/third_party/WebKit/Source/platform/testing/URLTestHelpers.h
+++ b/third_party/WebKit/Source/platform/testing/URLTestHelpers.h
@@ -33,10 +33,10 @@
#include "platform/weborigin/KURL.h"
#include "public/platform/WebString.h"
+#include "public/platform/WebURL.h"
namespace blink {
-class WebURL;
class WebURLResponse;
namespace URLTestHelpers {
@@ -48,29 +48,29 @@ inline blink::KURL toKURL(const std::string& url) {
// Helper functions for mock URLs. These functions set up the desired URL and
// mimeType, with a 200 OK return status.
-// For the mock URL, fullURL == baseURL + fileName.
-// For the actual file path:
-// <WebKit root directory> + relativeBaseDirectory + fileName,
-// or, if the relative base directory is not specified:
-// <WebKit root directory> + fileName.
-//
-void registerMockedURLFromBaseURL(
+// webTestDataPath() or platformTestDataPath() in UnitTestHelpers can be used to
+// get the appropriate |basePath| and |filePath| for test data directories.
+// - For the mock URL, fullURL == baseURL + fileName.
+// - For the file path, filePath == basePath + ("/" +) fileName.
+
+// Registers from a base URL and a base file path, and returns a calculated full
+// URL.
+WebURL registerMockedURLLoadFromBase(
const WebString& baseURL,
+ const WebString& basePath,
const WebString& fileName,
const WebString& mimeType = WebString::fromUTF8("text/html"));
+
+// Registers from a full URL and a full file path.
void registerMockedURLLoad(
const WebURL& fullURL,
- const WebString& fileName,
+ const WebString& filePath,
const WebString& mimeType = WebString::fromUTF8("text/html"));
-void registerMockedURLLoad(const WebURL& fullURL,
- const WebString& fileName,
- const WebString& relativeBaseDirectory,
- const WebString& mimeType);
-void registerMockedURLLoadWithCustomResponse(
- const WebURL& fullURL,
- const WebString& fileName,
- const WebString& relativeBaseDirectory,
- WebURLResponse);
+void registerMockedURLLoadWithCustomResponse(const WebURL& fullURL,
+ const WebString& filePath,
+ WebURLResponse);
+
+// Registers a mock URL that returns a 404 error.
void registerMockedErrorURLLoad(const WebURL& fullURL);
} // namespace URLTestHelpers

Powered by Google App Engine
This is Rietveld 408576698