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

Unified Diff: components/proximity_auth/device_to_device_authenticator_unittest.cc

Issue 1356943004: Add RemoteDeviceLoader to create RemoteDevice from CryptAuth data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webui
Patch Set: move RemoteDevice creation in tests to util function Created 5 years, 3 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: components/proximity_auth/device_to_device_authenticator_unittest.cc
diff --git a/components/proximity_auth/device_to_device_authenticator_unittest.cc b/components/proximity_auth/device_to_device_authenticator_unittest.cc
index 17c260c826dbdace7a800e9384601b7771a83f5f..895fbee84d6b74b0da915110683e3e3e6ff417a3 100644
--- a/components/proximity_auth/device_to_device_authenticator_unittest.cc
+++ b/components/proximity_auth/device_to_device_authenticator_unittest.cc
@@ -12,6 +12,7 @@
#include "components/proximity_auth/cryptauth/base64url.h"
#include "components/proximity_auth/cryptauth/fake_secure_message_delegate.h"
#include "components/proximity_auth/device_to_device_responder_operations.h"
+#include "components/proximity_auth/proximity_auth_test_util.h"
#include "components/proximity_auth/secure_context.h"
#include "components/proximity_auth/wire_message.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -24,12 +25,6 @@ namespace {
// The account id of the user.
const char kAccountId[] = "example@gmail.com";
-// Attributes of the connected remote device.
-const char kRemoteDeviceName[] = "iPhone 6";
-const char kRemoteDevicePublicKey[] = "remote public key";
-const char kRemoteDeviceBluetoothAddress[] = "AA:BB:CC:DD:EE:FF";
-const char kRemoteDevicePersistentSymmetricKey[] = "PSK";
-
// The initiator's session public key in base64url form. Note that this is
// actually a serialized proto.
const char kInitiatorSessionPublicKeyBase64[] =
@@ -138,10 +133,7 @@ class DeviceToDeviceAuthenticatorForTest : public DeviceToDeviceAuthenticator {
class ProximityAuthDeviceToDeviceAuthenticatorTest : public testing::Test {
public:
ProximityAuthDeviceToDeviceAuthenticatorTest()
- : remote_device_(kRemoteDeviceName,
- kRemoteDevicePublicKey,
- kRemoteDeviceBluetoothAddress,
- kRemoteDevicePersistentSymmetricKey),
+ : remote_device_(CreateClassicRemoteDeviceForTest()),
connection_(remote_device_),
secure_message_delegate_(new FakeSecureMessageDelegate),
authenticator_(&connection_,
@@ -197,7 +189,7 @@ class ProximityAuthDeviceToDeviceAuthenticatorTest : public testing::Test {
std::string SimulateResponderAuth(const std::string& hello_message) {
std::string remote_device_private_key =
secure_message_delegate_->GetPrivateKeyForPublicKey(
- kRemoteDevicePublicKey);
+ kTestRemoteDevicePublicKey);
std::string responder_auth_message;
DeviceToDeviceResponderOperations::CreateResponderAuthMessage(

Powered by Google App Engine
This is Rietveld 408576698