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

Unified Diff: cc/resources/picture_unittest.cc

Issue 664583002: Remove obsolete SkRecord preview code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update r&r micro, and format Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_unittest.cc
diff --git a/cc/resources/picture_unittest.cc b/cc/resources/picture_unittest.cc
index fc259895904a46100e731d601bfeb0dc052111af..4abeceb54331441dd4ec983b3f9166da769d37e6 100644
--- a/cc/resources/picture_unittest.cc
+++ b/cc/resources/picture_unittest.cc
@@ -45,65 +45,56 @@ TEST(PictureTest, AsBase64String) {
Picture::CreateFromValue(tmp.get());
EXPECT_FALSE(invalid_picture.get());
- Picture::RecordingMode kRecordingModes[] = {Picture::RECORD_NORMALLY,
- Picture::RECORD_WITH_SKRECORD};
-
// Single full-size rect picture.
content_layer_client.add_draw_rect(layer_rect, red_paint);
- for (size_t i = 0; i < arraysize(kRecordingModes); ++i) {
- scoped_refptr<Picture> one_rect_picture =
- Picture::Create(layer_rect,
- &content_layer_client,
- tile_grid_info,
- false,
- kRecordingModes[i]);
- scoped_ptr<base::Value> serialized_one_rect(one_rect_picture->AsValue());
-
- // Reconstruct the picture.
- scoped_refptr<Picture> one_rect_picture_check =
- Picture::CreateFromValue(serialized_one_rect.get());
- EXPECT_TRUE(!!one_rect_picture_check.get());
-
- // Check for equivalence.
- unsigned char one_rect_buffer[4 * 100 * 100] = {0};
- DrawPicture(one_rect_buffer, layer_rect, one_rect_picture);
- unsigned char one_rect_buffer_check[4 * 100 * 100] = {0};
- DrawPicture(one_rect_buffer_check, layer_rect, one_rect_picture_check);
-
- EXPECT_EQ(one_rect_picture->LayerRect(),
- one_rect_picture_check->LayerRect());
- EXPECT_EQ(0, memcmp(one_rect_buffer, one_rect_buffer_check, 4 * 100 * 100));
- }
+ scoped_refptr<Picture> one_rect_picture =
+ Picture::Create(layer_rect,
+ &content_layer_client,
+ tile_grid_info,
+ false,
+ Picture::RECORD_NORMALLY);
+ scoped_ptr<base::Value> serialized_one_rect(one_rect_picture->AsValue());
+
+ // Reconstruct the picture.
+ scoped_refptr<Picture> one_rect_picture_check =
+ Picture::CreateFromValue(serialized_one_rect.get());
+ EXPECT_TRUE(!!one_rect_picture_check.get());
+
+ // Check for equivalence.
+ unsigned char one_rect_buffer[4 * 100 * 100] = {0};
+ DrawPicture(one_rect_buffer, layer_rect, one_rect_picture);
+ unsigned char one_rect_buffer_check[4 * 100 * 100] = {0};
+ DrawPicture(one_rect_buffer_check, layer_rect, one_rect_picture_check);
+
+ EXPECT_EQ(one_rect_picture->LayerRect(), one_rect_picture_check->LayerRect());
+ EXPECT_EQ(0, memcmp(one_rect_buffer, one_rect_buffer_check, 4 * 100 * 100));
// Two rect picture.
content_layer_client.add_draw_rect(gfx::Rect(25, 25, 50, 50), green_paint);
- for (size_t i = 0; i < arraysize(kRecordingModes); ++i) {
- scoped_refptr<Picture> two_rect_picture =
- Picture::Create(layer_rect,
- &content_layer_client,
- tile_grid_info,
- false,
- Picture::RECORD_NORMALLY);
-
- scoped_ptr<base::Value> serialized_two_rect(two_rect_picture->AsValue());
-
- // Reconstruct the picture.
- scoped_refptr<Picture> two_rect_picture_check =
- Picture::CreateFromValue(serialized_two_rect.get());
- EXPECT_TRUE(!!two_rect_picture_check.get());
-
- // Check for equivalence.
- unsigned char two_rect_buffer[4 * 100 * 100] = {0};
- DrawPicture(two_rect_buffer, layer_rect, two_rect_picture);
- unsigned char two_rect_buffer_check[4 * 100 * 100] = {0};
- DrawPicture(two_rect_buffer_check, layer_rect, two_rect_picture_check);
-
- EXPECT_EQ(two_rect_picture->LayerRect(),
- two_rect_picture_check->LayerRect());
- EXPECT_EQ(0, memcmp(two_rect_buffer, two_rect_buffer_check, 4 * 100 * 100));
- }
+ scoped_refptr<Picture> two_rect_picture =
+ Picture::Create(layer_rect,
+ &content_layer_client,
+ tile_grid_info,
+ false,
+ Picture::RECORD_NORMALLY);
+
+ scoped_ptr<base::Value> serialized_two_rect(two_rect_picture->AsValue());
+
+ // Reconstruct the picture.
+ scoped_refptr<Picture> two_rect_picture_check =
+ Picture::CreateFromValue(serialized_two_rect.get());
+ EXPECT_TRUE(!!two_rect_picture_check.get());
+
+ // Check for equivalence.
+ unsigned char two_rect_buffer[4 * 100 * 100] = {0};
+ DrawPicture(two_rect_buffer, layer_rect, two_rect_picture);
+ unsigned char two_rect_buffer_check[4 * 100 * 100] = {0};
+ DrawPicture(two_rect_buffer_check, layer_rect, two_rect_picture_check);
+
+ EXPECT_EQ(two_rect_picture->LayerRect(), two_rect_picture_check->LayerRect());
+ EXPECT_EQ(0, memcmp(two_rect_buffer, two_rect_buffer_check, 4 * 100 * 100));
}
TEST(PictureTest, PixelRefIterator) {
@@ -479,15 +470,7 @@ TEST(PictureTest, RecordingModes) {
content_layer_client.last_context_status());
EXPECT_TRUE(picture.get());
- picture = Picture::Create(layer_rect,
- &content_layer_client,
- tile_grid_info,
- false,
- Picture::RECORD_WITH_SKRECORD);
- EXPECT_TRUE(content_layer_client.last_canvas() != NULL);
- EXPECT_TRUE(picture.get());
-
- EXPECT_EQ(4, Picture::RECORDING_MODE_COUNT);
+ EXPECT_EQ(3, Picture::RECORDING_MODE_COUNT);
}
} // namespace
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698