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

Side by Side Diff: chrome/browser/extensions/app_data_migrator_unittest.cc

Issue 1739183003: Make extensions::DictionaryBuilder and extensions::ListValue unmovable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 content::StoragePartition* default_partition_; 68 content::StoragePartition* default_partition_;
69 ExtensionRegistry* registry_; 69 ExtensionRegistry* registry_;
70 storage::FileSystemContext* default_fs_context_; 70 storage::FileSystemContext* default_fs_context_;
71 content::IndexedDBContext* idb_context_; 71 content::IndexedDBContext* idb_context_;
72 scoped_ptr<content::MockBlobURLRequestContext> url_request_context_; 72 scoped_ptr<content::MockBlobURLRequestContext> url_request_context_;
73 }; 73 };
74 74
75 scoped_refptr<const Extension> GetTestExtension(bool platform_app) { 75 scoped_refptr<const Extension> GetTestExtension(bool platform_app) {
76 scoped_refptr<const Extension> app; 76 scoped_refptr<const Extension> app;
77 if (platform_app) { 77 if (platform_app) {
78 app = 78 app = ExtensionBuilder()
79 ExtensionBuilder() 79 .SetManifest(
80 .SetManifest(std::move( 80 DictionaryBuilder()
81 DictionaryBuilder() 81 .Set("name", "test app")
82 .Set("name", "test app") 82 .Set("version", "1")
83 .Set("version", "1") 83 .Set("app", DictionaryBuilder()
84 .Set("app", 84 .Set("background",
85 std::move(DictionaryBuilder().Set( 85 DictionaryBuilder()
86 "background", 86 .Set("scripts",
87 std::move(DictionaryBuilder().Set( 87 ListBuilder()
88 "scripts", std::move(ListBuilder().Append( 88 .Append("background.js")
89 "background.js"))))))) 89 .Build())
90 .Set("permissions", 90 .Build())
91 std::move(ListBuilder().Append("unlimitedStorage"))))) 91 .Build())
92 .Build(); 92 .Set("permissions",
93 ListBuilder().Append("unlimitedStorage").Build())
94 .Build())
95 .Build();
93 } else { 96 } else {
94 app = 97 app = ExtensionBuilder()
95 ExtensionBuilder() 98 .SetManifest(
96 .SetManifest(std::move( 99 DictionaryBuilder()
97 DictionaryBuilder() 100 .Set("name", "test app")
98 .Set("name", "test app") 101 .Set("version", "1")
99 .Set("version", "1") 102 .Set("app", DictionaryBuilder()
100 .Set("app", 103 .Set("launch",
101 std::move(DictionaryBuilder().Set( 104 DictionaryBuilder()
102 "launch", std::move(DictionaryBuilder().Set( 105 .Set("local_path", "index.html")
103 "local_path", "index.html"))))) 106 .Build())
104 .Set("permissions", 107 .Build())
105 std::move(ListBuilder().Append("unlimitedStorage"))))) 108 .Set("permissions",
106 .Build(); 109 ListBuilder().Append("unlimitedStorage").Build())
110 .Build())
111 .Build();
107 } 112 }
108 return app; 113 return app;
109 } 114 }
110 115
111 void MigrationCallback() { 116 void MigrationCallback() {
112 } 117 }
113 118
114 void DidWrite(base::File::Error status, int64_t bytes, bool complete) { 119 void DidWrite(base::File::Error status, int64_t bytes, bool complete) {
115 base::MessageLoop::current()->QuitWhenIdle(); 120 base::MessageLoop::current()->QuitWhenIdle();
116 } 121 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 content::StoragePartition* new_partition = 275 content::StoragePartition* new_partition =
271 content::BrowserContext::GetStoragePartitionForSite(profile_.get(), 276 content::BrowserContext::GetStoragePartitionForSite(profile_.get(),
272 extension_url); 277 extension_url);
273 278
274 ASSERT_NE(new_partition->GetPath(), default_partition_->GetPath()); 279 ASSERT_NE(new_partition->GetPath(), default_partition_->GetPath());
275 280
276 VerifyTestFilesMigrated(new_partition, new_ext.get()); 281 VerifyTestFilesMigrated(new_partition, new_ext.get());
277 } 282 }
278 283
279 } // namespace extensions 284 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698