diff options
author | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 22:29:43 +0000 |
---|---|---|
committer | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 22:29:43 +0000 |
commit | 4869742bbaf4bb6fed8a54d7751f442ab94a6a74 (patch) | |
tree | 29675f327d93bcd046ba7600be13cf25e55f15fb /chrome/browser/sync | |
parent | 00fe7c5fa74f7b275eb4dece3c336e4b7dcc69af (diff) | |
download | chromium_src-4869742bbaf4bb6fed8a54d7751f442ab94a6a74.zip chromium_src-4869742bbaf4bb6fed8a54d7751f442ab94a6a74.tar.gz chromium_src-4869742bbaf4bb6fed8a54d7751f442ab94a6a74.tar.bz2 |
A command line flag to simulate an unrecoverable error.
The error is thrown right after initialization.
BUG=101304
TEST=sync_unit_tests.exe, sync_integration_tests.exe, unit_tests.exe, manual test
Review URL: http://codereview.chromium.org/9008045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/internal_api/sync_manager.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/sync/internal_api/sync_manager.cc b/chrome/browser/sync/internal_api/sync_manager.cc index 723cbf7..709c61d 100644 --- a/chrome/browser/sync/internal_api/sync_manager.cc +++ b/chrome/browser/sync/internal_api/sync_manager.cc @@ -922,6 +922,19 @@ bool SyncManager::SyncInternal::Init( sync_notifier_->AddObserver(this); + // Now check the command line to see if we need to simulate an + // unrecoverable error for testing purpose. Note the error is thrown + // only if the initialization succeeded. Also it makes sense to use this + // flag only when restarting the browser with an account already setup. If + // you use this before setting up the setup would not succeed as an error + // would be encountered. + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSyncThrowUnrecoverableError)) { + ReadTransaction trans(FROM_HERE, GetUserShare()); + trans.GetWrappedTrans()->OnUnrecoverableError(FROM_HERE, + "Simulating unrecoverable error for testing purpose."); + } + return signed_in; } |