| Index: components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
|
| diff --git a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
|
| index db2c54f023f73a82efc0a0cbbd7379c9eb118f62..f760d0cfd425e5afff891294cd61f18052cd4bb2 100644
|
| --- a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
|
| +++ b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
|
| @@ -25,6 +25,7 @@ using enhanced_bookmarks::EnhancedBookmarkModel;
|
|
|
| namespace {
|
| const std::string BOOKMARK_URL("http://example.com/index.html");
|
| +const std::string IMAGE_URL("http://example.com/image.jpg");
|
| } // namespace
|
|
|
| class EnhancedBookmarkModelTest
|
| @@ -773,3 +774,24 @@ TEST_F(EnhancedBookmarkModelTest, AddsRemoteIdToNonClonedKeys) {
|
| bookmark_model_->non_cloned_keys();
|
| EXPECT_TRUE(non_cloned_keys.find("stars.id") != non_cloned_keys.end());
|
| }
|
| +
|
| +TEST_F(EnhancedBookmarkModelTest, RemoveImageData) {
|
| + const BookmarkNode* node = AddBookmark();
|
| + model_->SetAllImages(node, GURL(IMAGE_URL), 64, 64, GURL(IMAGE_URL), 16, 16);
|
| +
|
| + GURL url;
|
| + int width, height;
|
| + EXPECT_TRUE(model_->GetOriginalImage(node, &url, &width, &height));
|
| + EXPECT_TRUE(model_->GetThumbnailImage(node, &url, &width, &height));
|
| +
|
| + model_->RemoveImageData(node);
|
| + EXPECT_FALSE(model_->GetOriginalImage(node, &url, &width, &height));
|
| + EXPECT_FALSE(model_->GetThumbnailImage(node, &url, &width, &height));
|
| +
|
| + std::string meta_info = GetMetaInfoField(node, "stars.imageData");
|
| + std::string decoded;
|
| + ASSERT_TRUE(base::Base64Decode(meta_info, &decoded));
|
| + image::collections::ImageData data;
|
| + ASSERT_TRUE(data.ParseFromString(decoded));
|
| + EXPECT_TRUE(data.user_removed_image());
|
| +}
|
|
|