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

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

Issue 1126883002: Change all one-off lifecycle callers to FrameView::updateLayoutAndStyleForPainting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 6
7 #include "core/html/canvas/CanvasRenderingContext2D.h" 7 #include "core/html/canvas/CanvasRenderingContext2D.h"
8 8
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/html/HTMLDocument.h" 10 #include "core/html/HTMLDocument.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 context2d(); // Calling this for the checks 64 context2d(); // Calling this for the checks
65 } 65 }
66 66
67 void CanvasRenderingContext2DAPITest::SetUp() 67 void CanvasRenderingContext2DAPITest::SetUp()
68 { 68 {
69 Page::PageClients pageClients; 69 Page::PageClients pageClients;
70 fillWithEmptyClients(pageClients); 70 fillWithEmptyClients(pageClients);
71 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients) ; 71 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600), &pageClients) ;
72 m_document = toHTMLDocument(&m_dummyPageHolder->document()); 72 m_document = toHTMLDocument(&m_dummyPageHolder->document());
73 m_document->documentElement()->setInnerHTML("<body><canvas id='c'></canvas>< /body>", ASSERT_NO_EXCEPTION); 73 m_document->documentElement()->setInnerHTML("<body><canvas id='c'></canvas>< /body>", ASSERT_NO_EXCEPTION);
74 m_document->view()->updateLayoutAndStyleIfNeededRecursive(); 74 m_document->view()->updateLayoutAndStyleForPainting();
75 m_canvasElement = toHTMLCanvasElement(m_document->getElementById("c")); 75 m_canvasElement = toHTMLCanvasElement(m_document->getElementById("c"));
76 } 76 }
77 77
78 TEST_F(CanvasRenderingContext2DAPITest, SetShadowColor_Clamping) 78 TEST_F(CanvasRenderingContext2DAPITest, SetShadowColor_Clamping)
79 { 79 {
80 createContext(NonOpaque); 80 createContext(NonOpaque);
81 81
82 context2d()->setShadowColor("rgba(0,0,0,0)"); 82 context2d()->setShadowColor("rgba(0,0,0,0)");
83 EXPECT_EQ(String("rgba(0, 0, 0, 0)"), context2d()->shadowColor()); 83 EXPECT_EQ(String("rgba(0, 0, 0, 0)"), context2d()->shadowColor());
84 context2d()->setShadowColor("rgb(0,0,0)"); 84 context2d()->setShadowColor("rgb(0,0,0)");
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 RefPtrWillBeRawPtr<ImageData> imgdata4 = context2d()->createImageData(-10, - 20, exceptionState); 213 RefPtrWillBeRawPtr<ImageData> imgdata4 = context2d()->createImageData(-10, - 20, exceptionState);
214 EXPECT_FALSE(exceptionState.hadException()); 214 EXPECT_FALSE(exceptionState.hadException());
215 215
216 EXPECT_EQ((unsigned)800, imgdata1->data()->length()); 216 EXPECT_EQ((unsigned)800, imgdata1->data()->length());
217 EXPECT_EQ((unsigned)800, imgdata2->data()->length()); 217 EXPECT_EQ((unsigned)800, imgdata2->data()->length());
218 EXPECT_EQ((unsigned)800, imgdata3->data()->length()); 218 EXPECT_EQ((unsigned)800, imgdata3->data()->length());
219 EXPECT_EQ((unsigned)800, imgdata4->data()->length()); 219 EXPECT_EQ((unsigned)800, imgdata4->data()->length());
220 } 220 }
221 221
222 } // unnamed namespace 222 } // unnamed namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTextFormControlElementTest.cpp ('k') | Source/core/html/canvas/CanvasRenderingContext2DTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698