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

Side by Side Diff: ash/mus/accelerator_registrar_unittest.cc

Issue 1939133002: StructTraits to map mus::mojom::Event to unique_ptr<ui::Event> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo comments + reorganize files Created 4 years, 6 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 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 <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 private: 51 private:
52 void AddAcceleratorCallback(bool success) { 52 void AddAcceleratorCallback(bool success) {
53 DCHECK(run_loop_ && run_loop_->running()); 53 DCHECK(run_loop_ && run_loop_->running());
54 add_accelerator_result_ = success; 54 add_accelerator_result_ = success;
55 run_loop_->Quit(); 55 run_loop_->Quit();
56 } 56 }
57 57
58 // AcceleratorHandler: 58 // AcceleratorHandler:
59 void OnAccelerator(uint32_t id, ::mus::mojom::EventPtr event) override {} 59 void OnAccelerator(uint32_t id,
60 const std::unique_ptr<ui::Event>& event) override {}
60 61
61 std::set<uint32_t> installed_accelerators_; 62 std::set<uint32_t> installed_accelerators_;
62 std::unique_ptr<base::RunLoop> run_loop_; 63 std::unique_ptr<base::RunLoop> run_loop_;
63 mojo::Binding<AcceleratorHandler> binding_; 64 mojo::Binding<AcceleratorHandler> binding_;
64 AcceleratorRegistrarPtr registrar_; 65 AcceleratorRegistrarPtr registrar_;
65 bool add_accelerator_result_; 66 bool add_accelerator_result_;
66 67
67 DISALLOW_COPY_AND_ASSIGN(TestAcceleratorHandler); 68 DISALLOW_COPY_AND_ASSIGN(TestAcceleratorHandler);
68 }; 69 };
69 70
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator( 108 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator(
108 3, ::mus::CreateKeyMatcher(::mus::mojom::KeyboardCode::N, 109 3, ::mus::CreateKeyMatcher(::mus::mojom::KeyboardCode::N,
109 ::mus::mojom::kEventFlagShiftDown))); 110 ::mus::mojom::kEventFlagShiftDown)));
110 EXPECT_FALSE(handler_second.AttemptToInstallAccelerator( 111 EXPECT_FALSE(handler_second.AttemptToInstallAccelerator(
111 3, ::mus::CreateKeyMatcher(::mus::mojom::KeyboardCode::N, 112 3, ::mus::CreateKeyMatcher(::mus::mojom::KeyboardCode::N,
112 ::mus::mojom::kEventFlagShiftDown))); 113 ::mus::mojom::kEventFlagShiftDown)));
113 } 114 }
114 115
115 } // namespace mus 116 } // namespace mus
116 } // namespace ash 117 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698