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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsC
ontext3DPrivate::extractWebGraphicsContext3D(mainContext.get())); | 70 MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsC
ontext3DPrivate::extractWebGraphicsContext3D(mainContext.get())); |
71 | 71 |
72 MockWebTextureUpdater updater; | 72 MockWebTextureUpdater updater; |
73 | 73 |
74 const IntSize size(300, 150); | 74 const IntSize size(300, 150); |
75 | 75 |
76 WebGLId backTextureId = 1; | 76 WebGLId backTextureId = 1; |
77 WebGLId frontTextureId = 1; | 77 WebGLId frontTextureId = 1; |
78 | 78 |
79 OwnPtr<Canvas2DLayerBridge> bridge = Canvas2DLayerBridge::create(mainCon
text.get(), size, threadMode, backTextureId); | 79 OwnPtr<Canvas2DLayerBridge> bridge = Canvas2DLayerBridge::create(mainCon
text.get(), size, Canvas2DLayerBridge::NonOpaque, threadMode, backTextureId); |
80 | 80 |
81 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 81 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
82 | 82 |
83 EXPECT_CALL(mainMock, flush()); | 83 EXPECT_CALL(mainMock, flush()); |
84 EXPECT_EQ(frontTextureId, bridge->prepareTexture(updater)); | 84 EXPECT_EQ(frontTextureId, bridge->prepareTexture(updater)); |
85 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 85 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
86 ::testing::Mock::VerifyAndClearExpectations(&updater); | 86 ::testing::Mock::VerifyAndClearExpectations(&updater); |
87 | 87 |
88 bridge.clear(); | 88 bridge.clear(); |
89 } | 89 } |
90 }; | 90 }; |
91 | 91 |
92 namespace { | 92 namespace { |
93 | 93 |
94 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded) | 94 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded) |
95 { | 95 { |
96 fullLifecycleTest(Canvas2DLayerBridge::SingleThread); | 96 fullLifecycleTest(Canvas2DLayerBridge::SingleThread); |
97 } | 97 } |
98 | 98 |
99 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleThreaded) | 99 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleThreaded) |
100 { | 100 { |
101 fullLifecycleTest(Canvas2DLayerBridge::Threaded); | 101 fullLifecycleTest(Canvas2DLayerBridge::Threaded); |
102 } | 102 } |
103 | 103 |
104 } // namespace | 104 } // namespace |
OLD | NEW |