OLD | NEW |
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 "mojo/shell/background/tests/test_application_catalog_store.h" | 5 #include "mojo/shell/background/tests/test_application_catalog_store.h" |
6 | 6 |
7 #include "url/gurl.h" | |
8 | |
9 using package_manager::ApplicationCatalogStore; | 7 using package_manager::ApplicationCatalogStore; |
10 | 8 |
11 namespace mojo { | 9 namespace mojo { |
12 namespace shell { | 10 namespace shell { |
13 | 11 |
14 TestApplicationCatalogStore::TestApplicationCatalogStore( | 12 TestApplicationCatalogStore::TestApplicationCatalogStore( |
15 scoped_ptr<base::ListValue> store) | 13 scoped_ptr<base::ListValue> store) |
16 : store_(std::move(store)) {} | 14 : store_(std::move(store)) {} |
17 | 15 |
18 TestApplicationCatalogStore::~TestApplicationCatalogStore() {} | 16 TestApplicationCatalogStore::~TestApplicationCatalogStore() {} |
19 | 17 |
20 const base::ListValue* TestApplicationCatalogStore::GetStore() { | 18 const base::ListValue* TestApplicationCatalogStore::GetStore() { |
21 get_store_called_ = true; | 19 get_store_called_ = true; |
22 return store_.get(); | 20 return store_.get(); |
23 } | 21 } |
24 | 22 |
25 void TestApplicationCatalogStore::UpdateStore( | 23 void TestApplicationCatalogStore::UpdateStore( |
26 scoped_ptr<base::ListValue> store) {} | 24 scoped_ptr<base::ListValue> store) {} |
27 | 25 |
28 scoped_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( | 26 scoped_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( |
29 const GURL& url, | 27 const std::string& name, |
30 const std::string& name) { | 28 const std::string& display_name) { |
31 scoped_ptr<base::DictionaryValue> app(new base::DictionaryValue); | 29 scoped_ptr<base::DictionaryValue> app(new base::DictionaryValue); |
32 app->SetString(ApplicationCatalogStore::kUrlKey, url.spec()); | |
33 app->SetString(ApplicationCatalogStore::kNameKey, name); | 30 app->SetString(ApplicationCatalogStore::kNameKey, name); |
| 31 app->SetString(ApplicationCatalogStore::kDisplayNameKey, display_name); |
34 | 32 |
35 scoped_ptr<base::DictionaryValue> capabilities(new base::DictionaryValue); | 33 scoped_ptr<base::DictionaryValue> capabilities(new base::DictionaryValue); |
36 scoped_ptr<base::ListValue> interfaces(new base::ListValue); | 34 scoped_ptr<base::ListValue> interfaces(new base::ListValue); |
37 interfaces->AppendString("*"); | 35 interfaces->AppendString("*"); |
38 capabilities->Set("*", std::move(interfaces)); | 36 capabilities->Set("*", std::move(interfaces)); |
39 | 37 |
40 app->Set(ApplicationCatalogStore::kCapabilitiesKey, std::move(capabilities)); | 38 app->Set(ApplicationCatalogStore::kCapabilitiesKey, std::move(capabilities)); |
41 | 39 |
42 return app; | 40 return app; |
43 } | 41 } |
44 | 42 |
45 } // namespace shell | 43 } // namespace shell |
46 } // namespace mojo | 44 } // namespace mojo |
OLD | NEW |