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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/graphics/RecordingImageBufferSurface.h" 5 #include "platform/graphics/RecordingImageBufferSurface.h"
6 6
7 #include "platform/WebTaskRunner.h" 7 #include "platform/WebTaskRunner.h"
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/ImageBuffer.h" 9 #include "platform/graphics/ImageBuffer.h"
10 #include "platform/graphics/ImageBufferClient.h" 10 #include "platform/graphics/ImageBufferClient.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 m_surfaceFactory->createSurfaceCount()); 224 m_surfaceFactory->createSurfaceCount());
225 } 225 }
226 226
227 private: 227 private:
228 MockSurfaceFactory* m_surfaceFactory; 228 MockSurfaceFactory* m_surfaceFactory;
229 RecordingImageBufferSurface* m_testSurface; 229 RecordingImageBufferSurface* m_testSurface;
230 std::unique_ptr<FakeImageBufferClient> m_fakeImageBufferClient; 230 std::unique_ptr<FakeImageBufferClient> m_fakeImageBufferClient;
231 std::unique_ptr<ImageBuffer> m_imageBuffer; 231 std::unique_ptr<ImageBuffer> m_imageBuffer;
232 }; 232 };
233 233
234 #define CALL_TEST_TASK_WRAPPER(TEST_METHOD) \ 234 #define CALL_TEST_TASK_WRAPPER(TEST_METHOD) \
235 { \ 235 { \
236 TestingPlatformSupportWithMockScheduler testingPlatform; \ 236 ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler> \
237 Platform::current()->currentThread()->getWebTaskRunner()->postTask( \ 237 platform; \
238 BLINK_FROM_HERE, \ 238 Platform::current()->currentThread()->getWebTaskRunner()->postTask( \
239 WTF::bind(&RecordingImageBufferSurfaceTest::TEST_METHOD, \ 239 BLINK_FROM_HERE, \
240 WTF::unretained(this))); \ 240 WTF::bind(&RecordingImageBufferSurfaceTest::TEST_METHOD, \
241 testingPlatform.runUntilIdle(); \ 241 WTF::unretained(this))); \
242 platform->runUntilIdle(); \
242 } 243 }
243 244
244 TEST_F(RecordingImageBufferSurfaceTest, testEmptyPicture) { 245 TEST_F(RecordingImageBufferSurfaceTest, testEmptyPicture) {
245 testEmptyPicture(); 246 testEmptyPicture();
246 } 247 }
247 248
248 TEST_F(RecordingImageBufferSurfaceTest, testNoFallbackWithClear) { 249 TEST_F(RecordingImageBufferSurfaceTest, testNoFallbackWithClear) {
249 testNoFallbackWithClear(); 250 testNoFallbackWithClear();
250 } 251 }
251 252
(...skipping 18 matching lines...) Expand all
270 CALL_TEST_TASK_WRAPPER(testAnimatedWithClear) 271 CALL_TEST_TASK_WRAPPER(testAnimatedWithClear)
271 expectDisplayListEnabled(true); 272 expectDisplayListEnabled(true);
272 } 273 }
273 274
274 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) { 275 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) {
275 CALL_TEST_TASK_WRAPPER(testClearRect); 276 CALL_TEST_TASK_WRAPPER(testClearRect);
276 expectDisplayListEnabled(true); 277 expectDisplayListEnabled(true);
277 } 278 }
278 279
279 } // namespace blink 280 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698