| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
| 10 #include "mojo/public/cpp/application/application_test_base.h" | 10 #include "mojo/public/cpp/application/application_test_base.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 private: | 206 private: |
| 207 // Used when running a nested MessageLoop. | 207 // Used when running a nested MessageLoop. |
| 208 struct WaitState { | 208 struct WaitState { |
| 209 WaitState() : change_count(0) {} | 209 WaitState() : change_count(0) {} |
| 210 | 210 |
| 211 // Number of changes waiting for. | 211 // Number of changes waiting for. |
| 212 size_t change_count; | 212 size_t change_count; |
| 213 base::RunLoop run_loop; | 213 base::RunLoop run_loop; |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 // InterfaceImpl: | |
| 217 void OnConnectionEstablished() override {} | |
| 218 | |
| 219 // TestChangeTracker::Delegate: | 216 // TestChangeTracker::Delegate: |
| 220 void OnChangeAdded() override { | 217 void OnChangeAdded() override { |
| 221 if (wait_state_.get() && | 218 if (wait_state_.get() && |
| 222 wait_state_->change_count == tracker_.changes()->size()) { | 219 wait_state_->change_count == tracker_.changes()->size()) { |
| 223 wait_state_->run_loop.Quit(); | 220 wait_state_->run_loop.Quit(); |
| 224 } | 221 } |
| 225 } | 222 } |
| 226 | 223 |
| 227 // ViewManagerClient: | 224 // ViewManagerClient: |
| 228 void OnEmbed(ConnectionSpecificId connection_id, | 225 void OnEmbed(ConnectionSpecificId connection_id, |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 // that SetBounsdViews/AddView and the like don't result in messages to the | 1294 // that SetBounsdViews/AddView and the like don't result in messages to the |
| 1298 // originating connection. | 1295 // originating connection. |
| 1299 | 1296 |
| 1300 // TODO(sky): make sure coverage of what was | 1297 // TODO(sky): make sure coverage of what was |
| 1301 // ViewManagerTest.SecondEmbedRoot_InitService and | 1298 // ViewManagerTest.SecondEmbedRoot_InitService and |
| 1302 // ViewManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window manager | 1299 // ViewManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window manager |
| 1303 // tests. | 1300 // tests. |
| 1304 | 1301 |
| 1305 } // namespace service | 1302 } // namespace service |
| 1306 } // namespace mojo | 1303 } // namespace mojo |
| OLD | NEW |