Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Unified Diff: mojo/services/view_manager/view_manager_unittest.cc

Issue 514063003: Update view_manager and window_manager to make use of content handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@viewman2
Patch Set: git cl format Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c939489b586001612b7504e43b3058ddbd4131bf..a6ceca8c2087bb58796a03d2fdffdd156daf1750 100644
--- a/mojo/services/view_manager/view_manager_unittest.cc
+++ b/mojo/services/view_manager/view_manager_unittest.cc
@@ -1160,7 +1160,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(BuildViewId(1, 1), kTestServiceURL));
+ ASSERT_TRUE(connection_->Embed(BuildViewId(1, 1), kTestServiceURL));
// Connecting to 1,2 should succeed and end up in connection2.
{
@@ -1168,9 +1168,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("[view=1,2 parent=null]",
- ChangeViewDescription(connection2_->changes()));
+ EXPECT_EQ("ViewDeleted view=1,1", changes[0]);
}
}
@@ -1236,12 +1234,13 @@ TEST_F(ViewManagerTest, EmbedWithSameViewId2) {
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(BuildViewId(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]);
« no previous file with comments | « mojo/services/view_manager/view_manager_service_impl.cc ('k') | mojo/services/window_manager/window_manager_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698