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

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

Issue 2387093002: Reflow comments in canvas-related folders (Closed)
Patch Set: More fix Created 4 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 "modules/canvas2d/CanvasRenderingContext2D.h" 5 #include "modules/canvas2d/CanvasRenderingContext2D.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/html/HTMLCanvasElement.h" 10 #include "core/html/HTMLCanvasElement.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 ImageData* imageData = context2d()->createImageData(100, 50, exceptionState); 237 ImageData* imageData = context2d()->createImageData(100, 50, exceptionState);
238 EXPECT_FALSE(exceptionState.hadException()); 238 EXPECT_FALSE(exceptionState.hadException());
239 EXPECT_EQ(100, imageData->width()); 239 EXPECT_EQ(100, imageData->width());
240 EXPECT_EQ(50, imageData->height()); 240 EXPECT_EQ(50, imageData->height());
241 241
242 for (unsigned i = 0; i < imageData->data()->length(); ++i) 242 for (unsigned i = 0; i < imageData->data()->length(); ++i)
243 imageData->data()->data()[i] = 255; 243 imageData->data()->data()[i] = 255;
244 244
245 EXPECT_EQ(255, imageData->data()->data()[32]); 245 EXPECT_EQ(255, imageData->data()->data()[32]);
246 246
247 // createImageData(imageData) should create a new ImageData of the same size a s 'imageData' 247 // createImageData(imageData) should create a new ImageData of the same size
248 // but filled with transparent black 248 // as 'imageData' but filled with transparent black
249 249
250 ImageData* sameSizeImageData = 250 ImageData* sameSizeImageData =
251 context2d()->createImageData(imageData, exceptionState); 251 context2d()->createImageData(imageData, exceptionState);
252 EXPECT_FALSE(exceptionState.hadException()); 252 EXPECT_FALSE(exceptionState.hadException());
253 EXPECT_EQ(100, sameSizeImageData->width()); 253 EXPECT_EQ(100, sameSizeImageData->width());
254 EXPECT_EQ(50, sameSizeImageData->height()); 254 EXPECT_EQ(50, sameSizeImageData->height());
255 EXPECT_EQ(0, sameSizeImageData->data()->data()[32]); 255 EXPECT_EQ(0, sameSizeImageData->data()->data()[32]);
256 256
257 // createImageData(width, height) takes the absolute magnitude of the size arg uments 257 // createImageData(width, height) takes the absolute magnitude of the size
258 // arguments
258 259
259 ImageData* imgdata1 = context2d()->createImageData(10, 20, exceptionState); 260 ImageData* imgdata1 = context2d()->createImageData(10, 20, exceptionState);
260 EXPECT_FALSE(exceptionState.hadException()); 261 EXPECT_FALSE(exceptionState.hadException());
261 ImageData* imgdata2 = context2d()->createImageData(-10, 20, exceptionState); 262 ImageData* imgdata2 = context2d()->createImageData(-10, 20, exceptionState);
262 EXPECT_FALSE(exceptionState.hadException()); 263 EXPECT_FALSE(exceptionState.hadException());
263 ImageData* imgdata3 = context2d()->createImageData(10, -20, exceptionState); 264 ImageData* imgdata3 = context2d()->createImageData(10, -20, exceptionState);
264 EXPECT_FALSE(exceptionState.hadException()); 265 EXPECT_FALSE(exceptionState.hadException());
265 ImageData* imgdata4 = context2d()->createImageData(-10, -20, exceptionState); 266 ImageData* imgdata4 = context2d()->createImageData(-10, -20, exceptionState);
266 EXPECT_FALSE(exceptionState.hadException()); 267 EXPECT_FALSE(exceptionState.hadException());
267 268
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 AXObject* axObject = axObjectCache->getOrCreate(buttonElement); 360 AXObject* axObject = axObjectCache->getOrCreate(buttonElement);
360 361
361 LayoutRect axBounds = axObject->getBoundsInFrameCoordinates(); 362 LayoutRect axBounds = axObject->getBoundsInFrameCoordinates();
362 EXPECT_EQ(25, axBounds.x().toInt()); 363 EXPECT_EQ(25, axBounds.x().toInt());
363 EXPECT_EQ(25, axBounds.y().toInt()); 364 EXPECT_EQ(25, axBounds.y().toInt());
364 EXPECT_EQ(40, axBounds.width().toInt()); 365 EXPECT_EQ(40, axBounds.width().toInt());
365 EXPECT_EQ(40, axBounds.height().toInt()); 366 EXPECT_EQ(40, axBounds.height().toInt());
366 } 367 }
367 368
368 } // namespace blink 369 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698