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

Side by Side Diff: cc/resources/picture_unittest.cc

Issue 253013003: Enable disabling WebCore::GraphicsContext in telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/resources/picture.h" 5 #include "cc/resources/picture.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "cc/test/fake_content_layer_client.h" 10 #include "cc/test/fake_content_layer_client.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 FakeContentLayerClient content_layer_client; 456 FakeContentLayerClient content_layer_client;
457 EXPECT_EQ(NULL, content_layer_client.last_canvas()); 457 EXPECT_EQ(NULL, content_layer_client.last_canvas());
458 458
459 scoped_refptr<Picture> picture = Picture::Create(layer_rect, 459 scoped_refptr<Picture> picture = Picture::Create(layer_rect,
460 &content_layer_client, 460 &content_layer_client,
461 tile_grid_info, 461 tile_grid_info,
462 false, 462 false,
463 0, 463 0,
464 Picture::RECORD_NORMALLY); 464 Picture::RECORD_NORMALLY);
465 EXPECT_TRUE(content_layer_client.last_canvas() != NULL); 465 EXPECT_TRUE(content_layer_client.last_canvas() != NULL);
466 EXPECT_EQ(ContentLayerClient::GRAPHICS_CONTEXT_ENABLED,
467 content_layer_client.last_context_status());
466 EXPECT_TRUE(picture); 468 EXPECT_TRUE(picture);
467 469
468 picture = Picture::Create(layer_rect, 470 picture = Picture::Create(layer_rect,
469 &content_layer_client, 471 &content_layer_client,
470 tile_grid_info, 472 tile_grid_info,
471 false, 473 false,
472 0, 474 0,
473 Picture::RECORD_WITH_SK_NULL_CANVAS); 475 Picture::RECORD_WITH_SK_NULL_CANVAS);
474 EXPECT_TRUE(content_layer_client.last_canvas() != NULL); 476 EXPECT_TRUE(content_layer_client.last_canvas() != NULL);
477 EXPECT_EQ(ContentLayerClient::GRAPHICS_CONTEXT_ENABLED,
478 content_layer_client.last_context_status());
475 EXPECT_TRUE(picture); 479 EXPECT_TRUE(picture);
476 480
477 picture = Picture::Create(layer_rect, 481 picture = Picture::Create(layer_rect,
478 &content_layer_client, 482 &content_layer_client,
479 tile_grid_info, 483 tile_grid_info,
480 false, 484 false,
481 0, 485 0,
482 Picture::RECORD_WITH_PAINTING_DISABLED); 486 Picture::RECORD_WITH_PAINTING_DISABLED);
483 EXPECT_EQ(NULL, content_layer_client.last_canvas()); 487 EXPECT_TRUE(content_layer_client.last_canvas() != NULL);
488 EXPECT_EQ(ContentLayerClient::GRAPHICS_CONTEXT_DISABLED,
489 content_layer_client.last_context_status());
484 EXPECT_TRUE(picture); 490 EXPECT_TRUE(picture);
485 491
486 picture = Picture::Create(layer_rect, 492 picture = Picture::Create(layer_rect,
487 &content_layer_client, 493 &content_layer_client,
488 tile_grid_info, 494 tile_grid_info,
489 false, 495 false,
490 0, 496 0,
491 Picture::RECORD_WITH_SKRECORD); 497 Picture::RECORD_WITH_SKRECORD);
492 EXPECT_TRUE(content_layer_client.last_canvas() != NULL); 498 EXPECT_TRUE(content_layer_client.last_canvas() != NULL);
493 EXPECT_TRUE(picture); 499 EXPECT_TRUE(picture);
494 500
495 EXPECT_EQ(4, Picture::RECORDING_MODE_COUNT); 501 EXPECT_EQ(4, Picture::RECORDING_MODE_COUNT);
496 } 502 }
497 503
498 } // namespace 504 } // namespace
499 } // namespace cc 505 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698