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

Unified Diff: chrome/browser/chromeos/device/input_service_proxy_factory.cc

Issue 913773002: Created fakes for HID-detection screen testing. Initial browsertest added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/device/input_service_proxy_factory.cc
diff --git a/chrome/browser/chromeos/device/input_service_proxy_factory.cc b/chrome/browser/chromeos/device/input_service_proxy_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..577e7c76b47e662c690e6bc5ad788d60a1abfab4
--- /dev/null
+++ b/chrome/browser/chromeos/device/input_service_proxy_factory.cc
@@ -0,0 +1,31 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/device/input_service_proxy_factory.h"
+
+#include "chrome/browser/chromeos/device/fake_input_service_proxy.h"
+
+namespace chromeos {
+
+// static
+InputServiceProxy* InputServiceProxyFactory::GetProxy() {
+ if (in_fake_mode_)
+ return static_cast<InputServiceProxy*>(new FakeInputServiceProxy);
Nikita (slow) 2015/02/11 14:53:07 drop static_cast<>
merkulova 2015/02/13 10:00:04 Done.
+ return new InputServiceProxy();
+}
+
+// static
+bool InputServiceProxyFactory::in_fake_mode_ = false;
Nikita (slow) 2015/02/11 14:53:07 nit: use_fake_instance_
merkulova 2015/02/13 10:00:04 Done.
+
+// static
+void InputServiceProxyFactory::SetFakeForTesting(bool to_fake) {
Nikita (slow) 2015/02/11 14:53:07 nit: bool use_fake_instance
merkulova 2015/02/13 10:00:04 Done.
+ in_fake_mode_ = to_fake;
+}
+
+// static
+bool InputServiceProxyFactory::IsFakeSetForTesting() {
+ return in_fake_mode_;
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698