Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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_TRUE(content_layer_client.last_context_status() == | |
|
danakj
2014/05/01 17:07:11
nit: EXPECT_EQ(expected,actual) here and below?
Stephen Chennney
2014/05/01 19:12:26
Done.
| |
| 467 ContentLayerClient::GraphicsContextEnabled); | |
| 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_TRUE(content_layer_client.last_context_status() == | |
| 478 ContentLayerClient::GraphicsContextEnabled); | |
| 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_TRUE(content_layer_client.last_context_status() == | |
| 489 ContentLayerClient::GraphicsContextDisabled); | |
|
Sami
2014/05/01 16:32:53
Thanks for improving the test.
| |
| 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 |
| OLD | NEW |