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

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

Issue 2664753002: Remove base::StringValue (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 "extensions/browser/api/storage/settings_test_util.h" 5 #include "extensions/browser/api/storage/settings_test_util.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "extensions/browser/api/storage/storage_frontend.h" 9 #include "extensions/browser/api/storage/storage_frontend.h"
10 #include "extensions/browser/extension_registry.h" 10 #include "extensions/browser/extension_registry.h"
11 #include "extensions/browser/extension_system_provider.h" 11 #include "extensions/browser/extension_system_provider.h"
12 #include "extensions/browser/extensions_browser_client.h" 12 #include "extensions/browser/extensions_browser_client.h"
13 #include "extensions/common/extension.h" 13 #include "extensions/common/extension.h"
14 #include "extensions/common/permissions/permissions_data.h" 14 #include "extensions/common/permissions/permissions_data.h"
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 namespace settings_test_util { 18 namespace settings_test_util {
19 19
20 // Creates a kilobyte of data. 20 // Creates a kilobyte of data.
21 std::unique_ptr<base::Value> CreateKilobyte() { 21 std::unique_ptr<base::Value> CreateKilobyte() {
22 std::string kilobyte_string; 22 std::string kilobyte_string;
23 for (int i = 0; i < 1024; ++i) { 23 for (int i = 0; i < 1024; ++i) {
24 kilobyte_string += "a"; 24 kilobyte_string += "a";
25 } 25 }
26 return std::unique_ptr<base::Value>(new base::StringValue(kilobyte_string)); 26 return std::unique_ptr<base::Value>(new base::Value(kilobyte_string));
27 } 27 }
28 28
29 // Creates a megabyte of data. 29 // Creates a megabyte of data.
30 std::unique_ptr<base::Value> CreateMegabyte() { 30 std::unique_ptr<base::Value> CreateMegabyte() {
31 base::ListValue* megabyte = new base::ListValue(); 31 base::ListValue* megabyte = new base::ListValue();
32 for (int i = 0; i < 1000; ++i) { 32 for (int i = 0; i < 1000; ++i) {
33 megabyte->Append(CreateKilobyte()); 33 megabyte->Append(CreateKilobyte());
34 } 34 }
35 return std::unique_ptr<base::Value>(megabyte); 35 return std::unique_ptr<base::Value>(megabyte);
36 } 36 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 it != permissions_set.end(); ++it) { 115 it != permissions_set.end(); ++it) {
116 DCHECK(extension->permissions_data()->HasAPIPermission(*it)); 116 DCHECK(extension->permissions_data()->HasAPIPermission(*it));
117 } 117 }
118 118
119 return extension; 119 return extension;
120 } 120 }
121 121
122 } // namespace settings_test_util 122 } // namespace settings_test_util
123 123
124 } // namespace extensions 124 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/settings_quota_unittest.cc ('k') | extensions/browser/api/storage/storage_frontend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698