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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp

Issue 2956583002: Removed usage of RefPtr::Release in unit tests (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 class Canvas2DLayerBridgeTest : public Test { 120 class Canvas2DLayerBridgeTest : public Test {
121 public: 121 public:
122 PassRefPtr<Canvas2DLayerBridge> MakeBridge( 122 PassRefPtr<Canvas2DLayerBridge> MakeBridge(
123 std::unique_ptr<FakeWebGraphicsContext3DProvider> provider, 123 std::unique_ptr<FakeWebGraphicsContext3DProvider> provider,
124 const IntSize& size, 124 const IntSize& size,
125 Canvas2DLayerBridge::AccelerationMode acceleration_mode) { 125 Canvas2DLayerBridge::AccelerationMode acceleration_mode) {
126 RefPtr<Canvas2DLayerBridge> bridge = AdoptRef( 126 RefPtr<Canvas2DLayerBridge> bridge = AdoptRef(
127 new Canvas2DLayerBridge(std::move(provider), size, 0, kNonOpaque, 127 new Canvas2DLayerBridge(std::move(provider), size, 0, kNonOpaque,
128 acceleration_mode, CanvasColorParams())); 128 acceleration_mode, CanvasColorParams()));
129 bridge->DontUseIdleSchedulingForTesting(); 129 bridge->DontUseIdleSchedulingForTesting();
130 return bridge.Release(); 130 return bridge;
131 } 131 }
132 132
133 protected: 133 protected:
134 void FullLifecycleTest() { 134 void FullLifecycleTest() {
135 FakeGLES2Interface gl; 135 FakeGLES2Interface gl;
136 std::unique_ptr<FakeWebGraphicsContext3DProvider> context_provider = 136 std::unique_ptr<FakeWebGraphicsContext3DProvider> context_provider =
137 WTF::WrapUnique(new FakeWebGraphicsContext3DProvider(&gl)); 137 WTF::WrapUnique(new FakeWebGraphicsContext3DProvider(&gl));
138 138
139 Canvas2DLayerBridgePtr bridge(AdoptRef(new Canvas2DLayerBridge( 139 Canvas2DLayerBridgePtr bridge(AdoptRef(new Canvas2DLayerBridge(
140 std::move(context_provider), IntSize(300, 150), 0, kNonOpaque, 140 std::move(context_provider), IntSize(300, 150), 0, kNonOpaque,
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); 1378 EXPECT_FALSE(bridge->HasRecordedDrawCommands());
1379 ::testing::Mock::VerifyAndClearExpectations(&gl); 1379 ::testing::Mock::VerifyAndClearExpectations(&gl);
1380 1380
1381 EXPECT_CALL(gl, Flush()).Times(1); 1381 EXPECT_CALL(gl, Flush()).Times(1);
1382 bridge->FlushGpu(); 1382 bridge->FlushGpu();
1383 EXPECT_FALSE(bridge->HasRecordedDrawCommands()); 1383 EXPECT_FALSE(bridge->HasRecordedDrawCommands());
1384 ::testing::Mock::VerifyAndClearExpectations(&gl); 1384 ::testing::Mock::VerifyAndClearExpectations(&gl);
1385 } 1385 }
1386 1386
1387 } // namespace blink 1387 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698