diff options
author | skrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 17:33:19 +0000 |
---|---|---|
committer | skrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 17:33:19 +0000 |
commit | 7e91b11e31098a41582dad6bd279d3b7d0f3c089 (patch) | |
tree | 31179b0246fd61f7b03ee73f3917a03ecdc3a027 | |
parent | c4a530bfedbe1c0c873c62bcf5c54536d319eae3 (diff) | |
download | chromium_src-7e91b11e31098a41582dad6bd279d3b7d0f3c089.zip chromium_src-7e91b11e31098a41582dad6bd279d3b7d0f3c089.tar.gz chromium_src-7e91b11e31098a41582dad6bd279d3b7d0f3c089.tar.bz2 |
Add unit test for the "aborted by shutdown" case.
This unit test would crash the code that is on the current dev branch, however with the addition of the DataTypeManager this is no longer a problem on trunk. In the dev version, the PSS would try to try to stop a data type in mid startp causing it to abort, which then rasies and error and tries to stop the same data type again. With the DTM, it knows how to handle aborting a data type startup at shutdown by not letting an aborted stop raise an error.
BUG=37243
Review URL: http://codereview.chromium.org/668183
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40904 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/profile_sync_service_unittest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc index af0d578..fd550f6 100644 --- a/chrome/browser/sync/profile_sync_service_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_unittest.cc @@ -441,6 +441,19 @@ TEST_F(ProfileSyncServiceTest, InitialState) { ExpectModelMatch(); } +TEST_F(ProfileSyncServiceTest, AbortedByShutdown) { + service_.reset(new TestProfileSyncService(&factory_, profile_.get(), false)); + EXPECT_CALL(factory_, CreateDataTypeManager(_)). + WillOnce(MakeDataTypeManager()); + EXPECT_CALL(factory_, CreateBookmarkSyncComponents(_, _)).Times(0); + service_->RegisterDataTypeController( + new browser_sync::BookmarkDataTypeController(&factory_, + profile_.get(), + service_.get())); + service_->Initialize(); + service_.reset(); +} + TEST_F(ProfileSyncServiceTest, BookmarkModelOperations) { LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE); StartSyncService(); |