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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // ----------------------------------------------------------------------------- | 64 // ----------------------------------------------------------------------------- |
65 | 65 |
66 bool EmbedUrl(mojo::Shell* shell, | 66 bool EmbedUrl(mojo::Shell* shell, |
67 WindowTree* ws, | 67 WindowTree* ws, |
68 const String& url, | 68 const String& url, |
69 Id root_id) { | 69 Id root_id) { |
70 bool result = false; | 70 bool result = false; |
71 base::RunLoop run_loop; | 71 base::RunLoop run_loop; |
72 { | 72 { |
73 mojom::WindowTreeClientPtr client; | 73 mojom::WindowTreeClientPtr client; |
74 shell->ConnectToService(url.get(), &client); | 74 shell->ConnectToInterface(url.get(), &client); |
75 ws->Embed(root_id, std::move(client), | 75 ws->Embed(root_id, std::move(client), |
76 mojom::WindowTree::kAccessPolicyDefault, | 76 mojom::WindowTree::kAccessPolicyDefault, |
77 base::Bind(&EmbedCallbackImpl, &run_loop, &result)); | 77 base::Bind(&EmbedCallbackImpl, &run_loop, &result)); |
78 } | 78 } |
79 run_loop.Run(); | 79 run_loop.Run(); |
80 return result; | 80 return result; |
81 } | 81 } |
82 | 82 |
83 bool Embed(WindowTree* ws, Id root_id, mojom::WindowTreeClientPtr client) { | 83 bool Embed(WindowTree* ws, Id root_id, mojom::WindowTreeClientPtr client) { |
84 bool result = false; | 84 bool result = false; |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 return client; | 559 return client; |
560 } | 560 } |
561 | 561 |
562 // ApplicationTestBase: | 562 // ApplicationTestBase: |
563 mojo::ShellClient* GetShellClient() override { return this; } | 563 mojo::ShellClient* GetShellClient() override { return this; } |
564 void SetUp() override { | 564 void SetUp() override { |
565 ApplicationTestBase::SetUp(); | 565 ApplicationTestBase::SetUp(); |
566 client_factory_.reset(new WindowTreeClientFactory()); | 566 client_factory_.reset(new WindowTreeClientFactory()); |
567 | 567 |
568 mojom::WindowTreeHostFactoryPtr factory; | 568 mojom::WindowTreeHostFactoryPtr factory; |
569 shell()->ConnectToService("mojo:mus", &factory); | 569 shell()->ConnectToInterface("mojo:mus", &factory); |
570 | 570 |
571 mojom::WindowTreeClientPtr tree_client_ptr; | 571 mojom::WindowTreeClientPtr tree_client_ptr; |
572 ws_client1_.reset(new TestWindowTreeClientImpl()); | 572 ws_client1_.reset(new TestWindowTreeClientImpl()); |
573 ws_client1_->Bind(GetProxy(&tree_client_ptr)); | 573 ws_client1_->Bind(GetProxy(&tree_client_ptr)); |
574 | 574 |
575 factory->CreateWindowTreeHost(GetProxy(&host_), | 575 factory->CreateWindowTreeHost(GetProxy(&host_), |
576 std::move(tree_client_ptr)); | 576 std::move(tree_client_ptr)); |
577 | 577 |
578 // Next we should get an embed call on the "window manager" client. | 578 // Next we should get an embed call on the "window manager" client. |
579 ws_client1_->WaitForIncomingMethodCall(); | 579 ws_client1_->WaitForIncomingMethodCall(); |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 // originating connection. | 1864 // originating connection. |
1865 | 1865 |
1866 // TODO(sky): make sure coverage of what was | 1866 // TODO(sky): make sure coverage of what was |
1867 // WindowManagerTest.SecondEmbedRoot_InitService and | 1867 // WindowManagerTest.SecondEmbedRoot_InitService and |
1868 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window | 1868 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window |
1869 // manager | 1869 // manager |
1870 // tests. | 1870 // tests. |
1871 | 1871 |
1872 } // namespace ws | 1872 } // namespace ws |
1873 } // namespace mus | 1873 } // namespace mus |
OLD | NEW |