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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.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 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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 postAndWaitDestroyBridgeTask(BLINK_FROM_HERE, testThread.get(), &bridge); 1247 postAndWaitDestroyBridgeTask(BLINK_FROM_HERE, testThread.get(), &bridge);
1248 } 1248 }
1249 1249
1250 #if USE_IOSURFACE_FOR_2D_CANVAS 1250 #if USE_IOSURFACE_FOR_2D_CANVAS
1251 TEST_F(Canvas2DLayerBridgeTest, DeleteIOSurfaceAfterTeardown) 1251 TEST_F(Canvas2DLayerBridgeTest, DeleteIOSurfaceAfterTeardown)
1252 #else 1252 #else
1253 TEST_F(Canvas2DLayerBridgeTest, DISABLED_DeleteIOSurfaceAfterTeardown) 1253 TEST_F(Canvas2DLayerBridgeTest, DISABLED_DeleteIOSurfaceAfterTeardown)
1254 #endif 1254 #endif
1255 { 1255 {
1256 FakeGLES2InterfaceWithImageSupport gl; 1256 FakeGLES2InterfaceWithImageSupport gl;
1257 FakePlatformSupport testingPlatformSupport; 1257 ScopedTestingPlatformSupport<FakePlatformSupport> platform;
1258 std::unique_ptr<FakeWebGraphicsContext3DProvider> contextProvider = 1258 std::unique_ptr<FakeWebGraphicsContext3DProvider> contextProvider =
1259 WTF::wrapUnique(new FakeWebGraphicsContext3DProvider(&gl)); 1259 WTF::wrapUnique(new FakeWebGraphicsContext3DProvider(&gl));
1260 1260
1261 cc::TextureMailbox textureMailbox; 1261 cc::TextureMailbox textureMailbox;
1262 std::unique_ptr<cc::SingleReleaseCallback> releaseCallback; 1262 std::unique_ptr<cc::SingleReleaseCallback> releaseCallback;
1263 1263
1264 { 1264 {
1265 Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge( 1265 Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(
1266 std::move(contextProvider), IntSize(300, 150), 0, NonOpaque, 1266 std::move(contextProvider), IntSize(300, 150), 0, NonOpaque,
1267 Canvas2DLayerBridge::ForceAccelerationForTesting, nullptr, 1267 Canvas2DLayerBridge::ForceAccelerationForTesting, nullptr,
1268 kN32_SkColorType))); 1268 kN32_SkColorType)));
1269 bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback); 1269 bridge->PrepareTextureMailbox(&textureMailbox, &releaseCallback);
1270 } 1270 }
1271 1271
1272 bool lostResource = false; 1272 bool lostResource = false;
1273 releaseCallback->Run(gpu::SyncToken(), lostResource); 1273 releaseCallback->Run(gpu::SyncToken(), lostResource);
1274 1274
1275 EXPECT_EQ(1u, gl.createImageCount()); 1275 EXPECT_EQ(1u, gl.createImageCount());
1276 EXPECT_EQ(1u, gl.destroyImageCount()); 1276 EXPECT_EQ(1u, gl.destroyImageCount());
1277 } 1277 }
1278 1278
1279 } // namespace blink 1279 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698