| Index: components/enhanced_bookmarks/image_store_unittest.cc
|
| diff --git a/components/enhanced_bookmarks/image_store_unittest.cc b/components/enhanced_bookmarks/image_store_unittest.cc
|
| index 778c1e3e69886dc4e06415d3e87fcec5cea41128..7c78e9a09c7af7f37d26c771a348d85a25392db1 100644
|
| --- a/components/enhanced_bookmarks/image_store_unittest.cc
|
| +++ b/components/enhanced_bookmarks/image_store_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "components/enhanced_bookmarks/image_store.h"
|
|
|
| #include "base/files/scoped_temp_dir.h"
|
| +#include "base/strings/string_number_conversions.h"
|
| #include "components/enhanced_bookmarks/image_store_util.h"
|
| #include "components/enhanced_bookmarks/persistent_image_store.h"
|
| #include "components/enhanced_bookmarks/test_image_store.h"
|
| @@ -218,4 +219,27 @@ TYPED_TEST(ImageStoreUnitTest, Persistence) {
|
| }
|
| }
|
|
|
| +TYPED_TEST(ImageStoreUnitTest, GetSize) {
|
| + gfx::Image src_image = GenerateBlackImage();
|
| + const GURL url("foo://bar");
|
| + const GURL image_url("a.jpg");
|
| +
|
| + int64 size = 0;
|
| + EXPECT_LE(this->store_->GetStoreSize(), 4096);
|
| + for (int i = 0; i < 100; ++i) {
|
| + this->store_->Insert(
|
| + GURL(url.spec() + '/' + base::IntToString(i)), image_url, src_image);
|
| + EXPECT_GE(this->store_->GetStoreSize(), size);
|
| + size = this->store_->GetStoreSize();
|
| + }
|
| +
|
| + if (this->use_persistent_store()) {
|
| + EXPECT_GE(this->store_->GetStoreSize(), 100 * 1024); // 100kb
|
| + EXPECT_LE(this->store_->GetStoreSize(), 200 * 1024); // 200kb
|
| + } else {
|
| + EXPECT_GE(this->store_->GetStoreSize(), 400 * 1024); // 400kb
|
| + EXPECT_LE(this->store_->GetStoreSize(), 500 * 1024); // 500kb
|
| + }
|
| +}
|
| +
|
| } // namespace
|
|
|