OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 EXTENSIONS_COMMON_PERMISSIONS_MOCK_MANIFEST_PERMISSION_H_ |
| 6 #define EXTENSIONS_COMMON_PERMISSIONS_MOCK_MANIFEST_PERMISSION_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/macros.h" |
| 12 #include "extensions/common/permissions/manifest_permission.h" |
| 13 |
| 14 namespace base { |
| 15 class Value; |
| 16 } |
| 17 |
| 18 namespace extensions { |
| 19 |
| 20 // Useful for mocking ManifestPermission in tests. |
| 21 class MockManifestPermission : public ManifestPermission { |
| 22 public: |
| 23 explicit MockManifestPermission(const std::string& name); |
| 24 |
| 25 std::string name() const override; |
| 26 std::string id() const override; |
| 27 |
| 28 PermissionIDSet GetPermissions() const override; |
| 29 |
| 30 bool FromValue(const base::Value* value) override; |
| 31 std::unique_ptr<base::Value> ToValue() const override; |
| 32 |
| 33 ManifestPermission* Diff(const ManifestPermission* rhs) const override; |
| 34 ManifestPermission* Union(const ManifestPermission* rhs) const override; |
| 35 ManifestPermission* Intersect(const ManifestPermission* rhs) const override; |
| 36 |
| 37 private: |
| 38 std::string name_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(MockManifestPermission); |
| 41 }; |
| 42 |
| 43 } // namespace extensions |
| 44 |
| 45 #endif // EXTENSIONS_COMMON_PERMISSIONS_MOCK_MANIFEST_PERMISSION_H_ |
OLD | NEW |