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

Side by Side Diff: chrome/browser/sync/engine/process_updates_command_unittest.cc

Issue 8785015: Revert 112815 - [Sync] Make syncer commands avoid posting tasks on threads with no work to do (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/basictypes.h"
6 #include "base/memory/ref_counted.h"
7 #include "chrome/browser/sync/engine/process_updates_command.h"
8 #include "chrome/browser/sync/sessions/session_state.h"
9 #include "chrome/browser/sync/sessions/sync_session.h"
10 #include "chrome/browser/sync/syncable/model_type.h"
11 #include "chrome/browser/sync/syncable/syncable_id.h"
12 #include "chrome/browser/sync/test/engine/fake_model_worker.h"
13 #include "chrome/browser/sync/test/engine/syncer_command_test.h"
14 #include "testing/gtest/include/gtest/gtest.h"
15
16 namespace browser_sync {
17
18 namespace {
19
20 class ProcessUpdatesCommandTest : public SyncerCommandTest {
21 protected:
22 ProcessUpdatesCommandTest() {}
23 virtual ~ProcessUpdatesCommandTest() {}
24
25 virtual void SetUp() {
26 workers()->push_back(
27 make_scoped_refptr(new FakeModelWorker(GROUP_UI)));
28 workers()->push_back(
29 make_scoped_refptr(new FakeModelWorker(GROUP_DB)));
30 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI;
31 (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB;
32 SyncerCommandTest::SetUp();
33 }
34
35 ProcessUpdatesCommand command_;
36
37 private:
38 DISALLOW_COPY_AND_ASSIGN(ProcessUpdatesCommandTest);
39 };
40
41 TEST_F(ProcessUpdatesCommandTest, GetGroupsToChange) {
42 // TODO(akalin): Expect no groups to change here after we change
43 // ProcessUpdatesCommand back to use
44 // GetEnabledGroupsWithVerifiedUpdates().
45
46 // Add a verified update for GROUP_DB.
47 session()->mutable_status_controller()->
48 GetUnrestrictedMutableUpdateProgressForTest(GROUP_DB)->
49 AddVerifyResult(VerifyResult(), sync_pb::SyncEntity());
50
51 // TODO(akalin): Change this to just expect GROUP_DB after we change
52 // ProcessUpdatesCommand back to use
53 // GetEnabledGroupsWithVerifiedUpdates().
54 ExpectGroupsToChange(command_, GROUP_DB, GROUP_UI, GROUP_PASSIVE);
55 }
56
57 } // namespace
58
59 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/process_updates_command.cc ('k') | chrome/browser/sync/engine/resolve_conflicts_command.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698