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

Side by Side Diff: mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc

Issue 303873003: Fix invalid expectation in unittest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 "mojo/services/public/cpp/view_manager/view_manager.h" 5 #include "mojo/services/public/cpp/view_manager/view_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h" 9 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h"
10 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" 10 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h"
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 ViewTreeNode* node1_2 = view_manager_2()->GetNodeById(node1->id()); 618 ViewTreeNode* node1_2 = view_manager_2()->GetNodeById(node1->id());
619 node1_2->SetBounds(gfx::Rect(1024, 768)); 619 node1_2->SetBounds(gfx::Rect(1024, 768));
620 // Bounds change should have been rejected. 620 // Bounds change should have been rejected.
621 EXPECT_EQ(node1->bounds(), node1_2->bounds()); 621 EXPECT_EQ(node1->bounds(), node1_2->bounds());
622 } 622 }
623 623
624 // Verifies that a node can only be destroyed by the connection that created it. 624 // Verifies that a node can only be destroyed by the connection that created it.
625 TEST_F(ViewManagerTest, DestroySecurity) { 625 TEST_F(ViewManagerTest, DestroySecurity) {
626 ViewTreeNode* node1 = CreateNodeInParent(view_manager_1()->tree()); 626 ViewTreeNode* node1 = CreateNodeInParent(view_manager_1()->tree());
627 WaitForTreeSizeToMatch(view_manager_2()->tree(), 3); 627 WaitForTreeSizeToMatch(view_manager_2()->tree(), 2);
628 628
629 ViewTreeNode* node1_2 = view_manager_2()->GetNodeById(node1->id()); 629 ViewTreeNode* node1_2 = view_manager_2()->GetNodeById(node1->id());
630 NodeTracker tracker2(node1_2); 630 NodeTracker tracker2(node1_2);
631 node1_2->Destroy(); 631 node1_2->Destroy();
632 // Node should not have been destroyed. 632 // Node should not have been destroyed.
633 EXPECT_TRUE(tracker2.is_valid()); 633 EXPECT_TRUE(tracker2.is_valid());
634 634
635 NodeTracker tracker1(node1); 635 NodeTracker tracker1(node1);
636 node1->Destroy(); 636 node1->Destroy();
637 EXPECT_FALSE(tracker1.is_valid()); 637 EXPECT_FALSE(tracker1.is_valid());
638 } 638 }
639 639
640 } // namespace view_manager 640 } // namespace view_manager
641 } // namespace mojo 641 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698