OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 536 |
537 // First sync time is erased once backup starts. | 537 // First sync time is erased once backup starts. |
538 EXPECT_TRUE(sync_prefs.GetFirstSyncTime().is_null()); | 538 EXPECT_TRUE(sync_prefs.GetFirstSyncTime().is_null()); |
539 | 539 |
540 EXPECT_EQ(2u, delete_dir_param.size()); | 540 EXPECT_EQ(2u, delete_dir_param.size()); |
541 EXPECT_FALSE(delete_dir_param[0]); | 541 EXPECT_FALSE(delete_dir_param[0]); |
542 EXPECT_TRUE(delete_dir_param[1]); | 542 EXPECT_TRUE(delete_dir_param[1]); |
543 } | 543 } |
544 | 544 |
545 TEST_F(ProfileSyncServiceTest, RollbackThenBackup) { | 545 TEST_F(ProfileSyncServiceTest, RollbackThenBackup) { |
546 CommandLine::ForCurrentProcess()->AppendSwitch( | |
547 switches::kSyncEnableRollback); | |
548 | |
549 CreateService(browser_sync::MANUAL_START); | 546 CreateService(browser_sync::MANUAL_START); |
550 service()->SetSyncSetupCompleted(); | 547 service()->SetSyncSetupCompleted(); |
551 ExpectDataTypeManagerCreation(3); | 548 ExpectDataTypeManagerCreation(3); |
552 std::vector<bool> delete_dir_param; | 549 std::vector<bool> delete_dir_param; |
553 ExpectSyncBackendHostCreationCollectDeleteDir(3, &delete_dir_param); | 550 ExpectSyncBackendHostCreationCollectDeleteDir(3, &delete_dir_param); |
554 IssueTestTokens(); | 551 IssueTestTokens(); |
555 Initialize(); | 552 Initialize(); |
556 EXPECT_TRUE(service()->sync_initialized()); | 553 EXPECT_TRUE(service()->sync_initialized()); |
557 EXPECT_EQ(ProfileSyncService::SYNC, service()->backend_mode()); | 554 EXPECT_EQ(ProfileSyncService::SYNC, service()->backend_mode()); |
558 | 555 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // See that we can override the URL with a flag. | 612 // See that we can override the URL with a flag. |
616 CommandLine command_line( | 613 CommandLine command_line( |
617 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); | 614 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); |
618 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); | 615 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); |
619 EXPECT_EQ("https://foo/bar", | 616 EXPECT_EQ("https://foo/bar", |
620 ProfileSyncService::GetSyncServiceURL(command_line).spec()); | 617 ProfileSyncService::GetSyncServiceURL(command_line).spec()); |
621 } | 618 } |
622 | 619 |
623 } // namespace | 620 } // namespace |
624 } // namespace browser_sync | 621 } // namespace browser_sync |
OLD | NEW |