OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "mojo/shell/capability_filter_test.h" | 6 #include "mojo/shell/capability_filter_test.h" |
7 #include "mojo/shell/test_package_manager.h" | |
8 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
9 | 8 |
10 namespace mojo { | 9 namespace mojo { |
11 namespace shell { | 10 namespace shell { |
12 namespace test { | 11 namespace test { |
13 | 12 |
14 class CapabilityFilterApplicationTest : public CapabilityFilterTest { | 13 class CapabilityFilterApplicationTest : public CapabilityFilterTest { |
15 public: | 14 public: |
16 CapabilityFilterApplicationTest() {} | 15 CapabilityFilterApplicationTest() {} |
17 ~CapabilityFilterApplicationTest() override {} | 16 ~CapabilityFilterApplicationTest() override {} |
18 | 17 |
19 private: | 18 private: |
20 // Overridden from CapabilityFilterTest: | |
21 PackageManager* CreatePackageManager() override { | |
22 return new TestPackageManager; | |
23 } | |
24 | |
25 DISALLOW_COPY_AND_ASSIGN(CapabilityFilterApplicationTest); | 19 DISALLOW_COPY_AND_ASSIGN(CapabilityFilterApplicationTest); |
26 }; | 20 }; |
27 | 21 |
28 TEST_F(CapabilityFilterApplicationTest, Blocking) { | 22 TEST_F(CapabilityFilterApplicationTest, Blocking) { |
29 CreateLoader<TestApplication>("test:trusted"); | 23 CreateLoader<TestApplication>("test:trusted"); |
30 CreateLoader<TestApplication>("test:untrusted"); | 24 CreateLoader<TestApplication>("test:untrusted"); |
31 RunBlockingTest(); | 25 RunBlockingTest(); |
32 } | 26 } |
33 | 27 |
34 TEST_F(CapabilityFilterApplicationTest, Wildcards) { | 28 TEST_F(CapabilityFilterApplicationTest, Wildcards) { |
35 CreateLoader<TestApplication>("test:wildcard"); | 29 CreateLoader<TestApplication>("test:wildcard"); |
36 CreateLoader<TestApplication>("test:blocked"); | 30 CreateLoader<TestApplication>("test:blocked"); |
37 CreateLoader<TestApplication>("test:wildcard2"); | 31 CreateLoader<TestApplication>("test:wildcard2"); |
38 CreateLoader<TestApplication>("test:wildcard3"); | 32 CreateLoader<TestApplication>("test:wildcard3"); |
39 RunWildcardTest(); | 33 RunWildcardTest(); |
40 } | 34 } |
41 | 35 |
42 } // namespace test | 36 } // namespace test |
43 } // namespace shell | 37 } // namespace shell |
44 } // namespace mojo | 38 } // namespace mojo |
OLD | NEW |