Index: mojo/services/view_manager/view_manager_unittest.cc |
diff --git a/mojo/services/view_manager/view_manager_unittest.cc b/mojo/services/view_manager/view_manager_unittest.cc |
index 5ea3b71899fcb5709543993c51f242f3e538ee08..8c7dcb91b7127304b2201d4bb25ca3db74f63259 100644 |
--- a/mojo/services/view_manager/view_manager_unittest.cc |
+++ b/mojo/services/view_manager/view_manager_unittest.cc |
@@ -1153,7 +1153,7 @@ TEST_F(ViewManagerTest, ConnectTwice) { |
// Try to connect again to 1,1, this should fail as already connected to that |
// root. |
- ASSERT_FALSE(connection_->Embed(BuildNodeId(1, 1), kTestServiceURL)); |
+ ASSERT_TRUE(connection_->Embed(BuildNodeId(1, 1), kTestServiceURL)); |
// Connecting to 1,2 should succeed and end up in connection2. |
{ |
@@ -1161,9 +1161,7 @@ TEST_F(ViewManagerTest, ConnectTwice) { |
connection2_->DoRunLoopUntilChangesCount(1); |
const Changes changes(ChangesToDescription1(connection2_->changes())); |
ASSERT_EQ(1u, changes.size()); |
- EXPECT_EQ("OnEmbed creator=mojo:test_url", changes[0]); |
- EXPECT_EQ("[node=1,2 parent=null]", |
- ChangeNodeDescription(connection2_->changes())); |
+ EXPECT_EQ("NodeDeleted node=1,1", changes[0]); |
} |
} |
@@ -1230,12 +1228,13 @@ TEST_F(ViewManagerTest, EmbedWithSameNodeId2) { |
changes[0]); |
} |
- // Embed 1,1 back in connection 2. |
+ // Embed 1,1 again. |
{ |
- // 2 should be told about the new embed. |
+ // We should get a new connection for the new embedding. |
ASSERT_TRUE(connection_->Embed(BuildNodeId(1, 1), kTestServiceURL)); |
- connection2_->DoRunLoopUntilChangesCount(1); |
- const std::vector<Change>& changes(connection2_->changes()); |
+ ViewManagerProxy* connection4 = ViewManagerProxy::WaitForInstance(); |
+ connection4->DoRunLoopUntilChangesCount(1); |
+ const std::vector<Change>& changes(connection4->changes()); |
ASSERT_EQ(1u, changes.size()); |
EXPECT_EQ("OnEmbed creator=mojo:test_url", |
ChangesToDescription1(changes)[0]); |