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

Side by Side Diff: mash/wm/accelerator_registrar_apptest.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 unified diff | Download patch
« no previous file with comments | « mash/wallpaper/wallpaper.cc ('k') | mash/wm/frame/move_event_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stdint.h> 5 #include <stdint.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 "components/mus/public/cpp/event_matcher.h" 10 #include "components/mus/public/cpp/event_matcher.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 private: 82 private:
83 DISALLOW_COPY_AND_ASSIGN(AcceleratorRegistrarTest); 83 DISALLOW_COPY_AND_ASSIGN(AcceleratorRegistrarTest);
84 }; 84 };
85 85
86 TEST_F(AcceleratorRegistrarTest, AcceleratorRegistrarBasic) { 86 TEST_F(AcceleratorRegistrarTest, AcceleratorRegistrarBasic) {
87 AcceleratorRegistrarPtr registrar_first; 87 AcceleratorRegistrarPtr registrar_first;
88 ConnectToRegistrar(&registrar_first); 88 ConnectToRegistrar(&registrar_first);
89 TestAcceleratorHandler handler_first(std::move(registrar_first)); 89 TestAcceleratorHandler handler_first(std::move(registrar_first));
90 EXPECT_TRUE(handler_first.AttemptToInstallAccelerator( 90 EXPECT_TRUE(handler_first.AttemptToInstallAccelerator(
91 1, mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_T, 91 1, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::T,
92 mus::mojom::EVENT_FLAGS_SHIFT_DOWN))); 92 mus::mojom::kEventFlagShiftDown)));
93 // Attempting to add an accelerator with the same accelerator id from the same 93 // Attempting to add an accelerator with the same accelerator id from the same
94 // registrar should fail. 94 // registrar should fail.
95 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator( 95 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator(
96 1, mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_N, 96 1, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N,
97 mus::mojom::EVENT_FLAGS_SHIFT_DOWN))); 97 mus::mojom::kEventFlagShiftDown)));
98 98
99 // Attempting to add an accelerator with the same id from a different 99 // Attempting to add an accelerator with the same id from a different
100 // registrar should be OK. 100 // registrar should be OK.
101 AcceleratorRegistrarPtr registrar_second; 101 AcceleratorRegistrarPtr registrar_second;
102 ConnectToRegistrar(&registrar_second); 102 ConnectToRegistrar(&registrar_second);
103 TestAcceleratorHandler handler_second(std::move(registrar_second)); 103 TestAcceleratorHandler handler_second(std::move(registrar_second));
104 EXPECT_TRUE(handler_second.AttemptToInstallAccelerator( 104 EXPECT_TRUE(handler_second.AttemptToInstallAccelerator(
105 1, mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_N, 105 1, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N,
106 mus::mojom::EVENT_FLAGS_SHIFT_DOWN))); 106 mus::mojom::kEventFlagShiftDown)));
107 107
108 // But attempting to add an accelerator with the same matcher should fail. 108 // But attempting to add an accelerator with the same matcher should fail.
109 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator( 109 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator(
110 3, mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_N, 110 3, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N,
111 mus::mojom::EVENT_FLAGS_SHIFT_DOWN))); 111 mus::mojom::kEventFlagShiftDown)));
112 EXPECT_FALSE(handler_second.AttemptToInstallAccelerator( 112 EXPECT_FALSE(handler_second.AttemptToInstallAccelerator(
113 3, mus::CreateKeyMatcher(mus::mojom::KEYBOARD_CODE_N, 113 3, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N,
114 mus::mojom::EVENT_FLAGS_SHIFT_DOWN))); 114 mus::mojom::kEventFlagShiftDown)));
115 } 115 }
116 116
117 } // namespace wm 117 } // namespace wm
118 } // namespace mash 118 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wallpaper/wallpaper.cc ('k') | mash/wm/frame/move_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698