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

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

Issue 2588403002: TestingPlatformSupport: register Platform instance correctly (Closed)
Patch Set: new plan Created 4 years 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 2213c24b4bb9c9373a849374bbae5a3e31666bd7..0c5210c41d8e7a09257865bf938153f689dc9baf 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -1125,7 +1125,8 @@ TEST(ImageResourceTest,
}
TEST(ImageResourceTest, PeriodicFlushTest) {
- TestingPlatformSupportWithMockScheduler platform;
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
+ platform(new TestingPlatformSupportWithMockScheduler);
KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html");
URLTestHelpers::registerMockedURLLoad(testURL, "cancelTest.html",
"text/html");
@@ -1155,8 +1156,8 @@ TEST(ImageResourceTest, PeriodicFlushTest) {
EXPECT_TRUE(cachedImage->getContent()->hasImage());
EXPECT_EQ(1, client->imageChangedCount());
- platform.runForPeriodSeconds(1.);
- platform.advanceClockSeconds(1.);
+ platform->runForPeriodSeconds(1.);
+ platform->advanceClockSeconds(1.);
// Sanity check that we created an image after appending |meaningfulImageSize|
// bytes just once.
@@ -1180,13 +1181,13 @@ TEST(ImageResourceTest, PeriodicFlushTest) {
EXPECT_EQ(flushCount, client->imageChangedCount());
++bytesSent;
- platform.runForPeriodSeconds(0.2001);
+ platform->runForPeriodSeconds(0.2001);
}
}
// Increasing time by a large number only causes one extra flush.
- platform.runForPeriodSeconds(10.);
- platform.advanceClockSeconds(10.);
+ platform->runForPeriodSeconds(10.);
+ platform->advanceClockSeconds(10.);
EXPECT_FALSE(cachedImage->errorOccurred());
ASSERT_TRUE(cachedImage->getContent()->hasImage());
EXPECT_FALSE(cachedImage->getContent()->getImage()->isNull());

Powered by Google App Engine
This is Rietveld 408576698