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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc

Issue 2833163002: Change ui cursor identifiers to an enum class. (Closed)
Patch Set: OK, it can't be explicit for mac. Created 3 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/widget/desktop_aura/desktop_native_widget_aura.h" 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 EXPECT_FALSE(cursor_client_b->IsMouseEventsEnabled()); 171 EXPECT_FALSE(cursor_client_b->IsMouseEventsEnabled());
172 172
173 cursor_client_a->EnableMouseEvents(); 173 cursor_client_a->EnableMouseEvents();
174 EXPECT_TRUE(cursor_client_a->IsCursorVisible()); 174 EXPECT_TRUE(cursor_client_a->IsCursorVisible());
175 EXPECT_TRUE(cursor_client_b->IsCursorVisible()); 175 EXPECT_TRUE(cursor_client_b->IsCursorVisible());
176 EXPECT_TRUE(cursor_client_a->IsMouseEventsEnabled()); 176 EXPECT_TRUE(cursor_client_a->IsMouseEventsEnabled());
177 EXPECT_TRUE(cursor_client_b->IsMouseEventsEnabled()); 177 EXPECT_TRUE(cursor_client_b->IsMouseEventsEnabled());
178 178
179 // Verify that setting the cursor using one cursor client 179 // Verify that setting the cursor using one cursor client
180 // will set it for all root windows. 180 // will set it for all root windows.
181 EXPECT_EQ(ui::kCursorNone, cursor_client_a->GetCursor().native_type()); 181 EXPECT_EQ(ui::CursorType::kNone, cursor_client_a->GetCursor().native_type());
182 EXPECT_EQ(ui::kCursorNone, cursor_client_b->GetCursor().native_type()); 182 EXPECT_EQ(ui::CursorType::kNone, cursor_client_b->GetCursor().native_type());
183 183
184 cursor_client_b->SetCursor(ui::kCursorPointer); 184 cursor_client_b->SetCursor(ui::CursorType::kPointer);
185 EXPECT_EQ(ui::kCursorPointer, cursor_client_a->GetCursor().native_type()); 185 EXPECT_EQ(ui::CursorType::kPointer,
186 EXPECT_EQ(ui::kCursorPointer, cursor_client_b->GetCursor().native_type()); 186 cursor_client_a->GetCursor().native_type());
187 EXPECT_EQ(ui::CursorType::kPointer,
188 cursor_client_b->GetCursor().native_type());
187 189
188 // Verify that hiding the cursor using one cursor client will 190 // Verify that hiding the cursor using one cursor client will
189 // hide it for all root windows. Note that hiding the cursor 191 // hide it for all root windows. Note that hiding the cursor
190 // should not disable mouse events. 192 // should not disable mouse events.
191 cursor_client_a->HideCursor(); 193 cursor_client_a->HideCursor();
192 EXPECT_FALSE(cursor_client_a->IsCursorVisible()); 194 EXPECT_FALSE(cursor_client_a->IsCursorVisible());
193 EXPECT_FALSE(cursor_client_b->IsCursorVisible()); 195 EXPECT_FALSE(cursor_client_b->IsCursorVisible());
194 EXPECT_TRUE(cursor_client_a->IsMouseEventsEnabled()); 196 EXPECT_TRUE(cursor_client_a->IsMouseEventsEnabled());
195 EXPECT_TRUE(cursor_client_b->IsMouseEventsEnabled()); 197 EXPECT_TRUE(cursor_client_b->IsMouseEventsEnabled());
196 198
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled); 676 target->HandleKeyboardMessage(WM_CHAR, 0, 0, &handled);
675 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled); 677 target->HandleKeyboardMessage(WM_SYSCHAR, 0, 0, &handled);
676 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled); 678 target->HandleKeyboardMessage(WM_SYSDEADCHAR, 0, 0, &handled);
677 widget.CloseNow(); 679 widget.CloseNow();
678 } 680 }
679 681
680 #endif // defined(OS_WIN) 682 #endif // defined(OS_WIN)
681 683
682 } // namespace test 684 } // namespace test
683 } // namespace views 685 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698