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

Side by Side Diff: components/mus/view_manager_client_apptest.cc

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 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 unified diff | Download patch
« no previous file with comments | « components/mus/view_manager_app.cc ('k') | components/mus/view_tree_apptest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/view_manager/public/cpp/tests/view_manager_test_base.h" 8 #include "components/mus/public/cpp/tests/view_manager_test_base.h"
9 #include "components/view_manager/public/cpp/util.h" 9 #include "components/mus/public/cpp/util.h"
10 #include "components/view_manager/public/cpp/view_observer.h" 10 #include "components/mus/public/cpp/view_observer.h"
11 #include "components/view_manager/public/cpp/view_tree_connection.h" 11 #include "components/mus/public/cpp/view_tree_connection.h"
12 #include "components/view_manager/public/cpp/view_tree_delegate.h" 12 #include "components/mus/public/cpp/view_tree_delegate.h"
13 #include "mojo/application/public/cpp/application_connection.h" 13 #include "mojo/application/public/cpp/application_connection.h"
14 #include "mojo/application/public/cpp/application_impl.h" 14 #include "mojo/application/public/cpp/application_impl.h"
15 #include "mojo/application/public/cpp/application_test_base.h" 15 #include "mojo/application/public/cpp/application_test_base.h"
16 #include "ui/mojo/geometry/geometry_util.h" 16 #include "ui/mojo/geometry/geometry_util.h"
17 17
18 namespace mojo { 18 namespace mojo {
19 19
20 namespace { 20 namespace {
21 21
22 class BoundsChangeObserver : public ViewObserver { 22 class BoundsChangeObserver : public ViewObserver {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 ASSERT_TRUE(WaitForOrderChange(embedded, root_in_embedded)); 395 ASSERT_TRUE(WaitForOrderChange(embedded, root_in_embedded));
396 396
397 EXPECT_EQ(root_in_embedded->children().front(), 397 EXPECT_EQ(root_in_embedded->children().front(),
398 embedded->GetViewById(view12->id())); 398 embedded->GetViewById(view12->id()));
399 EXPECT_EQ(root_in_embedded->children().back(), 399 EXPECT_EQ(root_in_embedded->children().back(),
400 embedded->GetViewById(view11->id())); 400 embedded->GetViewById(view11->id()));
401 } 401 }
402 402
403 { 403 {
404 view11->MoveToBack(); 404 view11->MoveToBack();
405 ASSERT_TRUE(WaitForOrderChange(embedded, 405 ASSERT_TRUE(
406 embedded->GetViewById(view11->id()))); 406 WaitForOrderChange(embedded, embedded->GetViewById(view11->id())));
407 407
408 EXPECT_EQ(root_in_embedded->children().front(), 408 EXPECT_EQ(root_in_embedded->children().front(),
409 embedded->GetViewById(view11->id())); 409 embedded->GetViewById(view11->id()));
410 EXPECT_EQ(root_in_embedded->children().back(), 410 EXPECT_EQ(root_in_embedded->children().back(),
411 embedded->GetViewById(view12->id())); 411 embedded->GetViewById(view12->id()));
412 } 412 }
413 } 413 }
414 414
415 namespace { 415 namespace {
416 416
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 // Verifies deleting a ViewManager sends the right notifications. 645 // Verifies deleting a ViewManager sends the right notifications.
646 TEST_F(ViewManagerTest, DeleteViewManager) { 646 TEST_F(ViewManagerTest, DeleteViewManager) {
647 View* view = window_manager()->CreateView(); 647 View* view = window_manager()->CreateView();
648 ASSERT_NE(nullptr, view); 648 ASSERT_NE(nullptr, view);
649 view->SetVisible(true); 649 view->SetVisible(true);
650 window_manager()->GetRoot()->AddChild(view); 650 window_manager()->GetRoot()->AddChild(view);
651 ViewTreeConnection* connection = Embed(view).connection; 651 ViewTreeConnection* connection = Embed(view).connection;
652 ASSERT_TRUE(connection); 652 ASSERT_TRUE(connection);
653 bool got_destroy = false; 653 bool got_destroy = false;
654 DestroyedChangedObserver observer(this, connection->GetRoot(), 654 DestroyedChangedObserver observer(this, connection->GetRoot(), &got_destroy);
655 &got_destroy);
656 delete connection; 655 delete connection;
657 EXPECT_TRUE(view_tree_connection_destroyed()); 656 EXPECT_TRUE(view_tree_connection_destroyed());
658 EXPECT_TRUE(got_destroy); 657 EXPECT_TRUE(got_destroy);
659 } 658 }
660 659
661 // Verifies two Embed()s in the same view trigger deletion of the first 660 // Verifies two Embed()s in the same view trigger deletion of the first
662 // ViewManager. 661 // ViewManager.
663 TEST_F(ViewManagerTest, DisconnectTriggersDelete) { 662 TEST_F(ViewManagerTest, DisconnectTriggersDelete) {
664 View* view = window_manager()->CreateView(); 663 View* view = window_manager()->CreateView();
665 ASSERT_NE(nullptr, view); 664 ASSERT_NE(nullptr, view);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 // Embed() from vm2 in vm3_v1. This is allowed as vm2 is an embed root, and 815 // Embed() from vm2 in vm3_v1. This is allowed as vm2 is an embed root, and
817 // further the callback should see the connection id. 816 // further the callback should see the connection id.
818 ASSERT_EQ(1u, vm2_v1->children().size()); 817 ASSERT_EQ(1u, vm2_v1->children().size());
819 View* vm3_v1_in_vm2 = vm2_v1->children()[0]; 818 View* vm3_v1_in_vm2 = vm2_v1->children()[0];
820 const EmbedResult result4 = Embed(vm3_v1_in_vm2); 819 const EmbedResult result4 = Embed(vm3_v1_in_vm2);
821 ASSERT_TRUE(result4.connection); 820 ASSERT_TRUE(result4.connection);
822 EXPECT_EQ(result4.connection_id, result4.connection->GetConnectionId()); 821 EXPECT_EQ(result4.connection_id, result4.connection->GetConnectionId());
823 } 822 }
824 823
825 } // namespace mojo 824 } // namespace mojo
OLDNEW
« no previous file with comments | « components/mus/view_manager_app.cc ('k') | components/mus/view_tree_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698