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

Unified Diff: third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.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/modules/notifications/NotificationImageLoaderTest.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp
index 8b31a76e72c963070cad95b28ead9461cb46ce63..62cb2cfc3e54d1f338e142da8b17e65c5d2acc39 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp
@@ -97,22 +97,24 @@ TEST_F(NotificationImageLoaderTest, SuccessTest) {
}
TEST_F(NotificationImageLoaderTest, TimeoutTest) {
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
+ platform;
+
// To test for a timeout, this needs to override the clock in the platform.
// Just creating the mock platform will do everything to set it up.
- TestingPlatformSupportWithMockScheduler testingPlatform;
KURL url = registerMockedURL(kIcon500x500);
loadImage(url);
// Run the platform for kImageFetchTimeoutInMs-1 seconds. This should not
// result in a timeout.
- testingPlatform.runForPeriodSeconds(kImageFetchTimeoutInMs / 1000 - 1);
+ platform->runForPeriodSeconds(kImageFetchTimeoutInMs / 1000 - 1);
EXPECT_EQ(LoadState::kNotLoaded, loaded());
m_histogramTester.expectTotalCount("Notifications.LoadFinishTime.Icon", 0);
m_histogramTester.expectTotalCount("Notifications.LoadFileSize.Icon", 0);
m_histogramTester.expectTotalCount("Notifications.LoadFailTime.Icon", 0);
// Now advance time until a timeout should be expected.
- testingPlatform.runForPeriodSeconds(2);
+ platform->runForPeriodSeconds(2);
// If the loader times out, it calls the callback and returns an empty bitmap.
EXPECT_EQ(LoadState::kLoadFailed, loaded());

Powered by Google App Engine
This is Rietveld 408576698