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

Unified Diff: third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.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/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..adac5851c6a4f5dff4e98605249b85b7abd508bd 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoaderTest.cpp
@@ -99,20 +99,21 @@ TEST_F(NotificationImageLoaderTest, SuccessTest) {
TEST_F(NotificationImageLoaderTest, TimeoutTest) {
// 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;
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
+ testingPlatform(new TestingPlatformSupportWithMockScheduler);
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);
+ testingPlatform->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);
+ testingPlatform->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