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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 months 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 // Returns whether the settings in |storage_| and |delegate_| are the same as 63 // Returns whether the settings in |storage_| and |delegate_| are the same as
64 // |settings|. 64 // |settings|.
65 bool SettingsEqual(const base::DictionaryValue& settings) { 65 bool SettingsEqual(const base::DictionaryValue& settings) {
66 return settings.Equals(&storage_->Get()->settings()) && 66 return settings.Equals(&storage_->Get()->settings()) &&
67 settings.Equals(&delegate_->Get()->settings()); 67 settings.Equals(&delegate_->Get()->settings());
68 } 68 }
69 69
70 // Values with different serialized sizes. 70 // Values with different serialized sizes.
71 base::FundamentalValue byte_value_1_; 71 base::Value byte_value_1_;
72 base::StringValue byte_value_16_; 72 base::StringValue byte_value_16_;
73 base::ListValue byte_value_256_; 73 base::ListValue byte_value_256_;
74 74
75 // Quota enforcing storage area being tested. 75 // Quota enforcing storage area being tested.
76 std::unique_ptr<SettingsStorageQuotaEnforcer> storage_; 76 std::unique_ptr<SettingsStorageQuotaEnforcer> storage_;
77 77
78 // In-memory storage area being delegated to. Always owned by |storage_|. 78 // In-memory storage area being delegated to. Always owned by |storage_|.
79 TestingValueStore* delegate_; 79 TestingValueStore* delegate_;
80 }; 80 };
81 81
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 590
591 storage_->Set(DEFAULTS, "c", byte_value_1_); 591 storage_->Set(DEFAULTS, "c", byte_value_1_);
592 592
593 EXPECT_EQ(6u, storage_->GetBytesInUse()); 593 EXPECT_EQ(6u, storage_->GetBytesInUse());
594 EXPECT_EQ(2u, storage_->GetBytesInUse("a")); 594 EXPECT_EQ(2u, storage_->GetBytesInUse("a"));
595 EXPECT_EQ(2u, storage_->GetBytesInUse("b")); 595 EXPECT_EQ(2u, storage_->GetBytesInUse("b"));
596 EXPECT_EQ(4u, storage_->GetBytesInUse(ab)); 596 EXPECT_EQ(4u, storage_->GetBytesInUse(ab));
597 } 597 }
598 598
599 } // namespace extensions 599 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/sockets_tcp/sockets_tcp_api.cc ('k') | extensions/browser/api/storage/storage_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698