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

Unified Diff: services/ui/public/cpp/input_devices/input_device_client.h

Issue 2196563004: Add tests for InputDeviceServer/InputDeviceClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch test runner. Created 4 years, 4 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: services/ui/public/cpp/input_devices/input_device_client.h
diff --git a/services/ui/public/cpp/input_devices/input_device_client.h b/services/ui/public/cpp/input_devices/input_device_client.h
index 54e578d7c53957d015b1e18d266c81331352061f..50a9fa1fb98463b690d3c81c2175cb7e9ce84ca1 100644
--- a/services/ui/public/cpp/input_devices/input_device_client.h
+++ b/services/ui/public/cpp/input_devices/input_device_client.h
@@ -47,7 +47,12 @@ class InputDeviceClient : public mojom::InputDeviceObserverMojo,
void AddObserver(ui::InputDeviceEventObserver* observer) override;
void RemoveObserver(ui::InputDeviceEventObserver* observer) override;
- private:
+ protected:
+ // Default constructor registers as InputDeviceManager. Can be subclassed in
+ // tests to avoid this.
+ explicit InputDeviceClient(bool is_input_device_manager);
+ mojom::InputDeviceObserverMojoPtr GetIntefacePtr();
+
// mojom::InputDeviceObserverMojo:
void OnKeyboardDeviceConfigurationChanged(
const std::vector<ui::InputDevice>& devices) override;
@@ -63,8 +68,11 @@ class InputDeviceClient : public mojom::InputDeviceObserverMojo,
const std::vector<ui::InputDevice>& mouse_devices,
const std::vector<ui::InputDevice>& touchpad_devices) override;
+ private:
mojo::Binding<mojom::InputDeviceObserverMojo> binding_;
+ bool is_input_device_manager_;
+
// Holds the list of input devices and signal that we have received the lists
// after initialization.
std::vector<ui::InputDevice> keyboard_devices_;
« no previous file with comments | « services/ui/public/cpp/input_devices/BUILD.gn ('k') | services/ui/public/cpp/input_devices/input_device_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698