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

Side by Side Diff: Source/WebKit/chromium/tests/Canvas2DLayerBridgeTest.cpp

Issue 14298018: This CL implements the first draft of Canvas 2D Context Attributes, aka getContext('2d', { alpha: f… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: IDL cleanup Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698