OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |