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/memory/scoped_vector.h" | 6 #include "base/memory/scoped_vector.h" |
7 #include "mojo/public/cpp/application/application_delegate.h" | 7 #include "mojo/public/cpp/application/application_delegate.h" |
8 #include "mojo/public/cpp/application/application_impl.h" | 8 #include "mojo/public/cpp/application/application_impl.h" |
9 #include "mojo/service_manager/service_manager.h" | 9 #include "mojo/service_manager/service_manager.h" |
10 #include "mojo/services/public/cpp/view_manager/node.h" | 10 #include "mojo/services/public/cpp/view_manager/node.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 base::RunLoop* run_loop, | 262 base::RunLoop* run_loop, |
263 Id old_focused_node_id, | 263 Id old_focused_node_id, |
264 Id new_focused_node_id) { | 264 Id new_focused_node_id) { |
265 DCHECK(old_and_new); | 265 DCHECK(old_and_new); |
266 old_and_new->first = old_focused_node_id; | 266 old_and_new->first = old_focused_node_id; |
267 old_and_new->second = new_focused_node_id; | 267 old_and_new->second = new_focused_node_id; |
268 run_loop->Quit(); | 268 run_loop->Quit(); |
269 } | 269 } |
270 | 270 |
271 shell::ShellTestHelper test_helper_; | 271 shell::ShellTestHelper test_helper_; |
272 base::MessageLoop loop_; | |
273 ViewManagerInitServicePtr view_manager_init_; | 272 ViewManagerInitServicePtr view_manager_init_; |
274 scoped_ptr<TestWindowManagerClient> window_manager_client_; | 273 scoped_ptr<TestWindowManagerClient> window_manager_client_; |
275 TestServiceLoader::RootAddedCallback root_added_callback_; | 274 TestServiceLoader::RootAddedCallback root_added_callback_; |
276 | 275 |
277 DISALLOW_COPY_AND_ASSIGN(WindowManagerApiTest); | 276 DISALLOW_COPY_AND_ASSIGN(WindowManagerApiTest); |
278 }; | 277 }; |
279 | 278 |
280 TEST_F(WindowManagerApiTest, OpenWindow) { | 279 TEST_F(WindowManagerApiTest, OpenWindow) { |
281 OpenWindow(window_manager_.get()); | 280 OpenWindow(window_manager_.get()); |
282 Id created_node = | 281 Id created_node = |
(...skipping 12 matching lines...) Expand all Loading... |
295 | 294 |
296 Id second_window = OpenWindow(window_manager_.get()); | 295 Id second_window = OpenWindow(window_manager_.get()); |
297 window_manager_->ActivateWindow(second_window, | 296 window_manager_->ActivateWindow(second_window, |
298 base::Bind(&EmptyResultCallback)); | 297 base::Bind(&EmptyResultCallback)); |
299 ids = WaitForActiveWindowChange(); | 298 ids = WaitForActiveWindowChange(); |
300 EXPECT_EQ(ids.first, first_window); | 299 EXPECT_EQ(ids.first, first_window); |
301 EXPECT_EQ(ids.second, second_window); | 300 EXPECT_EQ(ids.second, second_window); |
302 } | 301 } |
303 | 302 |
304 } // namespace mojo | 303 } // namespace mojo |
OLD | NEW |