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