| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 EXPECT_FALSE(child_win->GetProperty(views::kHostViewKey)); | 153 EXPECT_FALSE(child_win->GetProperty(views::kHostViewKey)); |
| 154 EXPECT_FALSE(child_win->GetProperty(aura::client::kHostWindowKey)); | 154 EXPECT_FALSE(child_win->GetProperty(aura::client::kHostWindowKey)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 // Tests that the NativeViewHost reports the cursor set on its native view. | 157 // Tests that the NativeViewHost reports the cursor set on its native view. |
| 158 TEST_F(NativeViewHostAuraTest, CursorForNativeView) { | 158 TEST_F(NativeViewHostAuraTest, CursorForNativeView) { |
| 159 CreateHost(); | 159 CreateHost(); |
| 160 | 160 |
| 161 toplevel()->SetCursor(ui::kCursorHand); | 161 toplevel()->SetCursor(ui::kCursorHand); |
| 162 child()->SetCursor(ui::kCursorWait); | 162 child()->SetCursor(ui::kCursorWait); |
| 163 ui::MouseEvent move_event(ui::ET_MOUSE_MOVED, gfx::Point(0, 0), | 163 ui::MouseEvent move_event( |
| 164 gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0); | 164 ui::ET_MOUSE_MOVED, gfx::Point(0, 0), gfx::Point(0, 0), |
| 165 ui::EventTimeForNow(), 0, 0, |
| 166 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
| 165 | 167 |
| 166 EXPECT_EQ(ui::kCursorWait, host()->GetCursor(move_event).native_type()); | 168 EXPECT_EQ(ui::kCursorWait, host()->GetCursor(move_event).native_type()); |
| 167 | 169 |
| 168 DestroyHost(); | 170 DestroyHost(); |
| 169 } | 171 } |
| 170 | 172 |
| 171 // Test that destroying the top level widget before destroying the attached | 173 // Test that destroying the top level widget before destroying the attached |
| 172 // NativeViewHost works correctly. Specifically the associated NVH should be | 174 // NativeViewHost works correctly. Specifically the associated NVH should be |
| 173 // destroyed and there shouldn't be any errors. | 175 // destroyed and there shouldn't be any errors. |
| 174 TEST_F(NativeViewHostAuraTest, DestroyWidget) { | 176 TEST_F(NativeViewHostAuraTest, DestroyWidget) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 378 |
| 377 host()->SetVisible(false); | 379 host()->SetVisible(false); |
| 378 EXPECT_FALSE(clipping_window()->IsVisible()); | 380 EXPECT_FALSE(clipping_window()->IsVisible()); |
| 379 EXPECT_FALSE(child()->IsVisible()); | 381 EXPECT_FALSE(child()->IsVisible()); |
| 380 | 382 |
| 381 DestroyHost(); | 383 DestroyHost(); |
| 382 DestroyTopLevel(); | 384 DestroyTopLevel(); |
| 383 } | 385 } |
| 384 | 386 |
| 385 } // namespace views | 387 } // namespace views |
| OLD | NEW |