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

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: Created 4 years, 12 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
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 ab1adc170046af89336939aef04919ebaf96c0e5..7bd7630dbd1324548cbeaa5c1fa74d1c4701ecd9 100644
--- a/components/mus/ws/event_dispatcher_unittest.cc
+++ b/components/mus/ws/event_dispatcher_unittest.cc
@@ -175,34 +175,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)));
}
@@ -214,7 +214,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));
@@ -236,8 +236,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.OnEvent(mojom::Event::From(key));
EXPECT_EQ(accelerator_2,

Powered by Google App Engine
This is Rietveld 408576698