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

Unified Diff: third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp

Issue 2654933003: platform/testing/{URL|Unit}TestHelpers improvements (Closed)
Patch Set: baseURL bug Created 3 years, 11 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/core/loader/resource/ImageResourceTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
index 276b3bce06467e27985b88803db4b89c949a6b24..7c3e7dbd412112bcdf5ff11d458ec1053e1abb21 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -202,13 +202,15 @@ class ImageResourceTestMockFetchContext : public FetchContext {
// ASSERT_TRUE() without needing to worry about unregistering the mocked URL
// load to avoid putting other tests into inconsistent states in case the
// assertion fails.
+// TODO(toyoshim): Generalize and move to platform/testing/URLTestHelpers.
class ScopedRegisteredURL {
public:
ScopedRegisteredURL(const KURL& url,
const String& fileName = "cancelTest.html",
const String& mimeType = "text/html")
: m_url(url) {
- URLTestHelpers::registerMockedURLLoad(m_url, fileName, mimeType);
+ URLTestHelpers::registerMockedURLLoad(
+ m_url, testing::webTestDataPath(fileName.utf8().data()), mimeType);
}
~ScopedRegisteredURL() {
@@ -1191,8 +1193,7 @@ TEST(ImageResourceTest, PeriodicFlushTest) {
ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
platform;
KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html");
- URLTestHelpers::registerMockedURLLoad(testURL, "cancelTest.html",
- "text/html");
+ ScopedRegisteredURL scopedRegisteredURL(testURL);
ResourceRequest request = ResourceRequest(testURL);
ImageResource* imageResource = ImageResource::create(request);
imageResource->setStatus(ResourceStatus::Pending);

Powered by Google App Engine
This is Rietveld 408576698