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

Side by Side Diff: ui/views/controls/native/native_view_host_aura_unittest.cc

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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
OLDNEW
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
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(
157 gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0); 157 ui::ET_MOUSE_MOVED, gfx::Point(0, 0), gfx::Point(0, 0),
158 ui::EventTimeForNow(), 0, 0,
159 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
158 160
159 EXPECT_EQ(ui::kCursorWait, host()->GetCursor(move_event).native_type()); 161 EXPECT_EQ(ui::kCursorWait, host()->GetCursor(move_event).native_type());
160 162
161 DestroyHost(); 163 DestroyHost();
162 } 164 }
163 165
164 // Test that destroying the top level widget before destroying the attached 166 // Test that destroying the top level widget before destroying the attached
165 // NativeViewHost works correctly. Specifically the associated NVH should be 167 // NativeViewHost works correctly. Specifically the associated NVH should be
166 // destroyed and there shouldn't be any errors. 168 // destroyed and there shouldn't be any errors.
167 TEST_F(NativeViewHostAuraTest, DestroyWidget) { 169 TEST_F(NativeViewHostAuraTest, DestroyWidget) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 364
363 host()->SetVisible(false); 365 host()->SetVisible(false);
364 EXPECT_FALSE(clipping_window()->IsVisible()); 366 EXPECT_FALSE(clipping_window()->IsVisible());
365 EXPECT_FALSE(child()->IsVisible()); 367 EXPECT_FALSE(child()->IsVisible());
366 368
367 DestroyHost(); 369 DestroyHost();
368 DestroyTopLevel(); 370 DestroyTopLevel();
369 } 371 }
370 372
371 } // namespace views 373 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698