Chromium Code Reviews| Index: chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc |
| diff --git a/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc b/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc |
| index 3d6036752c826bcbe96cbd2b1a67e0b863355135..a5b59b176b6527d76cd1a2e3d15c566fc5dcdda0 100644 |
| --- a/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc |
| +++ b/chrome/browser/sync/test/integration/single_client_backup_rollback_test.cc |
| @@ -11,6 +11,7 @@ |
| #include "chrome/browser/sync/test/integration/sync_test.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "components/bookmarks/browser/bookmark_model.h" |
| +#include "sync/internal_api/public/util/sync_db_util.h" |
| #include "sync/test/fake_server/fake_server_verifier.h" |
| using bookmarks_helper::AddFolder; |
| @@ -32,7 +33,23 @@ class SingleClientBackupRollbackTest : public SyncTest { |
| SyncTest::SetUp(); |
| } |
| + base::Time GetBackupDbLastModified() { |
| + base::Time backup_time; |
| + syncer::CheckSyncDbLastModifiedTime( |
| + GetProfile(0)->GetPath().Append(FILE_PATH_LITERAL("Sync Data Backup")), |
| + base::MessageLoopProxy::current(), |
| + base::Bind(&SingleClientBackupRollbackTest::CheckDbCallback, |
| + base::Unretained(this), &backup_time)); |
| + base::MessageLoop::current()->RunLoop(); |
|
Nicolas Zea
2014/06/13 23:48:52
note: RunLoop is a class, not a method (I don't th
haitaol1
2014/06/16 17:35:28
really done
On 2014/06/13 23:48:52, Nicolas Zea w
|
| + return backup_time; |
| + } |
| + |
| private: |
| + void CheckDbCallback(base::Time* time_out, base::Time time_in) { |
| + *time_out = time_in; |
| + base::MessageLoop::current()->Quit(); |
| + } |
| + |
| DISALLOW_COPY_AND_ASSIGN(SingleClientBackupRollbackTest); |
| }; |
| @@ -103,16 +120,21 @@ IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest, |
| // Setup sync, wait for its completion, and make sure changes were synced. |
| ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
| - ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
| + ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); |
| ASSERT_TRUE(ModelMatchesVerifier(0)); |
| // Made bookmark changes while sync is on. |
| Move(0, tier1_a->GetChild(0), tier1_b, 1); |
| Remove(0, tier1_b, 0); |
| ASSERT_TRUE(AddFolder(0, tier1_b, 1, "tier2_c")); |
| - ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
| + ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0))); |
| ASSERT_TRUE(ModelMatchesVerifier(0)); |
| + // Verify backup time is set on device info. |
| + base::Time backup_time = GetBackupDbLastModified(); |
| + ASSERT_FALSE(backup_time.is_null()); |
| + ASSERT_EQ(backup_time, GetSyncService(0)->GetDeviceBackupTimeForTesting()); |
| + |
| // Let server to return rollback command on next sync request. |
| GetFakeServer()->TriggerError(sync_pb::SyncEnums::USER_ROLLBACK); |