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/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
10 #include "mojo/public/cpp/application/application_test_base.h" | 10 #include "mojo/public/cpp/application/application_test_base.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 if (!client.get()) { | 449 if (!client.get()) { |
450 ADD_FAILURE() << "WaitForInstance failed"; | 450 ADD_FAILURE() << "WaitForInstance failed"; |
451 return nullptr; | 451 return nullptr; |
452 } | 452 } |
453 client->WaitForOnEmbed(); | 453 client->WaitForOnEmbed(); |
454 | 454 |
455 const std::string expected_creator = | 455 const std::string expected_creator = |
456 owner == vm1() ? "mojo:window_manager" : application_impl()->url(); | 456 owner == vm1() ? "mojo:window_manager" : application_impl()->url(); |
457 EXPECT_EQ("OnEmbed creator=" + expected_creator, | 457 EXPECT_EQ("OnEmbed creator=" + expected_creator, |
458 SingleChangeToDescription(*client->tracker()->changes())); | 458 SingleChangeToDescription(*client->tracker()->changes())); |
459 return client.Pass(); | 459 return client; |
460 } | 460 } |
461 | 461 |
462 // ApplicationTestBase: | 462 // ApplicationTestBase: |
463 ApplicationDelegate* GetApplicationDelegate() override { return this; } | 463 ApplicationDelegate* GetApplicationDelegate() override { return this; } |
464 void SetUp() override { | 464 void SetUp() override { |
465 ApplicationTestBase::SetUp(); | 465 ApplicationTestBase::SetUp(); |
466 ApplicationConnection* vm_connection = | 466 ApplicationConnection* vm_connection = |
467 application_impl()->ConnectToApplication("mojo:view_manager"); | 467 application_impl()->ConnectToApplication("mojo:view_manager"); |
468 vm_connection->AddService(this); | 468 vm_connection->AddService(this); |
469 vm_connection->ConnectToService(&vm1_); | 469 vm_connection->ConnectToService(&vm1_); |
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 // TODO(sky): need to better track changes to initial connection. For example, | 1487 // TODO(sky): need to better track changes to initial connection. For example, |
1488 // that SetBounsdViews/AddView and the like don't result in messages to the | 1488 // that SetBounsdViews/AddView and the like don't result in messages to the |
1489 // originating connection. | 1489 // originating connection. |
1490 | 1490 |
1491 // TODO(sky): make sure coverage of what was | 1491 // TODO(sky): make sure coverage of what was |
1492 // ViewManagerTest.SecondEmbedRoot_InitService and | 1492 // ViewManagerTest.SecondEmbedRoot_InitService and |
1493 // ViewManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window manager | 1493 // ViewManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window manager |
1494 // tests. | 1494 // tests. |
1495 | 1495 |
1496 } // namespace view_manager | 1496 } // namespace view_manager |
OLD | NEW |