OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/views/controls/native/native_view_host_aura.h" | 5 #include "ui/views/controls/native/native_view_host_aura.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 EXPECT_EQ(NativeViewHostWindowObserver::EVENT_SHOWN, | 367 EXPECT_EQ(NativeViewHostWindowObserver::EVENT_SHOWN, |
368 test_observer.events()[2].type); | 368 test_observer.events()[2].type); |
369 EXPECT_EQ(clipping_window(), test_observer.events()[2].window); | 369 EXPECT_EQ(clipping_window(), test_observer.events()[2].window); |
370 EXPECT_EQ(gfx::Rect(10, 10, 80, 80).ToString(), | 370 EXPECT_EQ(gfx::Rect(10, 10, 80, 80).ToString(), |
371 test_observer.events()[2].bounds.ToString()); | 371 test_observer.events()[2].bounds.ToString()); |
372 | 372 |
373 child()->GetNativeView()->RemoveObserver(&test_observer); | 373 child()->GetNativeView()->RemoveObserver(&test_observer); |
374 DestroyHost(); | 374 DestroyHost(); |
375 } | 375 } |
376 | 376 |
| 377 // Ensure the clipping window is hidden with the native view. This is a |
| 378 // regression test for https://crbug.com/408877. |
| 379 TEST_F(NativeViewHostAuraTest, SimpleShowAndHide) { |
| 380 CreateHost(); |
| 381 |
| 382 toplevel()->SetBounds(gfx::Rect(20, 20, 100, 100)); |
| 383 toplevel()->Show(); |
| 384 |
| 385 host()->SetBounds(10, 10, 80, 80); |
| 386 EXPECT_TRUE(clipping_window()->IsVisible()); |
| 387 EXPECT_TRUE(child()->IsVisible()); |
| 388 |
| 389 host()->SetVisible(false); |
| 390 EXPECT_FALSE(clipping_window()->IsVisible()); |
| 391 EXPECT_FALSE(child()->IsVisible()); |
| 392 |
| 393 DestroyHost(); |
| 394 DestroyTopLevel(); |
| 395 } |
| 396 |
377 } // namespace views | 397 } // namespace views |
OLD | NEW |