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

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

Issue 2588403002: TestingPlatformSupport: register Platform instance correctly (Closed)
Patch Set: review #32 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 cf094436634503cba1d22806d15449f44d0a8e5b..7ba6be21e401fea6aa0dc5970831b6da555c47af 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -1161,7 +1161,8 @@ TEST(ImageResourceTest,
}
TEST(ImageResourceTest, PeriodicFlushTest) {
- TestingPlatformSupportWithMockScheduler platform;
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
+ platform;
KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html");
URLTestHelpers::registerMockedURLLoad(testURL, "cancelTest.html",
"text/html");
@@ -1191,8 +1192,8 @@ TEST(ImageResourceTest, PeriodicFlushTest) {
EXPECT_TRUE(imageResource->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.
@@ -1216,13 +1217,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(imageResource->errorOccurred());
ASSERT_TRUE(imageResource->getContent()->hasImage());
EXPECT_FALSE(imageResource->getContent()->getImage()->isNull());

Powered by Google App Engine
This is Rietveld 408576698