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

Side by Side Diff: chrome/browser/sync/sessions/sync_session_unittest.cc

Issue 7604019: [Sync] Add client-side plumbing for server control of sessions commit delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error and address comments Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.h ('k') | chrome/browser/sync/sessions/test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/sessions/sync_session.h" 5 #include "chrome/browser/sync/sessions/sync_session.h"
6 6
7 #include "base/compiler_specific.h"
7 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
8 #include "base/tracked.h" 9 #include "base/tracked.h"
9 #include "chrome/browser/sync/engine/conflict_resolver.h" 10 #include "chrome/browser/sync/engine/conflict_resolver.h"
10 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" 11 #include "chrome/browser/sync/engine/mock_model_safe_workers.h"
11 #include "chrome/browser/sync/engine/syncer_types.h" 12 #include "chrome/browser/sync/engine/syncer_types.h"
12 #include "chrome/browser/sync/engine/syncer_util.h" 13 #include "chrome/browser/sync/engine/syncer_util.h"
13 #include "chrome/browser/sync/syncable/directory_manager.h" 14 #include "chrome/browser/sync/syncable/directory_manager.h"
14 #include "chrome/browser/sync/syncable/model_type.h" 15 #include "chrome/browser/sync/syncable/model_type.h"
15 #include "chrome/browser/sync/syncable/syncable.h" 16 #include "chrome/browser/sync/syncable/syncable.h"
16 #include "chrome/test/sync/engine/test_directory_setter_upper.h" 17 #include "chrome/test/sync/engine/test_directory_setter_upper.h"
(...skipping 24 matching lines...) Expand all
41 routes_.clear(); 42 routes_.clear();
42 routes_[syncable::BOOKMARKS] = GROUP_UI; 43 routes_[syncable::BOOKMARKS] = GROUP_UI;
43 routes_[syncable::AUTOFILL] = GROUP_UI; 44 routes_[syncable::AUTOFILL] = GROUP_UI;
44 session_.reset(MakeSession()); 45 session_.reset(MakeSession());
45 } 46 }
46 virtual void TearDown() { 47 virtual void TearDown() {
47 session_.reset(); 48 session_.reset();
48 context_.reset(); 49 context_.reset();
49 } 50 }
50 51
51 virtual void OnSilencedUntil(const base::TimeTicks& silenced_until) { 52 virtual void OnSilencedUntil(const base::TimeTicks& silenced_until) OVERRIDE {
52 FailControllerInvocationIfDisabled("OnSilencedUntil"); 53 FailControllerInvocationIfDisabled("OnSilencedUntil");
53 } 54 }
54 virtual bool IsSyncingCurrentlySilenced() { 55 virtual bool IsSyncingCurrentlySilenced() OVERRIDE {
55 FailControllerInvocationIfDisabled("IsSyncingCurrentlySilenced"); 56 FailControllerInvocationIfDisabled("IsSyncingCurrentlySilenced");
56 return false; 57 return false;
57 } 58 }
58 virtual void OnReceivedLongPollIntervalUpdate( 59 virtual void OnReceivedLongPollIntervalUpdate(
59 const base::TimeDelta& new_interval) { 60 const base::TimeDelta& new_interval) OVERRIDE {
60 FailControllerInvocationIfDisabled("OnReceivedLongPollIntervalUpdate"); 61 FailControllerInvocationIfDisabled("OnReceivedLongPollIntervalUpdate");
61 } 62 }
62 virtual void OnReceivedShortPollIntervalUpdate( 63 virtual void OnReceivedShortPollIntervalUpdate(
63 const base::TimeDelta& new_interval) { 64 const base::TimeDelta& new_interval) OVERRIDE {
64 FailControllerInvocationIfDisabled("OnReceivedShortPollIntervalUpdate"); 65 FailControllerInvocationIfDisabled("OnReceivedShortPollIntervalUpdate");
65 } 66 }
66 virtual void OnShouldStopSyncingPermanently() { 67 virtual void OnReceivedSessionsCommitDelay(
68 const base::TimeDelta& new_delay) OVERRIDE {
69 FailControllerInvocationIfDisabled("OnReceivedSessionsCommitDelay");
70 }
71 virtual void OnShouldStopSyncingPermanently() OVERRIDE {
67 FailControllerInvocationIfDisabled("OnShouldStopSyncingPermanently"); 72 FailControllerInvocationIfDisabled("OnShouldStopSyncingPermanently");
68 } 73 }
69 74
70 // ModelSafeWorkerRegistrar implementation. 75 // ModelSafeWorkerRegistrar implementation.
71 virtual void GetWorkers(std::vector<ModelSafeWorker*>* out) {} 76 virtual void GetWorkers(std::vector<ModelSafeWorker*>* out) OVERRIDE {}
72 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) { 77 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) OVERRIDE {
73 out->swap(routes_); 78 out->swap(routes_);
74 } 79 }
75 80
76 StatusController* status() { return session_->status_controller(); } 81 StatusController* status() { return session_->status_controller(); }
77 protected: 82 protected:
78 void FailControllerInvocationIfDisabled(const std::string& msg) { 83 void FailControllerInvocationIfDisabled(const std::string& msg) {
79 if (!controller_invocations_allowed_) 84 if (!controller_invocations_allowed_)
80 FAIL() << msg; 85 FAIL() << msg;
81 } 86 }
82 87
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 EXPECT_EQ(empty_payload, original[syncable::BOOKMARKS]); 473 EXPECT_EQ(empty_payload, original[syncable::BOOKMARKS]);
469 EXPECT_EQ(payload1, original[syncable::PASSWORDS]); 474 EXPECT_EQ(payload1, original[syncable::PASSWORDS]);
470 EXPECT_EQ(payload1, original[syncable::AUTOFILL]); 475 EXPECT_EQ(payload1, original[syncable::AUTOFILL]);
471 EXPECT_EQ(payload2, original[syncable::SESSIONS]); 476 EXPECT_EQ(payload2, original[syncable::SESSIONS]);
472 EXPECT_EQ(payload3, original[syncable::THEMES]); 477 EXPECT_EQ(payload3, original[syncable::THEMES]);
473 } 478 }
474 479
475 } // namespace 480 } // namespace
476 } // namespace sessions 481 } // namespace sessions
477 } // namespace browser_sync 482 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.h ('k') | chrome/browser/sync/sessions/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698