Chromium Code Reviews| 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" | |
| 10 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer. h" | 9 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer. h" |
| 11 #include "chrome/browser/value_store/testing_value_store.h" | 10 #include "chrome/browser/value_store/testing_value_store.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 12 |
| 14 using base::DictionaryValue; | 13 using base::DictionaryValue; |
| 15 using base::ListValue; | 14 using base::ListValue; |
| 16 using base::Value; | 15 using base::Value; |
| 17 | 16 |
| 18 namespace extensions { | 17 namespace extensions { |
| 19 | 18 |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 585 EXPECT_EQ(4u, storage_->GetBytesInUse()); | 584 EXPECT_EQ(4u, storage_->GetBytesInUse()); |
| 586 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); | 585 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); |
| 587 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); | 586 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); |
| 588 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); | 587 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); |
| 589 | 588 |
| 590 storage_->Set(DEFAULTS, "c", *byte_value_1_); | 589 storage_->Set(DEFAULTS, "c", *byte_value_1_); |
| 591 | 590 |
| 592 EXPECT_EQ(6u, storage_->GetBytesInUse()); | 591 EXPECT_EQ(6u, storage_->GetBytesInUse()); |
| 593 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); | 592 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); |
| 594 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); | 593 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); |
| 595 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); | 594 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); |
|
not at google - send to devlin
2014/02/19 21:25:29
Another thing to do in a follow-up is write tests
Devlin
2014/02/19 23:12:28
Adding to the wishlist...oh, you already did. :)
| |
| 596 } | 595 } |
| 597 | 596 |
| 598 } // namespace extensions | 597 } // namespace extensions |
| OLD | NEW |