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

Unified Diff: chromeos/dbus/biod/fake_biod_client.cc

Issue 2578323004: cros: Fake implementation of DBUS biometrics client. (Closed)
Patch Set: Oopsies. Created 3 years, 8 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
« no previous file with comments | « chromeos/dbus/biod/fake_biod_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/biod/fake_biod_client.cc
diff --git a/chromeos/dbus/biod/fake_biod_client.cc b/chromeos/dbus/biod/fake_biod_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0ff6ab5d9cf9732bdd43d4da22f608e819f405e0
--- /dev/null
+++ b/chromeos/dbus/biod/fake_biod_client.cc
@@ -0,0 +1,94 @@
+// Copyright 2017 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 "chromeos/dbus/biod/fake_biod_client.h"
+
+#include "base/bind.h"
+#include "base/single_thread_task_runner.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "dbus/object_path.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
+
+namespace chromeos {
+
+FakeBiodClient::FakeBiodClient() {}
+
+FakeBiodClient::~FakeBiodClient() {}
+
+void FakeBiodClient::SendEnrollScanDone(biod::ScanResult type_result,
+ bool is_complete) {
+ for (auto& observer : observers_)
+ observer.BiodEnrollScanDoneReceived(type_result, is_complete);
+}
+
+void FakeBiodClient::SendAuthScanDone(biod::ScanResult type_result,
+ const AuthScanMatches& matches) {
+ for (auto& observer : observers_)
+ observer.BiodAuthScanDoneReceived(type_result, matches);
+}
+
+void FakeBiodClient::SendSessionFailed() {
+ for (auto& observer : observers_)
+ observer.BiodSessionFailedReceived();
+}
+
+void FakeBiodClient::Init(dbus::Bus* bus) {}
+
+void FakeBiodClient::AddObserver(Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void FakeBiodClient::RemoveObserver(Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+bool FakeBiodClient::HasObserver(const Observer* observer) const {
+ return observers_.HasObserver(observer);
+}
+
+void FakeBiodClient::StartEnrollSession(const std::string& /* user_id */,
+ const std::string& /* label */,
+ const ObjectPathCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, dbus::ObjectPath()));
+}
+
+void FakeBiodClient::GetRecordsForUser(const std::string& /* user_id */,
+ const UserRecordsCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, std::vector<dbus::ObjectPath>()));
+}
+
+void FakeBiodClient::DestroyAllRecords() {}
+
+void FakeBiodClient::StartAuthSession(const ObjectPathCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, dbus::ObjectPath()));
+}
+
+void FakeBiodClient::RequestType(const BiometricTypeCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, biod::BiometricType::BIOMETRIC_TYPE_UNKNOWN));
+}
+
+void FakeBiodClient::CancelEnrollSession(
+ const dbus::ObjectPath& /* enroll_session_path */) {}
+
+void FakeBiodClient::EndAuthSession(
+ const dbus::ObjectPath& /* auth_session_path */) {}
+
+void FakeBiodClient::SetRecordLabel(const dbus::ObjectPath& /* record_path */,
+ const std::string& /* label */) {}
+
+void FakeBiodClient::RemoveRecord(const dbus::ObjectPath& /* record_path */) {}
+
+void FakeBiodClient::RequestRecordLabel(
+ const dbus::ObjectPath& /* record_path */,
+ const LabelCallback& callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(callback, ""));
+}
+
+} // namespace chromeos
« no previous file with comments | « chromeos/dbus/biod/fake_biod_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698