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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Issue 2836283002: [blink] Fix crashes in CanvasRenderingContext2DTests. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
index 0df963532194839e08c4e382f36774dfa2d95fce..0299a5d380c9ceed00fdf90056bd601bfc0db362 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -1404,15 +1404,24 @@ class CanvasRenderingContext2DTestWithTestingPlatform
: public CanvasRenderingContext2DTest {
protected:
void SetUp() override {
+ platform_ = WTF::MakeUnique<ScopedTestingPlatformSupport<
+ TestingPlatformSupportWithMockScheduler>>();
override_settings_function_ = &OverrideScriptEnabled;
- platform_->AdvanceClockSeconds(1.); // For non-zero DocumentParserTimings.
+ (*platform_)
+ ->AdvanceClockSeconds(1.); // For non-zero DocumentParserTimings.
CanvasRenderingContext2DTest::SetUp();
GetDocument().View()->UpdateLayout();
}
- void RunUntilIdle() { platform_->RunUntilIdle(); }
+ void TearDown() override {
+ platform_.reset();
+ CanvasRenderingContext2DTest::TearDown();
+ }
+
+ void RunUntilIdle() { (*platform_)->RunUntilIdle(); }
- ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
+ std::unique_ptr<
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>>
platform_;
};
@@ -1458,6 +1467,7 @@ TEST_F(CanvasRenderingContext2DTestWithTestingPlatform,
false);
EXPECT_EQ(!!CANVAS2D_HIBERNATION_ENABLED,
layer->NeedsCompositingInputsUpdate());
+ RunUntilIdle(); // Clear task queue.
}
} // namespace blink
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698