| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/json/json_writer.h" | 5 #include "base/json/json_writer.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/api/storage/settings_backend.h" | 9 #include "chrome/browser/extensions/api/storage/settings_backend.h" |
| 10 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.
h" | 10 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.
h" |
| 11 #include "chrome/browser/value_store/testing_value_store.h" | 11 #include "chrome/browser/value_store/testing_value_store.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 using base::DictionaryValue; |
| 15 using base::ListValue; |
| 16 using base::Value; |
| 17 |
| 14 namespace extensions { | 18 namespace extensions { |
| 15 | 19 |
| 16 // To save typing ValueStore::DEFAULTS/IGNORE_QUOTA everywhere. | 20 // To save typing ValueStore::DEFAULTS/IGNORE_QUOTA everywhere. |
| 17 const ValueStore::WriteOptions DEFAULTS = ValueStore::DEFAULTS; | 21 const ValueStore::WriteOptions DEFAULTS = ValueStore::DEFAULTS; |
| 18 const ValueStore::WriteOptions IGNORE_QUOTA = | 22 const ValueStore::WriteOptions IGNORE_QUOTA = |
| 19 ValueStore::IGNORE_QUOTA; | 23 ValueStore::IGNORE_QUOTA; |
| 20 | 24 |
| 21 class ExtensionSettingsQuotaTest : public testing::Test { | 25 class ExtensionSettingsQuotaTest : public testing::Test { |
| 22 public: | 26 public: |
| 23 ExtensionSettingsQuotaTest() | 27 ExtensionSettingsQuotaTest() |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 589 |
| 586 storage_->Set(DEFAULTS, "c", *byte_value_1_); | 590 storage_->Set(DEFAULTS, "c", *byte_value_1_); |
| 587 | 591 |
| 588 EXPECT_EQ(6u, storage_->GetBytesInUse()); | 592 EXPECT_EQ(6u, storage_->GetBytesInUse()); |
| 589 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); | 593 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); |
| 590 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); | 594 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); |
| 591 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); | 595 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); |
| 592 } | 596 } |
| 593 | 597 |
| 594 } // namespace extensions | 598 } // namespace extensions |
| OLD | NEW |