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

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

Issue 7190001: [Sync] Split DirectoryChangeListener for thread-safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix copyright Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 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 "base/tracked.h"
5 #include "chrome/browser/sync/engine/verify_updates_command.h" 6 #include "chrome/browser/sync/engine/verify_updates_command.h"
6 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" 7 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h"
7 #include "chrome/browser/sync/sessions/sync_session.h" 8 #include "chrome/browser/sync/sessions/sync_session.h"
8 #include "chrome/browser/sync/syncable/directory_manager.h" 9 #include "chrome/browser/sync/syncable/directory_manager.h"
9 #include "chrome/browser/sync/engine/mock_model_safe_workers.h" 10 #include "chrome/browser/sync/engine/mock_model_safe_workers.h"
10 #include "chrome/browser/sync/syncable/syncable.h" 11 #include "chrome/browser/sync/syncable/syncable.h"
11 #include "chrome/browser/sync/syncable/syncable_id.h" 12 #include "chrome/browser/sync/syncable/syncable_id.h"
12 #include "chrome/test/sync/engine/syncer_command_test.h" 13 #include "chrome/test/sync/engine/syncer_command_test.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
(...skipping 21 matching lines...) Expand all
36 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; 37 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI;
37 (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB; 38 (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB;
38 SyncerCommandTest::SetUp(); 39 SyncerCommandTest::SetUp();
39 } 40 }
40 41
41 void CreateLocalItem(const std::string& item_id, 42 void CreateLocalItem(const std::string& item_id,
42 const std::string& parent_id, 43 const std::string& parent_id,
43 const syncable::ModelType& type) { 44 const syncable::ModelType& type) {
44 ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); 45 ScopedDirLookup dir(syncdb()->manager(), syncdb()->name());
45 ASSERT_TRUE(dir.good()); 46 ASSERT_TRUE(dir.good());
46 WriteTransaction trans(dir, UNITTEST, __FILE__, __LINE__); 47 WriteTransaction trans(dir, UNITTEST, FROM_HERE);
47 MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM, 48 MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM,
48 Id::CreateFromServerId(item_id)); 49 Id::CreateFromServerId(item_id));
49 ASSERT_TRUE(entry.good()); 50 ASSERT_TRUE(entry.good());
50 51
51 entry.Put(syncable::BASE_VERSION, 1); 52 entry.Put(syncable::BASE_VERSION, 1);
52 entry.Put(syncable::SERVER_VERSION, 1); 53 entry.Put(syncable::SERVER_VERSION, 1);
53 entry.Put(syncable::NON_UNIQUE_NAME, item_id); 54 entry.Put(syncable::NON_UNIQUE_NAME, item_id);
54 entry.Put(syncable::PARENT_ID, Id::CreateFromServerId(parent_id)); 55 entry.Put(syncable::PARENT_ID, Id::CreateFromServerId(parent_id));
55 sync_pb::EntitySpecifics default_specifics; 56 sync_pb::EntitySpecifics default_specifics;
56 AddDefaultExtensionValue(type, &default_specifics); 57 AddDefaultExtensionValue(type, &default_specifics);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_DB); 99 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_DB);
99 EXPECT_EQ(1, status->update_progress().VerifiedUpdatesSize()); 100 EXPECT_EQ(1, status->update_progress().VerifiedUpdatesSize());
100 } 101 }
101 { 102 {
102 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_PASSIVE); 103 sessions::ScopedModelSafeGroupRestriction r(status, GROUP_PASSIVE);
103 EXPECT_EQ(0, status->update_progress().VerifiedUpdatesSize()); 104 EXPECT_EQ(0, status->update_progress().VerifiedUpdatesSize());
104 } 105 }
105 } 106 }
106 107
107 } 108 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/verify_updates_command.cc ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698