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

Side by Side Diff: extensions/browser/api/storage/settings_quota_unittest.cc

Issue 685503002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/storage/settings_storage_quota_enforcer.h" 9 #include "extensions/browser/api/storage/settings_storage_quota_enforcer.h"
10 #include "extensions/browser/value_store/testing_value_store.h" 10 #include "extensions/browser/value_store/testing_value_store.h"
(...skipping 26 matching lines...) Expand all
37 void ValidateByteValues() { 37 void ValidateByteValues() {
38 std::string validate_sizes; 38 std::string validate_sizes;
39 base::JSONWriter::Write(byte_value_1_.get(), &validate_sizes); 39 base::JSONWriter::Write(byte_value_1_.get(), &validate_sizes);
40 ASSERT_EQ(1u, validate_sizes.size()); 40 ASSERT_EQ(1u, validate_sizes.size());
41 base::JSONWriter::Write(byte_value_16_.get(), &validate_sizes); 41 base::JSONWriter::Write(byte_value_16_.get(), &validate_sizes);
42 ASSERT_EQ(16u, validate_sizes.size()); 42 ASSERT_EQ(16u, validate_sizes.size());
43 base::JSONWriter::Write(byte_value_256_.get(), &validate_sizes); 43 base::JSONWriter::Write(byte_value_256_.get(), &validate_sizes);
44 ASSERT_EQ(256u, validate_sizes.size()); 44 ASSERT_EQ(256u, validate_sizes.size());
45 } 45 }
46 46
47 virtual void TearDown() override { 47 void TearDown() override { ASSERT_TRUE(storage_.get() != NULL); }
48 ASSERT_TRUE(storage_.get() != NULL);
49 }
50 48
51 protected: 49 protected:
52 // Creates |storage_|. Must only be called once. 50 // Creates |storage_|. Must only be called once.
53 void CreateStorage( 51 void CreateStorage(
54 size_t quota_bytes, size_t quota_bytes_per_item, size_t max_items) { 52 size_t quota_bytes, size_t quota_bytes_per_item, size_t max_items) {
55 ASSERT_TRUE(storage_.get() == NULL); 53 ASSERT_TRUE(storage_.get() == NULL);
56 SettingsStorageQuotaEnforcer::Limits limits = 54 SettingsStorageQuotaEnforcer::Limits limits =
57 { quota_bytes, quota_bytes_per_item, max_items }; 55 { quota_bytes, quota_bytes_per_item, max_items };
58 storage_.reset(new SettingsStorageQuotaEnforcer(limits, delegate_)); 56 storage_.reset(new SettingsStorageQuotaEnforcer(limits, delegate_));
59 } 57 }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 586
589 storage_->Set(DEFAULTS, "c", *byte_value_1_); 587 storage_->Set(DEFAULTS, "c", *byte_value_1_);
590 588
591 EXPECT_EQ(6u, storage_->GetBytesInUse()); 589 EXPECT_EQ(6u, storage_->GetBytesInUse());
592 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); 590 EXPECT_EQ(2u, storage_->GetBytesInUse("a"));
593 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); 591 EXPECT_EQ(2u, storage_->GetBytesInUse("b"));
594 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); 592 EXPECT_EQ(4u, storage_->GetBytesInUse(ab));
595 } 593 }
596 594
597 } // namespace extensions 595 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_tcp/sockets_tcp_api_unittest.cc ('k') | extensions/browser/api/storage/storage_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698