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

Side by Side Diff: ui/aura/window_unittest.cc

Issue 8136005: Makes visbility inherited. That is, in order for a window to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Window now gets visibility from Layer. Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/aura/desktop.h" 9 #include "ui/aura/desktop.h"
10 #include "ui/aura/event.h" 10 #include "ui/aura/event.h"
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 gfx::Rect(0, 0, 500, 500), w1.get())); 587 gfx::Rect(0, 0, 500, 500), w1.get()));
588 scoped_ptr<Window> w111(CreateTestWindowWithDelegate(&d111, 1, 588 scoped_ptr<Window> w111(CreateTestWindowWithDelegate(&d111, 1,
589 gfx::Rect(50, 50, 450, 450), w11.get())); 589 gfx::Rect(50, 50, 450, 450), w11.get()));
590 scoped_ptr<Window> w12(CreateTestWindowWithDelegate(NULL, 12, 590 scoped_ptr<Window> w12(CreateTestWindowWithDelegate(NULL, 12,
591 gfx::Rect(0, 0, 500, 500), w1.get())); 591 gfx::Rect(0, 0, 500, 500), w1.get()));
592 592
593 gfx::Point target_point = w111->bounds().CenterPoint(); 593 gfx::Point target_point = w111->bounds().CenterPoint();
594 EXPECT_EQ(w111.get(), w1->GetEventHandlerForPoint(target_point)); 594 EXPECT_EQ(w111.get(), w1->GetEventHandlerForPoint(target_point));
595 } 595 }
596 596
597 // Verifies show/hide propagate correctly to children and the layer.
598 TEST_F(WindowTest, Visibility) {
599 scoped_ptr<Window> w1(CreateTestWindowWithId(1, NULL));
600 scoped_ptr<Window> w2(CreateTestWindowWithId(2, w1.get()));
601 scoped_ptr<Window> w3(CreateTestWindowWithId(3, w2.get()));
602
603 // Create shows all the windows.
604 EXPECT_TRUE(w1->IsVisible());
605 EXPECT_TRUE(w2->IsVisible());
606 EXPECT_TRUE(w3->IsVisible());
607
608 w1->Hide();
609 EXPECT_FALSE(w1->IsVisible());
610 EXPECT_FALSE(w2->IsVisible());
611 EXPECT_FALSE(w3->IsVisible());
612
613 w2->Show();
614 EXPECT_FALSE(w1->IsVisible());
615 EXPECT_FALSE(w2->IsVisible());
616 EXPECT_FALSE(w3->IsVisible());
617
618 w3->Hide();
619 EXPECT_FALSE(w1->IsVisible());
620 EXPECT_FALSE(w2->IsVisible());
621 EXPECT_FALSE(w3->IsVisible());
622
623 w1->Show();
624 EXPECT_TRUE(w1->IsVisible());
625 EXPECT_TRUE(w2->IsVisible());
626 EXPECT_FALSE(w3->IsVisible());
627
628 w3->Show();
629 EXPECT_TRUE(w1->IsVisible());
630 EXPECT_TRUE(w2->IsVisible());
631 EXPECT_TRUE(w3->IsVisible());
632 }
633
597 } // namespace internal 634 } // namespace internal
598 } // namespace aura 635 } // namespace aura
OLDNEW
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | ui/gfx/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698