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

Unified Diff: components/cryptauth/sync_scheduler_impl_unittest.cc

Issue 2502343003: Moved //components/proximity_auth/cryptauth to //components/cryptauth. (Closed)
Patch Set: Fixed proto #includes. Created 4 years, 1 month 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
« no previous file with comments | « components/cryptauth/sync_scheduler_impl.cc ('k') | components/proximity_auth/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cryptauth/sync_scheduler_impl_unittest.cc
diff --git a/components/proximity_auth/cryptauth/sync_scheduler_impl_unittest.cc b/components/cryptauth/sync_scheduler_impl_unittest.cc
similarity index 87%
rename from components/proximity_auth/cryptauth/sync_scheduler_impl_unittest.cc
rename to components/cryptauth/sync_scheduler_impl_unittest.cc
index 33983512581e49485a4dbc670845dab8738ad885..77b037c5da38b8907e0d9262e0d59fdd68788b15 100644
--- a/components/proximity_auth/cryptauth/sync_scheduler_impl_unittest.cc
+++ b/components/cryptauth/sync_scheduler_impl_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/proximity_auth/cryptauth/sync_scheduler_impl.h"
+#include "components/cryptauth/sync_scheduler_impl.h"
#include <utility>
@@ -11,7 +11,7 @@
#include "base/timer/mock_timer.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace proximity_auth {
+namespace cryptauth {
using Strategy = SyncScheduler::Strategy;
using SyncState = SyncScheduler::SyncState;
@@ -73,10 +73,10 @@ class TestSyncSchedulerImpl : public SyncSchedulerImpl {
} // namespace
-class ProximityAuthSyncSchedulerImplTest : public testing::Test,
- public SyncSchedulerImpl::Delegate {
+class CryptAuthSyncSchedulerImplTest : public testing::Test,
+ public SyncSchedulerImpl::Delegate {
protected:
- ProximityAuthSyncSchedulerImplTest()
+ CryptAuthSyncSchedulerImplTest()
: refresh_period_(base::TimeDelta::FromDays(kRefreshPeriodDays)),
base_recovery_period_(
base::TimeDelta::FromSeconds(kRecoveryPeriodSeconds)),
@@ -86,7 +86,7 @@ class ProximityAuthSyncSchedulerImplTest : public testing::Test,
base_recovery_period_,
0)) {}
- ~ProximityAuthSyncSchedulerImplTest() override {}
+ ~CryptAuthSyncSchedulerImplTest() override {}
void OnSyncRequested(
std::unique_ptr<SyncScheduler::SyncRequest> sync_request) override {
@@ -105,10 +105,10 @@ class ProximityAuthSyncSchedulerImplTest : public testing::Test,
std::unique_ptr<SyncScheduler::SyncRequest> sync_request_;
- DISALLOW_COPY_AND_ASSIGN(ProximityAuthSyncSchedulerImplTest);
+ DISALLOW_COPY_AND_ASSIGN(CryptAuthSyncSchedulerImplTest);
};
-TEST_F(ProximityAuthSyncSchedulerImplTest, ForceSyncSuccess) {
+TEST_F(CryptAuthSyncSchedulerImplTest, ForceSyncSuccess) {
scheduler_->Start(zero_elapsed_time_, Strategy::PERIODIC_REFRESH);
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
EXPECT_EQ(SyncState::WAITING_FOR_REFRESH, scheduler_->GetSyncState());
@@ -121,7 +121,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, ForceSyncSuccess) {
EXPECT_EQ(SyncState::WAITING_FOR_REFRESH, scheduler_->GetSyncState());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, ForceSyncFailure) {
+TEST_F(CryptAuthSyncSchedulerImplTest, ForceSyncFailure) {
scheduler_->Start(zero_elapsed_time_, Strategy::PERIODIC_REFRESH);
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
@@ -131,7 +131,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, ForceSyncFailure) {
EXPECT_EQ(Strategy::AGGRESSIVE_RECOVERY, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, PeriodicRefreshSuccess) {
+TEST_F(CryptAuthSyncSchedulerImplTest, PeriodicRefreshSuccess) {
EXPECT_EQ(SyncState::NOT_STARTED, scheduler_->GetSyncState());
scheduler_->Start(zero_elapsed_time_, Strategy::PERIODIC_REFRESH);
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
@@ -146,7 +146,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, PeriodicRefreshSuccess) {
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, PeriodicRefreshFailure) {
+TEST_F(CryptAuthSyncSchedulerImplTest, PeriodicRefreshFailure) {
scheduler_->Start(zero_elapsed_time_, Strategy::PERIODIC_REFRESH);
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
timer()->Fire();
@@ -154,7 +154,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, PeriodicRefreshFailure) {
EXPECT_EQ(Strategy::AGGRESSIVE_RECOVERY, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, AggressiveRecoverySuccess) {
+TEST_F(CryptAuthSyncSchedulerImplTest, AggressiveRecoverySuccess) {
scheduler_->Start(zero_elapsed_time_, Strategy::AGGRESSIVE_RECOVERY);
EXPECT_EQ(Strategy::AGGRESSIVE_RECOVERY, scheduler_->GetStrategy());
@@ -168,7 +168,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, AggressiveRecoverySuccess) {
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, AggressiveRecoveryFailure) {
+TEST_F(CryptAuthSyncSchedulerImplTest, AggressiveRecoveryFailure) {
scheduler_->Start(zero_elapsed_time_, Strategy::AGGRESSIVE_RECOVERY);
timer()->Fire();
@@ -176,7 +176,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, AggressiveRecoveryFailure) {
EXPECT_EQ(Strategy::AGGRESSIVE_RECOVERY, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, AggressiveRecoveryBackOff) {
+TEST_F(CryptAuthSyncSchedulerImplTest, AggressiveRecoveryBackOff) {
scheduler_->Start(zero_elapsed_time_, Strategy::AGGRESSIVE_RECOVERY);
base::TimeDelta last_recovery_period = base::TimeDelta::FromSeconds(0);
@@ -196,7 +196,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, AggressiveRecoveryBackOff) {
EXPECT_EQ(refresh_period_, last_recovery_period);
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, RefreshFailureRecoverySuccess) {
+TEST_F(CryptAuthSyncSchedulerImplTest, RefreshFailureRecoverySuccess) {
scheduler_->Start(zero_elapsed_time_, Strategy::PERIODIC_REFRESH);
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
@@ -209,7 +209,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, RefreshFailureRecoverySuccess) {
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, SyncImmediatelyForPeriodicRefresh) {
+TEST_F(CryptAuthSyncSchedulerImplTest, SyncImmediatelyForPeriodicRefresh) {
scheduler_->Start(base::TimeDelta::FromDays(kElapsedTimeDays),
Strategy::PERIODIC_REFRESH);
EXPECT_TRUE(scheduler_->GetTimeToNextSync().is_zero());
@@ -220,7 +220,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, SyncImmediatelyForPeriodicRefresh) {
EXPECT_EQ(Strategy::PERIODIC_REFRESH, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest,
+TEST_F(CryptAuthSyncSchedulerImplTest,
SyncImmediatelyForAggressiveRecovery) {
scheduler_->Start(base::TimeDelta::FromDays(kElapsedTimeDays),
Strategy::AGGRESSIVE_RECOVERY);
@@ -232,7 +232,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest,
EXPECT_EQ(Strategy::AGGRESSIVE_RECOVERY, scheduler_->GetStrategy());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, InitialSyncShorterByElapsedTime) {
+TEST_F(CryptAuthSyncSchedulerImplTest, InitialSyncShorterByElapsedTime) {
base::TimeDelta elapsed_time = base::TimeDelta::FromDays(2);
scheduler_->Start(elapsed_time, Strategy::PERIODIC_REFRESH);
EXPECT_EQ(refresh_period_ - elapsed_time, scheduler_->GetTimeToNextSync());
@@ -240,7 +240,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, InitialSyncShorterByElapsedTime) {
EXPECT_TRUE(sync_request_);
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, PeriodicRefreshJitter) {
+TEST_F(CryptAuthSyncSchedulerImplTest, PeriodicRefreshJitter) {
scheduler_.reset(new TestSyncSchedulerImpl(
this, refresh_period_, base_recovery_period_, kMaxJitterPercentage));
@@ -262,7 +262,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, PeriodicRefreshJitter) {
EXPECT_FALSE(cumulative_jitter.is_zero());
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, JitteredTimeDeltaIsNonNegative) {
+TEST_F(CryptAuthSyncSchedulerImplTest, JitteredTimeDeltaIsNonNegative) {
base::TimeDelta zero_delta = base::TimeDelta::FromSeconds(0);
double max_jitter_ratio = 1;
scheduler_.reset(new TestSyncSchedulerImpl(this, zero_delta, zero_delta,
@@ -279,7 +279,7 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, JitteredTimeDeltaIsNonNegative) {
}
}
-TEST_F(ProximityAuthSyncSchedulerImplTest, StartWithNegativeElapsedTime) {
+TEST_F(CryptAuthSyncSchedulerImplTest, StartWithNegativeElapsedTime) {
// This could happen in rare cases where the system clock changes.
scheduler_->Start(base::TimeDelta::FromDays(-1000),
Strategy::PERIODIC_REFRESH);
@@ -289,4 +289,4 @@ TEST_F(ProximityAuthSyncSchedulerImplTest, StartWithNegativeElapsedTime) {
EXPECT_EQ(zero_delta, timer()->GetCurrentDelay());
}
-} // namespace proximity_auth
+} // namespace cryptauth
« no previous file with comments | « components/cryptauth/sync_scheduler_impl.cc ('k') | components/proximity_auth/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698