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

Side by Side Diff: services/shell/background/tests/test_catalog_store.cc

Issue 1882423004: Move shell service to toplevel shell namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/shell/background/tests/test_catalog_store.h" 5 #include "services/shell/background/tests/test_catalog_store.h"
6 6
7 using catalog::Store; 7 using catalog::Store;
8 8
9 namespace mojo {
10 namespace shell { 9 namespace shell {
11 10
12 TestCatalogStore::TestCatalogStore(scoped_ptr<base::ListValue> store) 11 TestCatalogStore::TestCatalogStore(std::unique_ptr<base::ListValue> store)
13 : store_(std::move(store)) {} 12 : store_(std::move(store)) {}
14 13
15 TestCatalogStore::~TestCatalogStore() {} 14 TestCatalogStore::~TestCatalogStore() {}
16 15
17 const base::ListValue* TestCatalogStore::GetStore() { 16 const base::ListValue* TestCatalogStore::GetStore() {
18 get_store_called_ = true; 17 get_store_called_ = true;
19 return store_.get(); 18 return store_.get();
20 } 19 }
21 20
22 void TestCatalogStore::UpdateStore( 21 void TestCatalogStore::UpdateStore(std::unique_ptr<base::ListValue> store) {}
23 scoped_ptr<base::ListValue> store) {}
24 22
25 scoped_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( 23 std::unique_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo(
26 const std::string& name, 24 const std::string& name,
27 const std::string& display_name) { 25 const std::string& display_name) {
28 scoped_ptr<base::DictionaryValue> app(new base::DictionaryValue); 26 std::unique_ptr<base::DictionaryValue> app(new base::DictionaryValue);
29 app->SetString(Store::kNameKey, name); 27 app->SetString(Store::kNameKey, name);
30 app->SetString(Store::kDisplayNameKey, display_name); 28 app->SetString(Store::kDisplayNameKey, display_name);
31 app->SetInteger(Store::kManifestVersionKey, 1); 29 app->SetInteger(Store::kManifestVersionKey, 1);
32 30
33 scoped_ptr<base::DictionaryValue> capabilities(new base::DictionaryValue); 31 std::unique_ptr<base::DictionaryValue> capabilities(
34 scoped_ptr<base::DictionaryValue> required_capabilities(
35 new base::DictionaryValue); 32 new base::DictionaryValue);
36 scoped_ptr<base::DictionaryValue> interfaces_dictionary( 33 std::unique_ptr<base::DictionaryValue> required_capabilities(
37 new base::DictionaryValue); 34 new base::DictionaryValue);
38 scoped_ptr<base::ListValue> interfaces_list(new base::ListValue); 35 std::unique_ptr<base::DictionaryValue> interfaces_dictionary(
36 new base::DictionaryValue);
37 std::unique_ptr<base::ListValue> interfaces_list(new base::ListValue);
39 interfaces_list->AppendString("*"); 38 interfaces_list->AppendString("*");
40 interfaces_dictionary->Set("interfaces", std::move(interfaces_list)); 39 interfaces_dictionary->Set("interfaces", std::move(interfaces_list));
41 required_capabilities->Set("*", std::move(interfaces_dictionary)); 40 required_capabilities->Set("*", std::move(interfaces_dictionary));
42 capabilities->Set(Store::kCapabilities_RequiredKey, 41 capabilities->Set(Store::kCapabilities_RequiredKey,
43 std::move(required_capabilities)); 42 std::move(required_capabilities));
44 app->Set(Store::kCapabilitiesKey, std::move(capabilities)); 43 app->Set(Store::kCapabilitiesKey, std::move(capabilities));
45 return app; 44 return app;
46 } 45 }
47 46
48 } // namespace shell 47 } // namespace shell
49 } // namespace mojo
OLDNEW
« no previous file with comments | « services/shell/background/tests/test_catalog_store.h ('k') | services/shell/background/tests/test_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698