| 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/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "components/mus/common/util.h" | 8 #include "components/mus/common/util.h" |
| 9 #include "components/mus/public/cpp/tests/window_server_test_base.h" | 9 #include "components/mus/public/cpp/tests/window_server_test_base.h" |
| 10 #include "components/mus/public/cpp/window_observer.h" | 10 #include "components/mus/public/cpp/window_observer.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 const EmbedResult result(embed_details_->connection, | 221 const EmbedResult result(embed_details_->connection, |
| 222 embed_details_->connection_id); | 222 embed_details_->connection_id); |
| 223 embed_details_.reset(); | 223 embed_details_.reset(); |
| 224 return result; | 224 return result; |
| 225 } | 225 } |
| 226 | 226 |
| 227 // Establishes a connection to this application and asks for a | 227 // Establishes a connection to this application and asks for a |
| 228 // WindowTreeClient. | 228 // WindowTreeClient. |
| 229 mus::mojom::WindowTreeClientPtr | 229 mus::mojom::WindowTreeClientPtr |
| 230 ConnectToApplicationAndGetWindowServerClient() { | 230 ConnectToApplicationAndGetWindowServerClient() { |
| 231 mojo::URLRequestPtr request(mojo::URLRequest::New()); | |
| 232 request->url = mojo::String::From(application_impl()->url()); | |
| 233 scoped_ptr<mojo::ApplicationConnection> connection = | |
| 234 application_impl()->ConnectToApplication(request.Pass()); | |
| 235 mus::mojom::WindowTreeClientPtr client; | 231 mus::mojom::WindowTreeClientPtr client; |
| 236 connection->ConnectToService(&client); | 232 application_impl()->ConnectToService(application_impl()->url(), &client); |
| 237 return client.Pass(); | 233 return client.Pass(); |
| 238 } | 234 } |
| 239 | 235 |
| 240 // WindowServerTestBase: | 236 // WindowServerTestBase: |
| 241 void OnEmbed(Window* root) override { | 237 void OnEmbed(Window* root) override { |
| 242 if (!embed_details_) { | 238 if (!embed_details_) { |
| 243 WindowServerTestBase::OnEmbed(root); | 239 WindowServerTestBase::OnEmbed(root); |
| 244 return; | 240 return; |
| 245 } | 241 } |
| 246 | 242 |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 WaitForBoundsToChange(embedded_connection->GetRoot()); | 885 WaitForBoundsToChange(embedded_connection->GetRoot()); |
| 890 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == | 886 EXPECT_TRUE(gfx::Rect(21, 22, 23, 24) == |
| 891 embedded_connection->GetRoot()->bounds()); | 887 embedded_connection->GetRoot()->bounds()); |
| 892 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == | 888 EXPECT_TRUE(gfx::Insets(1, 2, 3, 4) == |
| 893 embedded_connection->GetRoot()->client_area()); | 889 embedded_connection->GetRoot()->client_area()); |
| 894 } | 890 } |
| 895 | 891 |
| 896 } // namespace ws | 892 } // namespace ws |
| 897 | 893 |
| 898 } // namespace mus | 894 } // namespace mus |
| OLD | NEW |