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

Unified Diff: components/mus/ws/event_dispatcher_unittest.cc

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/event_dispatcher.cc ('k') | components/mus/ws/focus_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/event_dispatcher_unittest.cc
diff --git a/components/mus/ws/event_dispatcher_unittest.cc b/components/mus/ws/event_dispatcher_unittest.cc
index ef5d06f273f555f972b15f8ad1205567c4f8f65e..04255ab74f2396734bea3ce932b123c94bf0e8e0 100644
--- a/components/mus/ws/event_dispatcher_unittest.cc
+++ b/components/mus/ws/event_dispatcher_unittest.cc
@@ -204,34 +204,34 @@ TEST(EventDispatcherTest, AcceleratorBasic) {
EventDispatcher dispatcher(&event_dispatcher_delegate);
uint32_t accelerator_1 = 1;
mojom::EventMatcherPtr matcher = mus::CreateKeyMatcher(
- mus::mojom::KEYBOARD_CODE_W, mus::mojom::EVENT_FLAGS_CONTROL_DOWN);
+ mus::mojom::KeyboardCode::W, mus::mojom::kEventFlagControlDown);
EXPECT_TRUE(dispatcher.AddAccelerator(accelerator_1, std::move(matcher)));
uint32_t accelerator_2 = 2;
- matcher = mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_N,
- mus::mojom::EVENT_FLAGS_NONE);
+ matcher = mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N,
+ mus::mojom::kEventFlagNone);
EXPECT_TRUE(dispatcher.AddAccelerator(accelerator_2, std::move(matcher)));
// Attempting to add a new accelerator with the same id should fail.
- matcher = mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_T,
- mus::mojom::EVENT_FLAGS_NONE);
+ matcher = mus::CreateKeyMatcher(mus::mojom::KeyboardCode::T,
+ mus::mojom::kEventFlagNone);
EXPECT_FALSE(dispatcher.AddAccelerator(accelerator_2, std::move(matcher)));
// Adding the accelerator with the same id should succeed once the existing
// accelerator is removed.
dispatcher.RemoveAccelerator(accelerator_2);
- matcher = mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_T,
- mus::mojom::EVENT_FLAGS_NONE);
+ matcher = mus::CreateKeyMatcher(mus::mojom::KeyboardCode::T,
+ mus::mojom::kEventFlagNone);
EXPECT_TRUE(dispatcher.AddAccelerator(accelerator_2, std::move(matcher)));
// Attempting to add an accelerator with the same matcher should fail.
uint32_t accelerator_3 = 3;
- matcher = mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_T,
- mus::mojom::EVENT_FLAGS_NONE);
+ matcher = mus::CreateKeyMatcher(mus::mojom::KeyboardCode::T,
+ mus::mojom::kEventFlagNone);
EXPECT_FALSE(dispatcher.AddAccelerator(accelerator_3, std::move(matcher)));
- matcher = mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_T,
- mus::mojom::EVENT_FLAGS_CONTROL_DOWN);
+ matcher = mus::CreateKeyMatcher(mus::mojom::KeyboardCode::T,
+ mus::mojom::kEventFlagControlDown);
EXPECT_TRUE(dispatcher.AddAccelerator(accelerator_3, std::move(matcher)));
}
@@ -243,7 +243,7 @@ TEST(EventDispatcherTest, EventMatching) {
dispatcher.set_root(&root);
mojom::EventMatcherPtr matcher = mus::CreateKeyMatcher(
- mus::mojom::KEYBOARD_CODE_W, mus::mojom::EVENT_FLAGS_CONTROL_DOWN);
+ mus::mojom::KeyboardCode::W, mus::mojom::kEventFlagControlDown);
uint32_t accelerator_1 = 1;
dispatcher.AddAccelerator(accelerator_1, std::move(matcher));
@@ -265,8 +265,8 @@ TEST(EventDispatcherTest, EventMatching) {
EXPECT_EQ(0u, event_dispatcher_delegate.GetAndClearLastAccelerator());
uint32_t accelerator_2 = 2;
- matcher = mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_W,
- mus::mojom::EVENT_FLAGS_NONE);
+ matcher = mus::CreateKeyMatcher(mus::mojom::KeyboardCode::W,
+ mus::mojom::kEventFlagNone);
dispatcher.AddAccelerator(accelerator_2, std::move(matcher));
dispatcher.ProcessEvent(mojom::Event::From(key));
EXPECT_EQ(accelerator_2,
@@ -458,13 +458,13 @@ TEST(EventDispatcherTest, ClientAreaGoesToOwner) {
EXPECT_TRUE(event_dispatcher_delegate.has_queued_events());
ASSERT_EQ(&child, details->window);
EXPECT_TRUE(details->in_nonclient_area);
- EXPECT_EQ(mojom::EVENT_TYPE_MOUSE_EXIT, details->event->action);
+ EXPECT_EQ(mojom::EventType::MOUSE_EXIT, details->event->action);
details = event_dispatcher_delegate.GetAndAdvanceDispatchedEventDetails();
EXPECT_FALSE(event_dispatcher_delegate.has_queued_events());
ASSERT_EQ(&child, details->window);
EXPECT_FALSE(details->in_nonclient_area);
- EXPECT_EQ(mojom::EVENT_TYPE_POINTER_DOWN, details->event->action);
+ EXPECT_EQ(mojom::EventType::POINTER_DOWN, details->event->action);
}
TEST(EventDispatcherTest, AdditionalClientArea) {
@@ -716,14 +716,14 @@ TEST(EventDispatcherTest, MouseInExtendedHitTestRegion) {
mojom::Event::From(static_cast<const ui::Event&>(ui_event)));
details = event_dispatcher_delegate.GetAndAdvanceDispatchedEventDetails();
EXPECT_EQ(&root, details->window);
- EXPECT_EQ(mojom::EVENT_TYPE_MOUSE_EXIT, details->event->action);
+ EXPECT_EQ(mojom::EventType::MOUSE_EXIT, details->event->action);
details = event_dispatcher_delegate.GetAndAdvanceDispatchedEventDetails();
ASSERT_TRUE(details);
EXPECT_FALSE(event_dispatcher_delegate.has_queued_events());
EXPECT_TRUE(details->in_nonclient_area);
ASSERT_EQ(&child, details->window);
- EXPECT_EQ(mojom::EVENT_TYPE_POINTER_DOWN, details->event->action);
+ EXPECT_EQ(mojom::EventType::POINTER_DOWN, details->event->action);
scoped_ptr<ui::Event> dispatched_event(
details->event.To<scoped_ptr<ui::Event>>());
ASSERT_TRUE(dispatched_event.get());
« no previous file with comments | « components/mus/ws/event_dispatcher.cc ('k') | components/mus/ws/focus_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698