| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 RefPtr<SkSurface> surface = adoptRef(SkSurface::NewRasterN32Premul(300,
150)); | 117 RefPtr<SkSurface> surface = adoptRef(SkSurface::NewRasterN32Premul(300,
150)); |
| 118 OwnPtr<SkDeferredCanvas> canvas = adoptPtr(SkDeferredCanvas::Create(surf
ace.get())); | 118 OwnPtr<SkDeferredCanvas> canvas = adoptPtr(SkDeferredCanvas::Create(surf
ace.get())); |
| 119 | 119 |
| 120 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 120 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 121 | 121 |
| 122 { | 122 { |
| 123 Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(mainM
ockProvider.release(), canvas.release(), surface, 0, NonOpaque))); | 123 Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(mainM
ockProvider.release(), canvas.release(), surface, 0, NonOpaque))); |
| 124 | 124 |
| 125 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 125 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 126 | 126 |
| 127 EXPECT_CALL(mainMock, flush()); | 127 unsigned textureId = bridge->newImageSnapshot()->getTextureHandle(tr
ue); |
| 128 unsigned textureId = bridge->getBackingTextureImage()->getTextureHan
dle(true); | |
| 129 EXPECT_EQ(textureId, 0u); | 128 EXPECT_EQ(textureId, 0u); |
| 130 | 129 |
| 131 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 130 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 132 } // bridge goes out of scope here | 131 } // bridge goes out of scope here |
| 133 | 132 |
| 134 ::testing::Mock::VerifyAndClearExpectations(&mainMock); | 133 ::testing::Mock::VerifyAndClearExpectations(&mainMock); |
| 135 } | 134 } |
| 136 | 135 |
| 137 void noDrawOnContextLostTest() | 136 void noDrawOnContextLostTest() |
| 138 { | 137 { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 { | 229 { |
| 231 prepareMailboxWithBitmapTest(); | 230 prepareMailboxWithBitmapTest(); |
| 232 } | 231 } |
| 233 | 232 |
| 234 TEST_F(Canvas2DLayerBridgeTest, testPrepareMailboxAndLoseResource) | 233 TEST_F(Canvas2DLayerBridgeTest, testPrepareMailboxAndLoseResource) |
| 235 { | 234 { |
| 236 prepareMailboxAndLoseResourceTest(); | 235 prepareMailboxAndLoseResourceTest(); |
| 237 } | 236 } |
| 238 | 237 |
| 239 } // namespace blink | 238 } // namespace blink |
| OLD | NEW |