OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chromeos/dbus/biod/fake_biod_client.h" | 5 #include "chromeos/dbus/biod/fake_biod_client.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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 fake_biod_client_.StartEnrollSession( | 56 fake_biod_client_.StartEnrollSession( |
57 id, label, base::Bind(&test_utils::CopyObjectPath, &returned_path)); | 57 id, label, base::Bind(&test_utils::CopyObjectPath, &returned_path)); |
58 task_runner_->RunUntilIdle(); | 58 task_runner_->RunUntilIdle(); |
59 EXPECT_NE(dbus::ObjectPath(), returned_path); | 59 EXPECT_NE(dbus::ObjectPath(), returned_path); |
60 | 60 |
61 // Send |fingerprint_data| size - 1 incomplete scans, then finish the | 61 // Send |fingerprint_data| size - 1 incomplete scans, then finish the |
62 // enrollment by sending a complete scan signal. | 62 // enrollment by sending a complete scan signal. |
63 for (size_t i = 0; i < fingerprint_data.size(); ++i) { | 63 for (size_t i = 0; i < fingerprint_data.size(); ++i) { |
64 fake_biod_client_.SendEnrollScanDone( | 64 fake_biod_client_.SendEnrollScanDone( |
65 fingerprint_data[i], SCAN_RESULT_SUCCESS, | 65 fingerprint_data[i], SCAN_RESULT_SUCCESS, |
66 i == fingerprint_data.size() - 1 /* is_complete */); | 66 i == fingerprint_data.size() - 1 /* is_complete */, |
| 67 -1 /* percent_complete not supported*/); |
67 } | 68 } |
68 } | 69 } |
69 | 70 |
70 // Helper function which enrolls |n| fingerprints with the same |id|, |label| | 71 // Helper function which enrolls |n| fingerprints with the same |id|, |label| |
71 // and |fingerprint_data|. | 72 // and |fingerprint_data|. |
72 void EnrollNTestFingerprints(const std::string& id, | 73 void EnrollNTestFingerprints(const std::string& id, |
73 const std::string& label, | 74 const std::string& label, |
74 const std::vector<std::string>& fingerprint_data, | 75 const std::vector<std::string>& fingerprint_data, |
75 int n) { | 76 int n) { |
76 for (int i = 0; i < n; ++i) | 77 for (int i = 0; i < n; ++i) |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 fake_biod_client_.SetRecordLabel( | 309 fake_biod_client_.SetRecordLabel( |
309 enrollment_paths[1], kNewLabelTwo, | 310 enrollment_paths[1], kNewLabelTwo, |
310 base::Bind(&test_utils::CopyDBusMethodCallStatus, &returned_status)); | 311 base::Bind(&test_utils::CopyDBusMethodCallStatus, &returned_status)); |
311 fake_biod_client_.RequestRecordLabel( | 312 fake_biod_client_.RequestRecordLabel( |
312 enrollment_paths[1], base::Bind(&test_utils::CopyString, &returned_str)); | 313 enrollment_paths[1], base::Bind(&test_utils::CopyString, &returned_str)); |
313 task_runner_->RunUntilIdle(); | 314 task_runner_->RunUntilIdle(); |
314 EXPECT_EQ(kNewLabelTwo, returned_str); | 315 EXPECT_EQ(kNewLabelTwo, returned_str); |
315 } | 316 } |
316 | 317 |
317 } // namespace chromeos | 318 } // namespace chromeos |
OLD | NEW |