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

Side by Side Diff: components/proximity_auth/proximity_monitor_impl_unittest.cc

Issue 2898513002: [EasyUnlock] Observe proximity changes and clean up TX power strategy. (Closed)
Patch Set: fix_unittest Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/proximity_auth/proximity_monitor_impl.h" 5 #include "components/proximity_auth/proximity_monitor_impl.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 20 matching lines...) Expand all
31 using testing::SaveArg; 31 using testing::SaveArg;
32 32
33 namespace proximity_auth { 33 namespace proximity_auth {
34 namespace { 34 namespace {
35 35
36 const char kRemoteDeviceUserId[] = "example@gmail.com"; 36 const char kRemoteDeviceUserId[] = "example@gmail.com";
37 const char kRemoteDevicePublicKey[] = "Remote Public Key"; 37 const char kRemoteDevicePublicKey[] = "Remote Public Key";
38 const char kRemoteDeviceName[] = "LGE Nexus 5"; 38 const char kRemoteDeviceName[] = "LGE Nexus 5";
39 const char kBluetoothAddress[] = "AA:BB:CC:DD:EE:FF"; 39 const char kBluetoothAddress[] = "AA:BB:CC:DD:EE:FF";
40 const char kPersistentSymmetricKey[] = "PSK"; 40 const char kPersistentSymmetricKey[] = "PSK";
41 const int kRssiThreshold = -45; 41 const int kRssiThreshold = -50;
42 42
43 class MockProximityMonitorObserver : public ProximityMonitorObserver { 43 class MockProximityMonitorObserver : public ProximityMonitorObserver {
44 public: 44 public:
45 MockProximityMonitorObserver() {} 45 MockProximityMonitorObserver() {}
46 ~MockProximityMonitorObserver() override {} 46 ~MockProximityMonitorObserver() override {}
47 47
48 MOCK_METHOD0(OnProximityStateChanged, void()); 48 MOCK_METHOD0(OnProximityStateChanged, void());
49 49
50 private: 50 private:
51 DISALLOW_COPY_AND_ASSIGN(MockProximityMonitorObserver); 51 DISALLOW_COPY_AND_ASSIGN(MockProximityMonitorObserver);
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 base::HistogramTester histogram_tester; 348 base::HistogramTester histogram_tester;
349 monitor.RecordProximityMetricsOnAuthSuccess(); 349 monitor.RecordProximityMetricsOnAuthSuccess();
350 histogram_tester.ExpectUniqueSample("EasyUnlock.AuthProximity.RollingRssi", 350 histogram_tester.ExpectUniqueSample("EasyUnlock.AuthProximity.RollingRssi",
351 127, 1); 351 127, 1);
352 histogram_tester.ExpectUniqueSample( 352 histogram_tester.ExpectUniqueSample(
353 "EasyUnlock.AuthProximity.RemoteDeviceModelHash", 353 "EasyUnlock.AuthProximity.RemoteDeviceModelHash",
354 -1808066424 /* hash of "Unknown" */, 1); 354 -1808066424 /* hash of "Unknown" */, 1);
355 } 355 }
356 356
357 } // namespace proximity_auth 357 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/proximity_monitor_impl.cc ('k') | components/proximity_auth/screenlock_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698