| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // ----------------------------------------------------------------------------- | 62 // ----------------------------------------------------------------------------- |
| 63 | 63 |
| 64 bool EmbedUrl(service_manager::Connector* connector, | 64 bool EmbedUrl(service_manager::Connector* connector, |
| 65 WindowTree* tree, | 65 WindowTree* tree, |
| 66 const std::string& url, | 66 const std::string& url, |
| 67 Id root_id) { | 67 Id root_id) { |
| 68 bool result = false; | 68 bool result = false; |
| 69 base::RunLoop run_loop; | 69 base::RunLoop run_loop; |
| 70 { | 70 { |
| 71 mojom::WindowTreeClientPtr client; | 71 mojom::WindowTreeClientPtr client; |
| 72 connector->ConnectToInterface(url, &client); | 72 connector->BindInterface(url, &client); |
| 73 const uint32_t embed_flags = 0; | 73 const uint32_t embed_flags = 0; |
| 74 tree->Embed(root_id, std::move(client), embed_flags, | 74 tree->Embed(root_id, std::move(client), embed_flags, |
| 75 base::Bind(&EmbedCallbackImpl, &run_loop, &result)); | 75 base::Bind(&EmbedCallbackImpl, &run_loop, &result)); |
| 76 } | 76 } |
| 77 run_loop.Run(); | 77 run_loop.Run(); |
| 78 return result; | 78 return result; |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool Embed(WindowTree* tree, Id root_id, mojom::WindowTreeClientPtr client) { | 81 bool Embed(WindowTree* tree, Id root_id, mojom::WindowTreeClientPtr client) { |
| 82 bool result = false; | 82 bool result = false; |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 registry->AddInterface(client_factory_.get()); | 644 registry->AddInterface(client_factory_.get()); |
| 645 return true; | 645 return true; |
| 646 } | 646 } |
| 647 | 647 |
| 648 void SetUp() override { | 648 void SetUp() override { |
| 649 client_factory_ = base::MakeUnique<WindowTreeClientFactory>(); | 649 client_factory_ = base::MakeUnique<WindowTreeClientFactory>(); |
| 650 | 650 |
| 651 WindowServerServiceTestBase::SetUp(); | 651 WindowServerServiceTestBase::SetUp(); |
| 652 | 652 |
| 653 mojom::WindowTreeHostFactoryPtr factory; | 653 mojom::WindowTreeHostFactoryPtr factory; |
| 654 connector()->ConnectToInterface(ui::mojom::kServiceName, &factory); | 654 connector()->BindInterface(ui::mojom::kServiceName, &factory); |
| 655 | 655 |
| 656 mojom::WindowTreeClientPtr tree_client_ptr; | 656 mojom::WindowTreeClientPtr tree_client_ptr; |
| 657 wt_client1_ = base::MakeUnique<TestWindowTreeClient>(); | 657 wt_client1_ = base::MakeUnique<TestWindowTreeClient>(); |
| 658 wt_client1_->Bind(MakeRequest(&tree_client_ptr)); | 658 wt_client1_->Bind(MakeRequest(&tree_client_ptr)); |
| 659 | 659 |
| 660 factory->CreateWindowTreeHost(MakeRequest(&host_), | 660 factory->CreateWindowTreeHost(MakeRequest(&host_), |
| 661 std::move(tree_client_ptr)); | 661 std::move(tree_client_ptr)); |
| 662 | 662 |
| 663 // Next we should get an embed call on the "window manager" client. | 663 // Next we should get an embed call on the "window manager" client. |
| 664 wt_client1_->WaitForOnEmbed(); | 664 wt_client1_->WaitForOnEmbed(); |
| (...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2214 | 2214 |
| 2215 // TODO(sky): make sure coverage of what was | 2215 // TODO(sky): make sure coverage of what was |
| 2216 // WindowManagerTest.SecondEmbedRoot_InitService and | 2216 // WindowManagerTest.SecondEmbedRoot_InitService and |
| 2217 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window | 2217 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window |
| 2218 // manager | 2218 // manager |
| 2219 // tests. | 2219 // tests. |
| 2220 | 2220 |
| 2221 } // namespace test | 2221 } // namespace test |
| 2222 } // namespace ws | 2222 } // namespace ws |
| 2223 } // namespace ui | 2223 } // namespace ui |
| OLD | NEW |