| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 EXPECT_FALSE(child_win->GetProperty(views::kHostViewKey)); | 146 EXPECT_FALSE(child_win->GetProperty(views::kHostViewKey)); |
| 147 EXPECT_FALSE(child_win->GetProperty(aura::client::kHostWindowKey)); | 147 EXPECT_FALSE(child_win->GetProperty(aura::client::kHostWindowKey)); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Tests that the NativeViewHost reports the cursor set on its native view. | 150 // Tests that the NativeViewHost reports the cursor set on its native view. |
| 151 TEST_F(NativeViewHostAuraTest, CursorForNativeView) { | 151 TEST_F(NativeViewHostAuraTest, CursorForNativeView) { |
| 152 CreateHost(); | 152 CreateHost(); |
| 153 | 153 |
| 154 toplevel()->SetCursor(ui::kCursorHand); | 154 toplevel()->SetCursor(ui::kCursorHand); |
| 155 child()->SetCursor(ui::kCursorWait); | 155 child()->SetCursor(ui::kCursorWait); |
| 156 ui::MouseEvent move_event(ui::ET_MOUSE_MOVED, gfx::Point(0, 0), | 156 ui::MouseEvent move_event(ui::ET_MOUSE_MOVED, gfx::PointF(), gfx::PointF(), |
| 157 gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0); | 157 ui::EventTimeForNow(), 0, 0); |
| 158 | 158 |
| 159 EXPECT_EQ(ui::kCursorWait, host()->GetCursor(move_event).native_type()); | 159 EXPECT_EQ(ui::kCursorWait, host()->GetCursor(move_event).native_type()); |
| 160 | 160 |
| 161 DestroyHost(); | 161 DestroyHost(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Test that destroying the top level widget before destroying the attached | 164 // Test that destroying the top level widget before destroying the attached |
| 165 // NativeViewHost works correctly. Specifically the associated NVH should be | 165 // NativeViewHost works correctly. Specifically the associated NVH should be |
| 166 // destroyed and there shouldn't be any errors. | 166 // destroyed and there shouldn't be any errors. |
| 167 TEST_F(NativeViewHostAuraTest, DestroyWidget) { | 167 TEST_F(NativeViewHostAuraTest, DestroyWidget) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 host()->SetVisible(false); | 363 host()->SetVisible(false); |
| 364 EXPECT_FALSE(clipping_window()->IsVisible()); | 364 EXPECT_FALSE(clipping_window()->IsVisible()); |
| 365 EXPECT_FALSE(child()->IsVisible()); | 365 EXPECT_FALSE(child()->IsVisible()); |
| 366 | 366 |
| 367 DestroyHost(); | 367 DestroyHost(); |
| 368 DestroyTopLevel(); | 368 DestroyTopLevel(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 } // namespace views | 371 } // namespace views |
| OLD | NEW |