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

Side by Side Diff: chrome/browser/sync/profile_sync_service_unittest.cc

Issue 6249006: Turn password sync on by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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) 2010 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 <stack> 5 #include <stack>
6 #include <vector> 6 #include <vector>
7 7
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 using browser_sync::SyncBackendHost; 47 using browser_sync::SyncBackendHost;
48 using browser_sync::SyncBackendHostMock; 48 using browser_sync::SyncBackendHostMock;
49 using browser_sync::UnrecoverableErrorHandler; 49 using browser_sync::UnrecoverableErrorHandler;
50 using testing::_; 50 using testing::_;
51 using testing::Return; 51 using testing::Return;
52 using testing::WithArg; 52 using testing::WithArg;
53 using testing::Invoke; 53 using testing::Invoke;
54 54
55 class TestBookmarkModelAssociator : public BookmarkModelAssociator { 55 class TestBookmarkModelAssociator : public BookmarkModelAssociator {
56 public: 56 public:
57 TestBookmarkModelAssociator(ProfileSyncService* service, 57 TestBookmarkModelAssociator(TestProfileSyncService* service,
58 UnrecoverableErrorHandler* persist_ids_error_handler) 58 UnrecoverableErrorHandler* persist_ids_error_handler)
59 : BookmarkModelAssociator(service, persist_ids_error_handler), 59 : BookmarkModelAssociator(service, persist_ids_error_handler),
60 helper_(new TestModelAssociatorHelper()) { 60 helper_(new TestModelAssociatorHelper(service->id_factory())) {
61 } 61 }
62 virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id) { 62 virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id) {
63 return helper_->GetSyncIdForTaggedNode(this, tag, sync_id); 63 return helper_->GetSyncIdForTaggedNode(this, tag, sync_id);
64 } 64 }
65 private: 65 private:
66 scoped_ptr<TestModelAssociatorHelper> helper_; 66 scoped_ptr<TestModelAssociatorHelper> helper_;
67 }; 67 };
68 68
69 // FakeServerChange constructs a list of sync_api::ChangeRecords while modifying 69 // FakeServerChange constructs a list of sync_api::ChangeRecords while modifying
70 // the sync model, and can pass the ChangeRecord list to a 70 // the sync model, and can pass the ChangeRecord list to a
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 // This file should have been deleted when the whole directory was nuked. 1408 // This file should have been deleted when the whole directory was nuked.
1409 ASSERT_FALSE(file_util::PathExists(sync_file3)); 1409 ASSERT_FALSE(file_util::PathExists(sync_file3));
1410 ASSERT_FALSE(file_util::PathExists(sync_file1)); 1410 ASSERT_FALSE(file_util::PathExists(sync_file1));
1411 1411
1412 // This will still exist, but the text should have changed. 1412 // This will still exist, but the text should have changed.
1413 ASSERT_TRUE(file_util::PathExists(sync_file2)); 1413 ASSERT_TRUE(file_util::PathExists(sync_file2));
1414 std::string file2text; 1414 std::string file2text;
1415 file_util::ReadFileToString(sync_file2, &file2text); 1415 file_util::ReadFileToString(sync_file2, &file2text);
1416 ASSERT_FALSE(file2text.compare(nonsense2) == 0); 1416 ASSERT_FALSE(file2text.compare(nonsense2) == 0);
1417 } 1417 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_typed_url_unittest.cc ('k') | chrome/browser/sync/profile_sync_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698