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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 }; | 356 }; |
357 | 357 |
358 void EmbedCallbackImpl(bool result) { | 358 void EmbedCallbackImpl(bool result) { |
359 embed_details_->callback_run = true; | 359 embed_details_->callback_run = true; |
360 embed_details_->embed_result = result; | 360 embed_details_->embed_result = result; |
361 if (embed_details_->waiting && | 361 if (embed_details_->waiting && |
362 (!result || embed_details_->result->window_tree_client)) | 362 (!result || embed_details_->result->window_tree_client)) |
363 EXPECT_TRUE(WindowServerTestBase::QuitRunLoop()); | 363 EXPECT_TRUE(WindowServerTestBase::QuitRunLoop()); |
364 } | 364 } |
365 | 365 |
366 // mojo::test::ServiceTest:: | |
367 std::unique_ptr<base::MessageLoop> CreateMessageLoop() override { | |
368 // The window server is expected to run with a TYPE_UI message loop. | |
369 return base::MakeUnique<base::MessageLoop>(base::MessageLoop::TYPE_UI); | |
370 } | |
371 | |
372 std::unique_ptr<EmbedDetails> embed_details_; | 366 std::unique_ptr<EmbedDetails> embed_details_; |
373 | 367 |
374 std::unique_ptr<ClientAreaChange> client_area_change_; | 368 std::unique_ptr<ClientAreaChange> client_area_change_; |
375 | 369 |
376 DISALLOW_COPY_AND_ASSIGN(WindowServerTest); | 370 DISALLOW_COPY_AND_ASSIGN(WindowServerTest); |
377 }; | 371 }; |
378 | 372 |
379 TEST_F(WindowServerTest, RootWindow) { | 373 TEST_F(WindowServerTest, RootWindow) { |
380 ASSERT_NE(nullptr, window_manager()); | 374 ASSERT_NE(nullptr, window_manager()); |
381 EXPECT_EQ(1u, window_manager()->GetRoots().size()); | 375 EXPECT_EQ(1u, window_manager()->GetRoots().size()); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 ASSERT_EQ(1u, top_level_in_wm->children().size()); | 774 ASSERT_EQ(1u, top_level_in_wm->children().size()); |
781 aura::Window* second_client_child_in_wm = top_level_in_wm->children()[0]; | 775 aura::Window* second_client_child_in_wm = top_level_in_wm->children()[0]; |
782 ASSERT_EQ(1u, second_client_child_in_wm->children().size()); | 776 ASSERT_EQ(1u, second_client_child_in_wm->children().size()); |
783 aura::Window* transient_in_wm = second_client_child_in_wm->children()[0]; | 777 aura::Window* transient_in_wm = second_client_child_in_wm->children()[0]; |
784 ASSERT_EQ(second_client_child_in_wm, | 778 ASSERT_EQ(second_client_child_in_wm, |
785 transient_window_client->GetTransientParent(transient_in_wm)); | 779 transient_window_client->GetTransientParent(transient_in_wm)); |
786 } | 780 } |
787 | 781 |
788 } // namespace ws | 782 } // namespace ws |
789 } // namespace ui | 783 } // namespace ui |
OLD | NEW |