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

Side by Side Diff: mash/wm/accelerator_registrar_apptest.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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/non_client_frame_controller.h » ('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"
11 #include "components/mus/public/cpp/window.h" 11 #include "components/mus/public/cpp/window.h"
12 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h" 12 #include "components/mus/public/interfaces/accelerator_registrar.mojom.h"
13 #include "mojo/public/cpp/bindings/binding.h" 13 #include "mojo/public/cpp/bindings/binding.h"
14 #include "mojo/shell/public/cpp/application_impl.h"
15 #include "mojo/shell/public/cpp/application_test_base.h" 14 #include "mojo/shell/public/cpp/application_test_base.h"
16 15
17 using mus::mojom::AcceleratorHandler; 16 using mus::mojom::AcceleratorHandler;
18 using mus::mojom::AcceleratorHandlerPtr; 17 using mus::mojom::AcceleratorHandlerPtr;
19 using mus::mojom::AcceleratorRegistrar; 18 using mus::mojom::AcceleratorRegistrar;
20 using mus::mojom::AcceleratorRegistrarPtr; 19 using mus::mojom::AcceleratorRegistrarPtr;
21 20
22 namespace mash { 21 namespace mash {
23 namespace wm { 22 namespace wm {
24 23
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 DISALLOW_COPY_AND_ASSIGN(TestAcceleratorHandler); 65 DISALLOW_COPY_AND_ASSIGN(TestAcceleratorHandler);
67 }; 66 };
68 67
69 class AcceleratorRegistrarTest : public mojo::test::ApplicationTestBase { 68 class AcceleratorRegistrarTest : public mojo::test::ApplicationTestBase {
70 public: 69 public:
71 AcceleratorRegistrarTest() {} 70 AcceleratorRegistrarTest() {}
72 ~AcceleratorRegistrarTest() override {} 71 ~AcceleratorRegistrarTest() override {}
73 72
74 protected: 73 protected:
75 void ConnectToRegistrar(AcceleratorRegistrarPtr* registrar) { 74 void ConnectToRegistrar(AcceleratorRegistrarPtr* registrar) {
76 application_impl()->ConnectToService("mojo:desktop_wm", registrar); 75 shell()->ConnectToService("mojo:desktop_wm", registrar);
77 } 76 }
78 77
79 private: 78 private:
80 DISALLOW_COPY_AND_ASSIGN(AcceleratorRegistrarTest); 79 DISALLOW_COPY_AND_ASSIGN(AcceleratorRegistrarTest);
81 }; 80 };
82 81
83 TEST_F(AcceleratorRegistrarTest, AcceleratorRegistrarBasic) { 82 TEST_F(AcceleratorRegistrarTest, AcceleratorRegistrarBasic) {
84 AcceleratorRegistrarPtr registrar_first; 83 AcceleratorRegistrarPtr registrar_first;
85 ConnectToRegistrar(&registrar_first); 84 ConnectToRegistrar(&registrar_first);
86 TestAcceleratorHandler handler_first(std::move(registrar_first)); 85 TestAcceleratorHandler handler_first(std::move(registrar_first));
(...skipping 19 matching lines...) Expand all
106 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator( 105 EXPECT_FALSE(handler_first.AttemptToInstallAccelerator(
107 3, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N, 106 3, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N,
108 mus::mojom::kEventFlagShiftDown))); 107 mus::mojom::kEventFlagShiftDown)));
109 EXPECT_FALSE(handler_second.AttemptToInstallAccelerator( 108 EXPECT_FALSE(handler_second.AttemptToInstallAccelerator(
110 3, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N, 109 3, mus::CreateKeyMatcher(mus::mojom::KeyboardCode::N,
111 mus::mojom::kEventFlagShiftDown))); 110 mus::mojom::kEventFlagShiftDown)));
112 } 111 }
113 112
114 } // namespace wm 113 } // namespace wm
115 } // namespace mash 114 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wallpaper/wallpaper.cc ('k') | mash/wm/non_client_frame_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698