blob: c46010d51c9b928595efb05687af19a376bb2abc [file] [log] [blame]
// Copyright 2020 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "biod/biod_config.h"
#include <cros_config/fake_cros_config.h>
#include <gtest/gtest.h>
namespace biod {
TEST(FingerprintUnsupportedTest, FingerprintLocationUnset) {
// Given a device that does not indicate fingerprint sensor location
brillo::FakeCrosConfig cros_config;
// expect FingerprintUnsupported to report false.
EXPECT_FALSE(FingerprintUnsupported(&cros_config));
}
TEST(FingerprintUnsupportedTest, FingerprintLocationSet) {
brillo::FakeCrosConfig cros_config;
cros_config.SetString(kCrosConfigFPPath, kCrosConfigFPLocation,
"power-button-top-left");
EXPECT_FALSE(FingerprintUnsupported(&cros_config));
}
TEST(FingerprintUnsupportedTest, FingerprintLocationSetNone) {
brillo::FakeCrosConfig cros_config;
cros_config.SetString(kCrosConfigFPPath, kCrosConfigFPLocation, "none");
EXPECT_TRUE(FingerprintUnsupported(&cros_config));
}
} // namespace biod