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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Issue 1387743002: Fixed expando-loss.html test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cache ScriptState and use it to wrap m_defaultVertexArrayObject. Created 5 years, 2 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 "config.h" 5 #include "config.h"
6 #include "modules/canvas2d/CanvasRenderingContext2D.h" 6 #include "modules/canvas2d/CanvasRenderingContext2D.h"
7 7
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/ImageBitmap.h" 9 #include "core/frame/ImageBitmap.h"
10 #include "core/html/HTMLCanvasElement.h" 10 #include "core/html/HTMLCanvasElement.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 : m_wrapGradients(WrapGradients::create()) 121 : m_wrapGradients(WrapGradients::create())
122 , m_opaqueBitmap(IntSize(10, 10), OpaqueBitmap) 122 , m_opaqueBitmap(IntSize(10, 10), OpaqueBitmap)
123 , m_alphaBitmap(IntSize(10, 10), TransparentBitmap) 123 , m_alphaBitmap(IntSize(10, 10), TransparentBitmap)
124 { } 124 { }
125 125
126 void CanvasRenderingContext2DTest::createContext(OpacityMode opacityMode) 126 void CanvasRenderingContext2DTest::createContext(OpacityMode opacityMode)
127 { 127 {
128 String canvasType("2d"); 128 String canvasType("2d");
129 CanvasContextCreationAttributes attributes; 129 CanvasContextCreationAttributes attributes;
130 attributes.setAlpha(opacityMode == NonOpaque); 130 attributes.setAlpha(opacityMode == NonOpaque);
131 m_canvasElement->getCanvasRenderingContext(canvasType, attributes); 131 m_canvasElement->getCanvasRenderingContext(nullptr, canvasType, attributes);
132 } 132 }
133 133
134 void CanvasRenderingContext2DTest::SetUp() 134 void CanvasRenderingContext2DTest::SetUp()
135 { 135 {
136 Page::PageClients pageClients; 136 Page::PageClients pageClients;
137 fillWithEmptyClients(pageClients); 137 fillWithEmptyClients(pageClients);
138 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients) ; 138 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients) ;
139 m_document = toHTMLDocument(&m_dummyPageHolder->document()); 139 m_document = toHTMLDocument(&m_dummyPageHolder->document());
140 m_document->documentElement()->setInnerHTML("<body><canvas id='c'></canvas>< /body>", ASSERT_NO_EXCEPTION); 140 m_document->documentElement()->setInnerHTML("<body><canvas id='c'></canvas>< /body>", ASSERT_NO_EXCEPTION);
141 m_document->view()->updateAllLifecyclePhases(); 141 m_document->view()->updateAllLifecyclePhases();
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 // The canvasChanged notification must be immediate, and not deferred until paint time 624 // The canvasChanged notification must be immediate, and not deferred until paint time
625 // because offscreen canvases, which are not painted, also need to emit noti fications. 625 // because offscreen canvases, which are not painted, also need to emit noti fications.
626 EXPECT_CALL(*observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1) )).Times(1); 626 EXPECT_CALL(*observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1) )).Times(1);
627 context2d()->fillRect(0, 0, 1, 1); 627 context2d()->fillRect(0, 0, 1, 1);
628 Mock::VerifyAndClearExpectations(observer.get()); 628 Mock::VerifyAndClearExpectations(observer.get());
629 629
630 canvasElement().removeObserver(observer.get()); 630 canvasElement().removeObserver(observer.get());
631 } 631 }
632 632
633 } // namespace blink 633 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698