Commit 534308ed authored by Kim Paulhamus's avatar Kim Paulhamus Committed by Commit Bot

Move all hid-related fido code into its own directory

Change-Id: I4ca5334941a9f7d83f8a84bbb0f5feffbed2e5ff
Reviewed-on: https://chromium-review.googlesource.com/1145949Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Kim Paulhamus <kpaulhamus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577250}
parent b47e22b6
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "content/public/test/test_service_manager_context.h" #include "content/public/test/test_service_manager_context.h"
#include "content/test/test_render_frame_host.h" #include "content/test/test_render_frame_host.h"
#include "device/base/features.h" #include "device/base/features.h"
#include "device/fido/fake_hid_impl_for_testing.h" #include "device/fido/hid/fake_hid_impl_for_testing.h"
#include "device/fido/scoped_virtual_fido_device.h" #include "device/fido/scoped_virtual_fido_device.h"
#include "device/fido/test_callback_receiver.h" #include "device/fido/test_callback_receiver.h"
#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/binding.h"
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#include "content/test/did_commit_provisional_load_interceptor.h" #include "content/test/did_commit_provisional_load_interceptor.h"
#include "device/base/features.h" #include "device/base/features.h"
#include "device/fido/fake_fido_discovery.h" #include "device/fido/fake_fido_discovery.h"
#include "device/fido/fake_hid_impl_for_testing.h"
#include "device/fido/fido_test_data.h" #include "device/fido/fido_test_data.h"
#include "device/fido/hid/fake_hid_impl_for_testing.h"
#include "device/fido/mock_fido_device.h" #include "device/fido/mock_fido_device.h"
#include "device/fido/scoped_virtual_fido_device.h" #include "device/fido/scoped_virtual_fido_device.h"
#include "device/fido/test_callback_receiver.h" #include "device/fido/test_callback_receiver.h"
......
...@@ -74,11 +74,11 @@ test("device_unittests") { ...@@ -74,11 +74,11 @@ test("device_unittests") {
"fido/fido_cable_discovery_unittest.cc", "fido/fido_cable_discovery_unittest.cc",
"fido/fido_cable_handshake_handler_unittest.cc", "fido/fido_cable_handshake_handler_unittest.cc",
"fido/fido_discovery_unittest.cc", "fido/fido_discovery_unittest.cc",
"fido/fido_hid_message_unittest.cc",
"fido/fido_parsing_utils_unittest.cc", "fido/fido_parsing_utils_unittest.cc",
"fido/fido_request_handler_unittest.cc", "fido/fido_request_handler_unittest.cc",
"fido/get_assertion_handler_unittest.cc", "fido/get_assertion_handler_unittest.cc",
"fido/get_assertion_task_unittest.cc", "fido/get_assertion_task_unittest.cc",
"fido/hid/fido_hid_message_unittest.cc",
"fido/mac/browsing_data_deletion_unittest.mm", "fido/mac/browsing_data_deletion_unittest.mm",
"fido/mac/credential_metadata_unittest.cc", "fido/mac/credential_metadata_unittest.cc",
"fido/mac/get_assertion_operation_unittest_mac.mm", "fido/mac/get_assertion_operation_unittest_mac.mm",
...@@ -130,8 +130,8 @@ test("device_unittests") { ...@@ -130,8 +130,8 @@ test("device_unittests") {
# Linux, requires udev. # Linux, requires udev.
if (!is_linux_without_udev && !is_android) { if (!is_linux_without_udev && !is_android) {
sources += [ sources += [
"fido/fido_hid_device_unittest.cc", "fido/hid/fido_hid_device_unittest.cc",
"fido/fido_hid_discovery_unittest.cc", "fido/hid/fido_hid_discovery_unittest.cc",
] ]
deps += [ deps += [
"//device/fido:test_support", "//device/fido:test_support",
......
...@@ -68,10 +68,6 @@ component("fido") { ...@@ -68,10 +68,6 @@ component("fido") {
"fido_device_authenticator.h", "fido_device_authenticator.h",
"fido_discovery.cc", "fido_discovery.cc",
"fido_discovery.h", "fido_discovery.h",
"fido_hid_message.cc",
"fido_hid_message.h",
"fido_hid_packet.cc",
"fido_hid_packet.h",
"fido_parsing_utils.cc", "fido_parsing_utils.cc",
"fido_parsing_utils.h", "fido_parsing_utils.h",
"fido_request_handler.h", "fido_request_handler.h",
...@@ -84,6 +80,10 @@ component("fido") { ...@@ -84,6 +80,10 @@ component("fido") {
"get_assertion_request_handler.h", "get_assertion_request_handler.h",
"get_assertion_task.cc", "get_assertion_task.cc",
"get_assertion_task.h", "get_assertion_task.h",
"hid/fido_hid_message.cc",
"hid/fido_hid_message.h",
"hid/fido_hid_packet.cc",
"hid/fido_hid_packet.h",
"make_credential_request_handler.cc", "make_credential_request_handler.cc",
"make_credential_request_handler.h", "make_credential_request_handler.h",
"make_credential_task.cc", "make_credential_task.cc",
...@@ -141,10 +141,10 @@ component("fido") { ...@@ -141,10 +141,10 @@ component("fido") {
# HID is not supported on Android. # HID is not supported on Android.
if (!is_android) { if (!is_android) {
sources += [ sources += [
"fido_hid_device.cc", "hid/fido_hid_device.cc",
"fido_hid_device.h", "hid/fido_hid_device.h",
"fido_hid_discovery.cc", "hid/fido_hid_discovery.cc",
"fido_hid_discovery.h", "hid/fido_hid_discovery.h",
] ]
deps += [ deps += [
...@@ -205,7 +205,7 @@ source_set("mocks") { ...@@ -205,7 +205,7 @@ source_set("mocks") {
fuzzer_test("fido_hid_message_fuzzer") { fuzzer_test("fido_hid_message_fuzzer") {
sources = [ sources = [
"fido_hid_message_fuzzer.cc", "hid/fido_hid_message_fuzzer.cc",
] ]
deps = [ deps = [
":fido", ":fido",
...@@ -272,8 +272,8 @@ source_set("test_support") { ...@@ -272,8 +272,8 @@ source_set("test_support") {
# Android doesn't compile. Linux requires udev. # Android doesn't compile. Linux requires udev.
if (!is_linux_without_udev && !is_android) { if (!is_linux_without_udev && !is_android) {
sources += [ sources += [
"fake_hid_impl_for_testing.cc", "hid/fake_hid_impl_for_testing.cc",
"fake_hid_impl_for_testing.h", "hid/fake_hid_impl_for_testing.h",
] ]
} }
} }
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
// HID is not supported on Android. // HID is not supported on Android.
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
#include "device/fido/fido_hid_discovery.h" #include "device/fido/hid/fido_hid_discovery.h"
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
namespace device { namespace device {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fake_hid_impl_for_testing.h" #include "device/fido/hid/fake_hid_impl_for_testing.h"
#include <utility> #include <utility>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef DEVICE_FIDO_FAKE_HID_IMPL_FOR_TESTING_H_ #ifndef DEVICE_FIDO_HID_FAKE_HID_IMPL_FOR_TESTING_H_
#define DEVICE_FIDO_FAKE_HID_IMPL_FOR_TESTING_H_ #define DEVICE_FIDO_HID_FAKE_HID_IMPL_FOR_TESTING_H_
#include <map> #include <map>
#include <string> #include <string>
...@@ -120,4 +120,4 @@ class FakeHidManager : public device::mojom::HidManager { ...@@ -120,4 +120,4 @@ class FakeHidManager : public device::mojom::HidManager {
} // namespace device } // namespace device
#endif // DEVICE_FIDO_FAKE_HID_IMPL_FOR_TESTING_H_ #endif // DEVICE_FIDO_HID_FAKE_HID_IMPL_FOR_TESTING_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_hid_device.h" #include "device/fido/hid/fido_hid_device.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "crypto/random.h" #include "crypto/random.h"
#include "device/fido/fido_hid_message.h" #include "device/fido/hid/fido_hid_message.h"
#include "mojo/public/cpp/bindings/interface_request.h" #include "mojo/public/cpp/bindings/interface_request.h"
namespace device { namespace device {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef DEVICE_FIDO_FIDO_HID_DEVICE_H_ #ifndef DEVICE_FIDO_HID_FIDO_HID_DEVICE_H_
#define DEVICE_FIDO_FIDO_HID_DEVICE_H_ #define DEVICE_FIDO_HID_FIDO_HID_DEVICE_H_
#include <string> #include <string>
#include <utility> #include <utility>
...@@ -120,4 +120,4 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoHidDevice : public FidoDevice { ...@@ -120,4 +120,4 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoHidDevice : public FidoDevice {
} // namespace device } // namespace device
#endif // DEVICE_FIDO_FIDO_HID_DEVICE_H_ #endif // DEVICE_FIDO_HID_FIDO_HID_DEVICE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_hid_device.h" #include "device/fido/hid/fido_hid_device.h"
#include <memory> #include <memory>
#include <tuple> #include <tuple>
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "device/fido/fake_hid_impl_for_testing.h"
#include "device/fido/fido_constants.h" #include "device/fido/fido_constants.h"
#include "device/fido/fido_parsing_utils.h" #include "device/fido/fido_parsing_utils.h"
#include "device/fido/hid/fake_hid_impl_for_testing.h"
#include "device/fido/test_callback_receiver.h" #include "device/fido/test_callback_receiver.h"
#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/interface_request.h" #include "mojo/public/cpp/bindings/interface_request.h"
...@@ -256,13 +256,12 @@ TEST_F(FidoHidDeviceTest, TestRetryChannelAllocation) { ...@@ -256,13 +256,12 @@ TEST_F(FidoHidDeviceTest, TestRetryChannelAllocation) {
EXPECT_CALL(mock_connection, ReadPtr(_)) EXPECT_CALL(mock_connection, ReadPtr(_))
// First response to HID_INIT request with an incorrect nonce. // First response to HID_INIT request with an incorrect nonce.
.WillOnce( .WillOnce(Invoke([kIncorrectNonce, &mock_connection](auto* cb) {
Invoke([kIncorrectNonce, &mock_connection](auto* cb) { std::move(*cb).Run(
std::move(*cb).Run( true, 0,
true, 0, CreateMockInitResponse(kIncorrectNonce,
CreateMockInitResponse( mock_connection.connection_channel_id()));
kIncorrectNonce, mock_connection.connection_channel_id())); }))
}))
// Second response to HID_INIT request with a correct nonce. // Second response to HID_INIT request with a correct nonce.
.WillOnce(Invoke( .WillOnce(Invoke(
[&mock_connection](device::mojom::HidConnection::ReadCallback* cb) { [&mock_connection](device::mojom::HidConnection::ReadCallback* cb) {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_hid_discovery.h" #include "device/fido/hid/fido_hid_discovery.h"
#include <utility> #include <utility>
#include "device/fido/fido_hid_device.h" #include "device/fido/hid/fido_hid_device.h"
#include "mojo/public/cpp/bindings/interface_request.h" #include "mojo/public/cpp/bindings/interface_request.h"
#include "services/device/public/mojom/constants.mojom.h" #include "services/device/public/mojom/constants.mojom.h"
#include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/connector.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef DEVICE_FIDO_FIDO_HID_DISCOVERY_H_ #ifndef DEVICE_FIDO_HID_FIDO_HID_DISCOVERY_H_
#define DEVICE_FIDO_FIDO_HID_DISCOVERY_H_ #define DEVICE_FIDO_HID_FIDO_HID_DISCOVERY_H_
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -53,4 +53,4 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoHidDiscovery ...@@ -53,4 +53,4 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoHidDiscovery
} // namespace device } // namespace device
#endif // DEVICE_FIDO_FIDO_HID_DISCOVERY_H_ #endif // DEVICE_FIDO_HID_FIDO_HID_DISCOVERY_H_
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_hid_discovery.h" #include "device/fido/hid/fido_hid_discovery.h"
#include <string> #include <string>
#include <utility> #include <utility>
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "device/fido/fake_hid_impl_for_testing.h" #include "device/fido/hid/fake_hid_impl_for_testing.h"
#include "device/fido/fido_hid_device.h" #include "device/fido/hid/fido_hid_device.h"
#include "device/fido/mock_fido_discovery_observer.h" #include "device/fido/mock_fido_discovery_observer.h"
#include "services/device/public/mojom/constants.mojom.h" #include "services/device/public/mojom/constants.mojom.h"
#include "services/device/public/mojom/hid.mojom.h" #include "services/device/public/mojom/hid.mojom.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_hid_message.h" #include "device/fido/hid/fido_hid_message.h"
#include <algorithm> #include <algorithm>
#include <numeric> #include <numeric>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef DEVICE_FIDO_FIDO_HID_MESSAGE_H_ #ifndef DEVICE_FIDO_HID_FIDO_HID_MESSAGE_H_
#define DEVICE_FIDO_FIDO_HID_MESSAGE_H_ #define DEVICE_FIDO_HID_FIDO_HID_MESSAGE_H_
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/optional.h" #include "base/optional.h"
#include "device/fido/fido_constants.h" #include "device/fido/fido_constants.h"
#include "device/fido/fido_hid_packet.h" #include "device/fido/hid/fido_hid_packet.h"
namespace device { namespace device {
...@@ -72,4 +72,4 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoHidMessage { ...@@ -72,4 +72,4 @@ class COMPONENT_EXPORT(DEVICE_FIDO) FidoHidMessage {
} // namespace device } // namespace device
#endif // DEVICE_FIDO_FIDO_HID_MESSAGE_H_ #endif // DEVICE_FIDO_HID_FIDO_HID_MESSAGE_H_
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <vector> #include <vector>
#include "base/containers/span.h" #include "base/containers/span.h"
#include "device/fido/fido_hid_message.h" #include "device/fido/hid/fido_hid_message.h"
namespace device { namespace device {
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_hid_message.h" #include "device/fido/hid/fido_hid_message.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#include "device/fido/fido_constants.h" #include "device/fido/fido_constants.h"
#include "device/fido/fido_hid_packet.h" #include "device/fido/hid/fido_hid_packet.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "device/fido/fido_hid_packet.h" #include "device/fido/hid/fido_hid_packet.h"
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef DEVICE_FIDO_FIDO_HID_PACKET_H_ #ifndef DEVICE_FIDO_HID_FIDO_HID_PACKET_H_
#define DEVICE_FIDO_FIDO_HID_PACKET_H_ #define DEVICE_FIDO_HID_FIDO_HID_PACKET_H_
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment