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

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

Issue 193103: Build sync engine as part of the browser build (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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/engine/syncer_thread.cc ('k') | chrome/browser/sync/engine/syncer_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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 entry. 3 // found in the LICENSE entry.
4 // 4 //
5 // Syncer unit tests. Unfortunately a lot of these tests 5 // Syncer unit tests. Unfortunately a lot of these tests
6 // are outdated and need to be reworked and updated. 6 // are outdated and need to be reworked and updated.
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <strstream> 11 #include <strstream>
12 12
13 #include "base/at_exit.h" 13 #include "base/at_exit.h"
14 14
15 #include "base/scoped_ptr.h" 15 #include "base/scoped_ptr.h"
16 #include "build/build_config.h"
16 #include "chrome/browser/sync/engine/client_command_channel.h" 17 #include "chrome/browser/sync/engine/client_command_channel.h"
17 #include "chrome/browser/sync/engine/conflict_resolution_view.h" 18 #include "chrome/browser/sync/engine/conflict_resolution_view.h"
18 #include "chrome/browser/sync/engine/conflict_resolver.h" 19 #include "chrome/browser/sync/engine/conflict_resolver.h"
19 #include "chrome/browser/sync/engine/get_commit_ids_command.h" 20 #include "chrome/browser/sync/engine/get_commit_ids_command.h"
20 #include "chrome/browser/sync/engine/model_safe_worker.h" 21 #include "chrome/browser/sync/engine/model_safe_worker.h"
21 #include "chrome/browser/sync/engine/net/server_connection_manager.h" 22 #include "chrome/browser/sync/engine/net/server_connection_manager.h"
22 #include "chrome/browser/sync/engine/process_updates_command.h" 23 #include "chrome/browser/sync/engine/process_updates_command.h"
23 #include "chrome/browser/sync/engine/syncer.h" 24 #include "chrome/browser/sync/engine/syncer.h"
24 #include "chrome/browser/sync/engine/syncer_util.h" 25 #include "chrome/browser/sync/engine/syncer_util.h"
25 #include "chrome/browser/sync/engine/syncer_proto_util.h" 26 #include "chrome/browser/sync/engine/syncer_proto_util.h"
26 #include "chrome/browser/sync/engine/syncer_session.h" 27 #include "chrome/browser/sync/engine/syncer_session.h"
27 #include "chrome/browser/sync/protocol/sync.pb.h" 28 #include "chrome/browser/sync/protocol/sync.pb.h"
28 #include "chrome/browser/sync/syncable/directory_manager.h" 29 #include "chrome/browser/sync/syncable/directory_manager.h"
29 #include "chrome/browser/sync/syncable/syncable.h" 30 #include "chrome/browser/sync/syncable/syncable.h"
30 #include "chrome/browser/sync/util/character_set_converters.h" 31 #include "chrome/browser/sync/util/character_set_converters.h"
31 #include "chrome/browser/sync/util/compat-file.h" 32 #include "chrome/browser/sync/util/compat_file.h"
32 #include "chrome/browser/sync/util/event_sys-inl.h" 33 #include "chrome/browser/sync/util/event_sys-inl.h"
33 #include "chrome/test/sync/engine/mock_server_connection.h" 34 #include "chrome/test/sync/engine/mock_server_connection.h"
34 #include "chrome/test/sync/engine/test_directory_setter_upper.h" 35 #include "chrome/test/sync/engine/test_directory_setter_upper.h"
35 #include "chrome/test/sync/engine/test_id_factory.h" 36 #include "chrome/test/sync/engine/test_id_factory.h"
36 #include "testing/gtest/include/gtest/gtest.h" 37 #include "testing/gtest/include/gtest/gtest.h"
37 38
38 using std::map; 39 using std::map;
39 using std::multimap; 40 using std::multimap;
40 using std::set; 41 using std::set;
41 using std::string; 42 using std::string;
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 mock_server_->AddUpdateDirectory(1, 0, "", 1, 10); 928 mock_server_->AddUpdateDirectory(1, 0, "", 1, 10);
928 // And one legal one that we're going to delete. 929 // And one legal one that we're going to delete.
929 mock_server_->AddUpdateDirectory(2, 0, "FOO", 1, 10); 930 mock_server_->AddUpdateDirectory(2, 0, "FOO", 1, 10);
930 syncer_->SyncShare(); 931 syncer_->SyncShare();
931 // Delete the legal one. The new update has a null name. 932 // Delete the legal one. The new update has a null name.
932 mock_server_->AddUpdateDirectory(2, 0, "", 2, 20); 933 mock_server_->AddUpdateDirectory(2, 0, "", 2, 20);
933 mock_server_->SetLastUpdateDeleted(); 934 mock_server_->SetLastUpdateDeleted();
934 syncer_->SyncShare(); 935 syncer_->SyncShare();
935 } 936 }
936 937
937 #ifdef OS_WINDOWS 938 #ifdef OS_WIN
938 TEST_F(SyncerTest, NameSanitizationWithClientRename) { 939 TEST_F(SyncerTest, NameSanitizationWithClientRename) {
939 ScopedDirLookup dir(syncdb_.manager(), syncdb_.name()); 940 ScopedDirLookup dir(syncdb_.manager(), syncdb_.name());
940 ASSERT_TRUE(dir.good()); 941 ASSERT_TRUE(dir.good());
941 mock_server_->AddUpdateDirectory(1, 0, "okay", 1, 10); 942 mock_server_->AddUpdateDirectory(1, 0, "okay", 1, 10);
942 syncer_->SyncShare(); 943 syncer_->SyncShare();
943 { 944 {
944 ReadTransaction tr(dir, __FILE__, __LINE__); 945 ReadTransaction tr(dir, __FILE__, __LINE__);
945 Entry e(&tr, syncable::GET_BY_PARENTID_AND_NAME, tr.root_id(), 946 Entry e(&tr, syncable::GET_BY_PARENTID_AND_NAME, tr.root_id(),
946 PSTR("okay")); 947 PSTR("okay"));
947 ASSERT_TRUE(e.good()); 948 ASSERT_TRUE(e.good());
(...skipping 3629 matching lines...) Expand 10 before | Expand all | Expand 10 after
4577 Add(low_id_); 4578 Add(low_id_);
4578 Add(high_id_); 4579 Add(high_id_);
4579 syncer_->SyncShare(); 4580 syncer_->SyncShare();
4580 ExpectLocalOrderIsByServerId(); 4581 ExpectLocalOrderIsByServerId();
4581 } 4582 }
4582 4583
4583 const SyncerTest::CommitOrderingTest 4584 const SyncerTest::CommitOrderingTest
4584 SyncerTest::CommitOrderingTest::LAST_COMMIT_ITEM = {-1, TestIdFactory::root()}; 4585 SyncerTest::CommitOrderingTest::LAST_COMMIT_ITEM = {-1, TestIdFactory::root()};
4585 4586
4586 } // namespace browser_sync 4587 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_thread.cc ('k') | chrome/browser/sync/engine/syncer_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698