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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 int id; | 82 int id; |
83 std::string url; | 83 std::string url; |
84 base::ProcessId pid; | 84 base::ProcessId pid; |
85 }; | 85 }; |
86 | 86 |
87 void AddListenerAndWaitForApplications() { | 87 void AddListenerAndWaitForApplications() { |
88 mojom::ApplicationManagerPtr application_manager; | 88 mojom::ApplicationManagerPtr application_manager; |
89 application_impl()->ConnectToService("mojo:shell", &application_manager); | 89 application_impl()->ConnectToService("mojo:shell", &application_manager); |
90 | 90 |
91 mojom::ApplicationManagerListenerPtr listener; | 91 application_manager->AddListener(binding_.CreateInterfacePtrAndBind()); |
92 InterfaceRequest<mojom::ApplicationManagerListener> request = | |
93 GetProxy(&listener); | |
94 application_manager->AddListener(std::move(listener)); | |
95 binding_.Bind(std::move(request)); | |
96 binding_.WaitForIncomingMethodCall(); | 92 binding_.WaitForIncomingMethodCall(); |
97 } | 93 } |
98 | 94 |
99 const std::string& data() const { | 95 const std::string& data() const { |
100 DCHECK(delegate_); | 96 DCHECK(delegate_); |
101 return delegate_->data(); | 97 return delegate_->data(); |
102 } | 98 } |
103 | 99 |
104 const std::vector<ApplicationInfo>& applications() const { | 100 const std::vector<ApplicationInfo>& applications() const { |
105 return applications_; | 101 return applications_; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 175 |
180 driver.set_connection_error_handler( | 176 driver.set_connection_error_handler( |
181 base::Bind(&ApplicationManagerAppTest::OnDriverQuit, | 177 base::Bind(&ApplicationManagerAppTest::OnDriverQuit, |
182 base::Unretained(this))); | 178 base::Unretained(this))); |
183 driver->QuitDriver(); | 179 driver->QuitDriver(); |
184 base::MessageLoop::current()->Run(); | 180 base::MessageLoop::current()->Run(); |
185 } | 181 } |
186 | 182 |
187 } // namespace shell | 183 } // namespace shell |
188 } // namespace mojo | 184 } // namespace mojo |
OLD | NEW |