| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 // notification. | 1864 // notification. |
| 1865 scoped_ptr<Window> w3(CreateTestWindowWithId(3, root_window())); | 1865 scoped_ptr<Window> w3(CreateTestWindowWithId(3, root_window())); |
| 1866 EXPECT_EQ("added=0 removed=0", WindowObserverCountStateAndClear()); | 1866 EXPECT_EQ("added=0 removed=0", WindowObserverCountStateAndClear()); |
| 1867 | 1867 |
| 1868 // Similarly destroying w3 shouldn't notify us either. | 1868 // Similarly destroying w3 shouldn't notify us either. |
| 1869 w3.reset(); | 1869 w3.reset(); |
| 1870 EXPECT_EQ("added=0 removed=0", WindowObserverCountStateAndClear()); | 1870 EXPECT_EQ("added=0 removed=0", WindowObserverCountStateAndClear()); |
| 1871 w1->RemoveObserver(this); | 1871 w1->RemoveObserver(this); |
| 1872 } | 1872 } |
| 1873 | 1873 |
| 1874 // Test if OnWindowVisibilityChagned is invoked with expected | 1874 // Test if OnWindowVisibilityChanged is invoked with expected |
| 1875 // parameters. | 1875 // parameters. |
| 1876 TEST_F(WindowObserverTest, WindowVisibility) { | 1876 TEST_F(WindowObserverTest, WindowVisibility) { |
| 1877 scoped_ptr<Window> w1(CreateTestWindowWithId(1, root_window())); | 1877 scoped_ptr<Window> w1(CreateTestWindowWithId(1, root_window())); |
| 1878 scoped_ptr<Window> w2(CreateTestWindowWithId(1, w1.get())); | 1878 scoped_ptr<Window> w2(CreateTestWindowWithId(1, w1.get())); |
| 1879 w2->AddObserver(this); | 1879 w2->AddObserver(this); |
| 1880 | 1880 |
| 1881 // Hide should make the window invisible and the passed visible | 1881 // Hide should make the window invisible and the passed visible |
| 1882 // parameter is false. | 1882 // parameter is false. |
| 1883 w2->Hide(); | 1883 w2->Hide(); |
| 1884 EXPECT_FALSE(!GetVisibilityInfo()); | 1884 EXPECT_FALSE(!GetVisibilityInfo()); |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2920 | 2920 |
| 2921 EXPECT_TRUE(animator.get()); | 2921 EXPECT_TRUE(animator.get()); |
| 2922 EXPECT_FALSE(animator->is_animating()); | 2922 EXPECT_FALSE(animator->is_animating()); |
| 2923 EXPECT_TRUE(observer.animation_completed()); | 2923 EXPECT_TRUE(observer.animation_completed()); |
| 2924 EXPECT_FALSE(observer.animation_aborted()); | 2924 EXPECT_FALSE(observer.animation_aborted()); |
| 2925 animator->RemoveObserver(&observer); | 2925 animator->RemoveObserver(&observer); |
| 2926 } | 2926 } |
| 2927 | 2927 |
| 2928 } // namespace test | 2928 } // namespace test |
| 2929 } // namespace aura | 2929 } // namespace aura |
| OLD | NEW |