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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2DTest.cpp

Issue 1092793008: Oilpan: fix build after r193963. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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: Source/core/html/canvas/CanvasRenderingContext2DTest.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2DTest.cpp b/Source/core/html/canvas/CanvasRenderingContext2DTest.cpp
index 4d38ddf7b7009b3c843603de5477cd312e1278ae..973149bd345f61d6c24d07a9e30e3a2f7bf10566 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2DTest.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2DTest.cpp
@@ -153,8 +153,14 @@ public:
//============================================================================
-class MockCanvasObserver : public CanvasObserver {
+class MockCanvasObserver : public NoBaseWillBeGarbageCollectedFinalized<MockCanvasObserver>, public CanvasObserver {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MockCanvasObserver);
public:
+ static PassOwnPtrWillBeRawPtr<MockCanvasObserver> create()
+ {
+ return adoptPtrWillBeNoop(new MockCanvasObserver);
+ }
+
virtual ~MockCanvasObserver() { }
MOCK_METHOD2(canvasChanged, void(HTMLCanvasElement*, const FloatRect&));
MOCK_METHOD1(canvasResized, void(HTMLCanvasElement*));
@@ -539,16 +545,16 @@ TEST_F(CanvasRenderingContext2DTest, FallbackWithLargeState)
TEST_F(CanvasRenderingContext2DTest, CanvasObserver)
{
createContext(NonOpaque);
- MockCanvasObserver observer;
- canvasElement().addObserver(&observer);
+ OwnPtrWillBeRawPtr<MockCanvasObserver> observer = MockCanvasObserver::create();
+ canvasElement().addObserver(observer.get());
// The canvasChanged notification must be immediate, and not deferred until paint time
// because offscreen canvases, which are not painted, also need to emit notifications.
- EXPECT_CALL(observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1))).Times(1);
+ EXPECT_CALL(*observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1))).Times(1);
context2d()->fillRect(0, 0, 1, 1);
- Mock::VerifyAndClearExpectations(&observer);
+ Mock::VerifyAndClearExpectations(observer.get());
- canvasElement().removeObserver(&observer);
+ canvasElement().removeObserver(observer.get());
}
} // unnamed namespace
« 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