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

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

Issue 902443002: Add unit tests for the 'disable-sync' flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 service()->GetLastSyncedTimeString()); 632 service()->GetLastSyncedTimeString());
633 633
634 // Sign out. 634 // Sign out.
635 service()->DisableForUser(); 635 service()->DisableForUser();
636 PumpLoop(); 636 PumpLoop();
637 637
638 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER), 638 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_SYNC_TIME_NEVER),
639 service()->GetLastSyncedTimeString()); 639 service()->GetLastSyncedTimeString());
640 } 640 }
641 641
642 // Verify that the disable sync flag disables sync.
643 TEST_F(ProfileSyncServiceTest, DisableSyncFlag) {
644 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync);
645 EXPECT_FALSE(ProfileSyncService::IsSyncEnabled());
646 }
647
648 // Verify that no disable sync flag enables sync.
649 TEST_F(ProfileSyncServiceTest, NoDisableSyncFlag) {
650 EXPECT_TRUE(ProfileSyncService::IsSyncEnabled());
651 }
652
642 } // namespace 653 } // namespace
643 } // namespace browser_sync 654 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_factory_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698