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

Unified Diff: sync/sessions/sync_session_context_unittest.cc

Issue 10454105: sync: Refactor per-datatype throttling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 6 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
« no previous file with comments | « sync/sessions/sync_session_context.cc ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session_context_unittest.cc
diff --git a/sync/sessions/sync_session_context_unittest.cc b/sync/sessions/sync_session_context_unittest.cc
deleted file mode 100644
index 1b0a11a1d102fcaf7364d1fa1e54fc154f9d897d..0000000000000000000000000000000000000000
--- a/sync/sessions/sync_session_context_unittest.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sync/sessions/sync_session_context.h"
-
-#include "sync/internal_api/public/syncable/model_type.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace browser_sync {
-namespace sessions {
-TEST(SyncSessionContextTest, AddUnthrottleTimeTest) {
- const syncable::ModelTypeSet types(
- syncable::BOOKMARKS, syncable::PASSWORDS);
-
- SyncSessionContext context;
- base::TimeTicks now = base::TimeTicks::Now();
- context.SetUnthrottleTime(types, now);
-
- EXPECT_EQ(context.unthrottle_times_.size(), 2U);
- EXPECT_EQ(context.unthrottle_times_[syncable::BOOKMARKS], now);
- EXPECT_EQ(context.unthrottle_times_[syncable::PASSWORDS], now);
-}
-
-TEST(SyncSessionContextTest, GetCurrentlyThrottledTypesTest) {
- const syncable::ModelTypeSet types(
- syncable::BOOKMARKS, syncable::PASSWORDS);
-
- SyncSessionContext context;
- base::TimeTicks now = base::TimeTicks::Now();
-
- // Now update the throttled types with time set to 10 seconds earlier from
- // now.
- context.SetUnthrottleTime(types, now - base::TimeDelta::FromSeconds(10));
- context.PruneUnthrottledTypes(base::TimeTicks::Now());
- EXPECT_TRUE(context.GetThrottledTypes().Empty());
-
- // Now update the throttled types with time set to 2 hours from now.
- context.SetUnthrottleTime(types, now + base::TimeDelta::FromSeconds(1200));
- context.PruneUnthrottledTypes(base::TimeTicks::Now());
- EXPECT_TRUE(context.GetThrottledTypes().Equals(types));
-}
-} // namespace sessions.
-} // namespace browser_sync
-
« no previous file with comments | « sync/sessions/sync_session_context.cc ('k') | sync/sessions/sync_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698