| 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 #ifndef SERVICES_SERVICE_MANAGER_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ |
| 6 #define SERVICES_SERVICE_MANAGER_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ | 6 #define SERVICES_SERVICE_MANAGER_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "services/catalog/store.h" | 12 #include "services/catalog/store.h" |
| 13 | 13 |
| 14 namespace shell { | 14 namespace service_manager { |
| 15 | 15 |
| 16 // ApplicationCatalogStore implementation that takes the ListValue to return | 16 // ApplicationCatalogStore implementation that takes the ListValue to return |
| 17 // as store. | 17 // as store. |
| 18 class TestCatalogStore : public catalog::Store { | 18 class TestCatalogStore : public catalog::Store { |
| 19 public: | 19 public: |
| 20 explicit TestCatalogStore(std::unique_ptr<base::ListValue> store); | 20 explicit TestCatalogStore(std::unique_ptr<base::ListValue> store); |
| 21 ~TestCatalogStore() override; | 21 ~TestCatalogStore() override; |
| 22 | 22 |
| 23 bool get_store_called() const { return get_store_called_; } | 23 bool get_store_called() const { return get_store_called_; } |
| 24 | 24 |
| 25 // ApplicationCatalogStore: | 25 // ApplicationCatalogStore: |
| 26 const base::ListValue* GetStore() override; | 26 const base::ListValue* GetStore() override; |
| 27 void UpdateStore(std::unique_ptr<base::ListValue> store) override; | 27 void UpdateStore(std::unique_ptr<base::ListValue> store) override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 bool get_store_called_ = false; | 30 bool get_store_called_ = false; |
| 31 std::unique_ptr<base::ListValue> store_; | 31 std::unique_ptr<base::ListValue> store_; |
| 32 | 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(TestCatalogStore); | 33 DISALLOW_COPY_AND_ASSIGN(TestCatalogStore); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Returns a dictionary for an app with the specified name, display name and a | 36 // Returns a dictionary for an app with the specified name, display name and a |
| 37 // permissive filter. | 37 // permissive filter. |
| 38 std::unique_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( | 38 std::unique_ptr<base::DictionaryValue> BuildPermissiveSerializedAppInfo( |
| 39 const std::string& name, | 39 const std::string& name, |
| 40 const std::string& display_name); | 40 const std::string& display_name); |
| 41 | 41 |
| 42 } // namespace shell | 42 } // namespace service_manager |
| 43 | 43 |
| 44 #endif // SERVICES_SERVICE_MANAGER_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ | 44 #endif // SERVICES_SERVICE_MANAGER_BACKGROUND_TESTS_TEST_CATALOG_STORE_H_ |
| OLD | NEW |