| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsC
ontext3DPrivate::extractWebGraphicsContext3D(mainContext.get())); | 71 MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(GraphicsC
ontext3DPrivate::extractWebGraphicsContext3D(mainContext.get())); |
| 72 | 72 |
| 73 MockWebTextureUpdater updater; | 73 MockWebTextureUpdater updater; |
| 74 | 74 |
| 75 SkDevice device(SkBitmap::kARGB_8888_Config, 300, 150); | 75 SkDevice device(SkBitmap::kARGB_8888_Config, 300, 150); |
| 76 SkDeferredCanvas canvas(&device); | 76 SkDeferredCanvas canvas(&device); |
| 77 | 77 |
| 78 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 78 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 79 | 79 |
| 80 OwnPtr<Canvas2DLayerBridge> bridge = Canvas2DLayerBridge::create(mainCon
text.release(), &canvas, threadMode); | 80 OwnPtr<Canvas2DLayerBridge> bridge = Canvas2DLayerBridge::create(mainCon
text.release(), &canvas, Canvas2DLayerBridge::NonOpaque, threadMode); |
| 81 | 81 |
| 82 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 82 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 83 | 83 |
| 84 EXPECT_CALL(mainMock, flush()); | 84 EXPECT_CALL(mainMock, flush()); |
| 85 unsigned textureId = bridge->backBufferTexture(); | 85 unsigned textureId = bridge->backBufferTexture(); |
| 86 EXPECT_TRUE(textureId == 0); | 86 EXPECT_TRUE(textureId == 0); |
| 87 | 87 |
| 88 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 88 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 89 | 89 |
| 90 bridge.clear(); | 90 bridge.clear(); |
| 91 | 91 |
| 92 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 92 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 93 ::testing::Mock::VerifyAndClearExpectations(&updater); | 93 ::testing::Mock::VerifyAndClearExpectations(&updater); |
| 94 } | 94 } |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 namespace { | 97 namespace { |
| 98 | 98 |
| 99 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded) | 99 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded) |
| 100 { | 100 { |
| 101 fullLifecycleTest(Canvas2DLayerBridge::SingleThread); | 101 fullLifecycleTest(Canvas2DLayerBridge::SingleThread); |
| 102 } | 102 } |
| 103 | 103 |
| 104 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleThreaded) | 104 TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleThreaded) |
| 105 { | 105 { |
| 106 fullLifecycleTest(Canvas2DLayerBridge::Threaded); | 106 fullLifecycleTest(Canvas2DLayerBridge::Threaded); |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace | 109 } // namespace |
| OLD | NEW |