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

Unified Diff: services/ui/ws/window_manager_state_unittest.cc

Issue 2520093003: WindowManagerClient::AddAccelerator() should take an array (Closed)
Patch Set: Adding 1 test that has two unique and one duped accelerators. Created 4 years 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: services/ui/ws/window_manager_state_unittest.cc
diff --git a/services/ui/ws/window_manager_state_unittest.cc b/services/ui/ws/window_manager_state_unittest.cc
index eebde144c1668701661138decdd8f9f35f86c091..f564c3cd84c1ad6a4a89e551bb575700c23dd50a 100644
--- a/services/ui/ws/window_manager_state_unittest.cc
+++ b/services/ui/ws/window_manager_state_unittest.cc
@@ -12,7 +12,7 @@
#include "base/test/test_simple_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "services/service_manager/public/interfaces/connector.mojom.h"
-#include "services/ui/common/event_matcher_util.h"
+#include "services/ui/common/accelerator_util.h"
#include "services/ui/ws/accelerator.h"
#include "services/ui/ws/display.h"
#include "services/ui/ws/display_manager.h"
@@ -231,8 +231,12 @@ TEST_F(WindowManagerStateTest, PreTargetConsumed) {
{
mojom::EventMatcherPtr matcher = ui::CreateKeyMatcher(
ui::mojom::KeyboardCode::W, ui::mojom::kEventFlagControlDown);
- ASSERT_TRUE(window_manager_state()->event_dispatcher()->AddAccelerator(
- accelerator_id, std::move(matcher)));
+
+ std::vector<ui::mojom::AcceleratorPtr> accelerators =
mfomitchev 2016/12/01 15:32:37 nit: no need to create a local var
thanhph 2016/12/01 19:03:19 Done, thanks!
+ ui::CreateAcceleratorVector(accelerator_id, std::move(matcher));
+
+ ASSERT_TRUE(window_manager_state()->event_dispatcher()->AddAccelerators(
+ std::move(accelerators)));
}
TestChangeTracker* tracker = wm_client()->tracker();
tracker->changes()->clear();

Powered by Google App Engine
This is Rietveld 408576698