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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2DTest.cpp

Issue 1225583004: Revert of Add a FrameView lifecycle method that just updates layout, style and compositing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 // 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 "core/html/canvas/CanvasRenderingContext2D.h" 6 #include "core/html/canvas/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/HTMLDocument.h" 10 #include "core/html/HTMLDocument.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 m_canvasElement->getCanvasRenderingContext(canvasType, attributes); 130 m_canvasElement->getCanvasRenderingContext(canvasType, attributes);
131 } 131 }
132 132
133 void CanvasRenderingContext2DTest::SetUp() 133 void CanvasRenderingContext2DTest::SetUp()
134 { 134 {
135 Page::PageClients pageClients; 135 Page::PageClients pageClients;
136 fillWithEmptyClients(pageClients); 136 fillWithEmptyClients(pageClients);
137 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients) ; 137 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients) ;
138 m_document = toHTMLDocument(&m_dummyPageHolder->document()); 138 m_document = toHTMLDocument(&m_dummyPageHolder->document());
139 m_document->documentElement()->setInnerHTML("<body><canvas id='c'></canvas>< /body>", ASSERT_NO_EXCEPTION); 139 m_document->documentElement()->setInnerHTML("<body><canvas id='c'></canvas>< /body>", ASSERT_NO_EXCEPTION);
140 m_document->view()->updateAllLifecyclePhases(); 140 m_document->view()->updateLayoutAndStyleForPainting();
141 m_canvasElement = toHTMLCanvasElement(m_document->getElementById("c")); 141 m_canvasElement = toHTMLCanvasElement(m_document->getElementById("c"));
142 142
143 m_fullImageData = ImageData::create(IntSize(10, 10)); 143 m_fullImageData = ImageData::create(IntSize(10, 10));
144 m_partialImageData = ImageData::create(IntSize(2, 2)); 144 m_partialImageData = ImageData::create(IntSize(2, 2));
145 145
146 NonThrowableExceptionState exceptionState; 146 NonThrowableExceptionState exceptionState;
147 RefPtrWillBeRawPtr<CanvasGradient> opaqueGradient = CanvasGradient::create(F loatPoint(0, 0), FloatPoint(10, 0)); 147 RefPtrWillBeRawPtr<CanvasGradient> opaqueGradient = CanvasGradient::create(F loatPoint(0, 0), FloatPoint(10, 0));
148 opaqueGradient->addColorStop(0, String("green"), exceptionState); 148 opaqueGradient->addColorStop(0, String("green"), exceptionState);
149 EXPECT_FALSE(exceptionState.hadException()); 149 EXPECT_FALSE(exceptionState.hadException());
150 opaqueGradient->addColorStop(1, String("blue"), exceptionState); 150 opaqueGradient->addColorStop(1, String("blue"), exceptionState);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 // The canvasChanged notification must be immediate, and not deferred until paint time 623 // The canvasChanged notification must be immediate, and not deferred until paint time
624 // because offscreen canvases, which are not painted, also need to emit noti fications. 624 // because offscreen canvases, which are not painted, also need to emit noti fications.
625 EXPECT_CALL(*observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1) )).Times(1); 625 EXPECT_CALL(*observer, canvasChanged(&canvasElement(), FloatRect(0, 0, 1, 1) )).Times(1);
626 context2d()->fillRect(0, 0, 1, 1); 626 context2d()->fillRect(0, 0, 1, 1);
627 Mock::VerifyAndClearExpectations(observer.get()); 627 Mock::VerifyAndClearExpectations(observer.get());
628 628
629 canvasElement().removeObserver(observer.get()); 629 canvasElement().removeObserver(observer.get());
630 } 630 }
631 631
632 } // namespace blink 632 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2DAPITest.cpp ('k') | Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698