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 "mojo/shell/capability_filter_test.h" | 5 #include "mojo/shell/capability_filter_test.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 public: | 113 public: |
114 ServiceApplication() : shell_(nullptr) {} | 114 ServiceApplication() : shell_(nullptr) {} |
115 ~ServiceApplication() override {} | 115 ~ServiceApplication() override {} |
116 | 116 |
117 private: | 117 private: |
118 // Overridden from ShellClient: | 118 // Overridden from ShellClient: |
119 void Initialize(Shell* shell, const std::string& url, uint32_t id) override { | 119 void Initialize(Shell* shell, const std::string& url, uint32_t id) override { |
120 shell_ = shell; | 120 shell_ = shell; |
121 // ServiceApplications have no capability filter and can thus connect | 121 // ServiceApplications have no capability filter and can thus connect |
122 // directly to the validator application. | 122 // directly to the validator application. |
123 shell_->ConnectToService("test:validator", &validator_); | 123 shell_->ConnectToInterface("test:validator", &validator_); |
124 } | 124 } |
125 bool AcceptConnection(Connection* connection) override { | 125 bool AcceptConnection(Connection* connection) override { |
126 AddInterface<Safe>(connection); | 126 AddInterface<Safe>(connection); |
127 AddInterface<Unsafe>(connection); | 127 AddInterface<Unsafe>(connection); |
128 return true; | 128 return true; |
129 } | 129 } |
130 | 130 |
131 // Overridden from InterfaceFactory<Safe>: | 131 // Overridden from InterfaceFactory<Safe>: |
132 void Create(Connection* connection, | 132 void Create(Connection* connection, |
133 InterfaceRequest<Safe> request) override { | 133 InterfaceRequest<Safe> request) override { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 void CapabilityFilterTest::RunTest() { | 344 void CapabilityFilterTest::RunTest() { |
345 loop()->Run(); | 345 loop()->Run(); |
346 EXPECT_TRUE(validator_->expectations_met()); | 346 EXPECT_TRUE(validator_->expectations_met()); |
347 if (!validator_->expectations_met()) | 347 if (!validator_->expectations_met()) |
348 validator_->PrintUnmetExpectations(); | 348 validator_->PrintUnmetExpectations(); |
349 } | 349 } |
350 | 350 |
351 } // namespace test | 351 } // namespace test |
352 } // namespace shell | 352 } // namespace shell |
353 } // namespace mojo | 353 } // namespace mojo |
OLD | NEW |