diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-11 00:11:42 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-11 00:11:42 +0000 |
commit | b486b46abcffb2eaad1e6678046441a873e0fcf7 (patch) | |
tree | aa70f547cd209e2fa8518dc9b2b3007460938999 | |
parent | c1161bb27638674e1c4b912cb49b954114ce4b1e (diff) | |
download | chromium_src-b486b46abcffb2eaad1e6678046441a873e0fcf7.zip chromium_src-b486b46abcffb2eaad1e6678046441a873e0fcf7.tar.gz chromium_src-b486b46abcffb2eaad1e6678046441a873e0fcf7.tar.bz2 |
[Sync] Make sync unit tests in unit_tests have 'Sync' in their names
BUG=111552
TEST=
Review URL: http://codereview.chromium.org/9369046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121577 0039d316-1c4b-4281-b951-d872f2087c98
22 files changed, 207 insertions, 204 deletions
diff --git a/chrome/browser/sync/backend_migrator_unittest.cc b/chrome/browser/sync/backend_migrator_unittest.cc index 34ba5c5..f156026 100644 --- a/chrome/browser/sync/backend_migrator_unittest.cc +++ b/chrome/browser/sync/backend_migrator_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,10 +30,10 @@ using sessions::ErrorCounters; using sessions::SyncerStatus; using sessions::SyncSessionSnapshot; -class BackendMigratorTest : public testing::Test { +class SyncBackendMigratorTest : public testing::Test { public: - BackendMigratorTest() { } - virtual ~BackendMigratorTest() { } + SyncBackendMigratorTest() { } + virtual ~SyncBackendMigratorTest() { } virtual void SetUp() { test_user_share_.SetUp(); @@ -125,7 +125,7 @@ class MockMigrationObserver : public MigrationObserver { // Test that in the normal case a migration does transition through each state // and wind up back in IDLE. -TEST_F(BackendMigratorTest, Sanity) { +TEST_F(SyncBackendMigratorTest, Sanity) { MockMigrationObserver migration_observer; migrator()->AddMigrationObserver(&migration_observer); EXPECT_CALL(migration_observer, OnMigrationStateChange()).Times(4); @@ -156,7 +156,7 @@ TEST_F(BackendMigratorTest, Sanity) { // Test that in the normal case with Nigori a migration transitions through // each state and wind up back in IDLE. -TEST_F(BackendMigratorTest, MigrateNigori) { +TEST_F(SyncBackendMigratorTest, MigrateNigori) { syncable::ModelTypeSet to_migrate, difference; to_migrate.Put(syncable::NIGORI); difference.Put(syncable::AUTOFILL); @@ -183,7 +183,7 @@ TEST_F(BackendMigratorTest, MigrateNigori) { // Test that the migrator waits for the data type manager to be idle before // starting a migration. -TEST_F(BackendMigratorTest, WaitToStart) { +TEST_F(SyncBackendMigratorTest, WaitToStart) { syncable::ModelTypeSet to_migrate; to_migrate.Put(syncable::PREFERENCES); @@ -205,7 +205,7 @@ TEST_F(BackendMigratorTest, WaitToStart) { // Test that the migrator can cope with a migration request while a migration // is in progress. -TEST_F(BackendMigratorTest, RestartMigration) { +TEST_F(SyncBackendMigratorTest, RestartMigration) { syncable::ModelTypeSet to_migrate1, to_migrate2, to_migrate_union, bookmarks; to_migrate1.Put(syncable::PREFERENCES); to_migrate2.Put(syncable::AUTOFILL); @@ -239,7 +239,7 @@ TEST_F(BackendMigratorTest, RestartMigration) { // Test that an external invocation of Configure(...) during a migration results // in a migration reattempt. -TEST_F(BackendMigratorTest, InterruptedWhileDisablingTypes) { +TEST_F(SyncBackendMigratorTest, InterruptedWhileDisablingTypes) { syncable::ModelTypeSet to_migrate; syncable::ModelTypeSet difference; to_migrate.Put(syncable::PREFERENCES); @@ -265,7 +265,7 @@ TEST_F(BackendMigratorTest, InterruptedWhileDisablingTypes) { // Test that spurious OnConfigureDone events don't confuse the // migrator while it's waiting for disabled types to have been purged // from the sync db. -TEST_F(BackendMigratorTest, WaitingForPurge) { +TEST_F(SyncBackendMigratorTest, WaitingForPurge) { syncable::ModelTypeSet to_migrate, difference; to_migrate.Put(syncable::PREFERENCES); to_migrate.Put(syncable::AUTOFILL); @@ -293,7 +293,7 @@ TEST_F(BackendMigratorTest, WaitingForPurge) { EXPECT_EQ(BackendMigrator::REENABLING_TYPES, migrator()->state()); } -TEST_F(BackendMigratorTest, MigratedTypeDisabledByUserDuringMigration) { +TEST_F(SyncBackendMigratorTest, MigratedTypeDisabledByUserDuringMigration) { syncable::ModelTypeSet to_migrate; to_migrate.Put(syncable::PREFERENCES); @@ -312,7 +312,7 @@ TEST_F(BackendMigratorTest, MigratedTypeDisabledByUserDuringMigration) { EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); } -TEST_F(BackendMigratorTest, ConfigureFailure) { +TEST_F(SyncBackendMigratorTest, ConfigureFailure) { syncable::ModelTypeSet to_migrate; to_migrate.Put(syncable::PREFERENCES); diff --git a/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc b/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc index ab777a4..40bd305 100644 --- a/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -54,10 +54,10 @@ class TestAppNotificationDataTypeController scoped_refptr<AppNotificationManager> manager_; }; -class AppNotificationDataTypeControllerTest +class SyncAppNotificationDataTypeControllerTest : public testing::Test { public: - AppNotificationDataTypeControllerTest() + SyncAppNotificationDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &ui_loop_), file_thread_(BrowserThread::FILE) { } @@ -140,7 +140,7 @@ class AppNotificationDataTypeControllerTest // When notification manager is ready, sync association should happen // successfully. -TEST_F(AppNotificationDataTypeControllerTest, StartManagerReady) { +TEST_F(SyncAppNotificationDataTypeControllerTest, StartManagerReady) { InitAndLoadManager(); EXPECT_EQ(DataTypeController::NOT_RUNNING, app_notif_dtc_->state()); @@ -153,7 +153,7 @@ TEST_F(AppNotificationDataTypeControllerTest, StartManagerReady) { // When notification manager is not ready, sync assocation should wait // until loaded event is seen. -TEST_F(AppNotificationDataTypeControllerTest, StartManagerNotReady) { +TEST_F(SyncAppNotificationDataTypeControllerTest, StartManagerNotReady) { EXPECT_EQ(DataTypeController::NOT_RUNNING, app_notif_dtc_->state()); SetAssociateExpectations(); EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _)); @@ -171,7 +171,7 @@ TEST_F(AppNotificationDataTypeControllerTest, StartManagerNotReady) { EXPECT_EQ(DataTypeController::RUNNING, app_notif_dtc_->state()); } -TEST_F(AppNotificationDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncAppNotificationDataTypeControllerTest, StartFirstRun) { InitAndLoadManager(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). @@ -181,7 +181,7 @@ TEST_F(AppNotificationDataTypeControllerTest, StartFirstRun) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(AppNotificationDataTypeControllerTest, StartOk) { +TEST_F(SyncAppNotificationDataTypeControllerTest, StartOk) { InitAndLoadManager(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). @@ -191,7 +191,7 @@ TEST_F(AppNotificationDataTypeControllerTest, StartOk) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(AppNotificationDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncAppNotificationDataTypeControllerTest, StartAssociationFailed) { InitAndLoadManager(); EXPECT_CALL(*profile_sync_factory_, CreateAppNotificationSyncComponents(_, _)); @@ -211,7 +211,7 @@ TEST_F(AppNotificationDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, app_notif_dtc_->state()); } -TEST_F(AppNotificationDataTypeControllerTest, +TEST_F(SyncAppNotificationDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { InitAndLoadManager(); // Set up association to fail with an unrecoverable error. @@ -228,7 +228,7 @@ TEST_F(AppNotificationDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, app_notif_dtc_->state()); } -TEST_F(AppNotificationDataTypeControllerTest, Stop) { +TEST_F(SyncAppNotificationDataTypeControllerTest, Stop) { InitAndLoadManager(); SetAssociateExpectations(); SetStopExpectations(); @@ -243,7 +243,7 @@ TEST_F(AppNotificationDataTypeControllerTest, Stop) { EXPECT_EQ(DataTypeController::NOT_RUNNING, app_notif_dtc_->state()); } -TEST_F(AppNotificationDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncAppNotificationDataTypeControllerTest, OnUnrecoverableError) { InitAndLoadManager(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc index 04d972c..01de320 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -42,9 +42,9 @@ class BookmarkModelMock : public BookmarkModel { MOCK_CONST_METHOD0(IsLoaded, bool(void)); }; -class BookmarkDataTypeControllerTest : public testing::Test { +class SyncBookmarkDataTypeControllerTest : public testing::Test { public: - BookmarkDataTypeControllerTest() + SyncBookmarkDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} virtual void SetUp() { @@ -98,7 +98,7 @@ class BookmarkDataTypeControllerTest : public testing::Test { } }; -TEST_F(BookmarkDataTypeControllerTest, StartBookmarkModelReady) { +TEST_F(SyncBookmarkDataTypeControllerTest, StartBookmarkModelReady) { SetStartExpectations(); SetAssociateExpectations(); @@ -110,7 +110,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartBookmarkModelReady) { EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); } -TEST_F(BookmarkDataTypeControllerTest, StartBookmarkModelNotReady) { +TEST_F(SyncBookmarkDataTypeControllerTest, StartBookmarkModelNotReady) { SetStartExpectations(); EXPECT_CALL(bookmark_model_, IsLoaded()).WillRepeatedly(Return(false)); SetAssociateExpectations(); @@ -128,7 +128,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartBookmarkModelNotReady) { EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); } -TEST_F(BookmarkDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncBookmarkDataTypeControllerTest, StartFirstRun) { SetStartExpectations(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). @@ -138,7 +138,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartFirstRun) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(BookmarkDataTypeControllerTest, StartBusy) { +TEST_F(SyncBookmarkDataTypeControllerTest, StartBusy) { SetStartExpectations(); EXPECT_CALL(bookmark_model_, IsLoaded()).WillRepeatedly(Return(false)); @@ -149,7 +149,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartBusy) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(BookmarkDataTypeControllerTest, StartOk) { +TEST_F(SyncBookmarkDataTypeControllerTest, StartOk) { SetStartExpectations(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). @@ -160,7 +160,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartOk) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(BookmarkDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncBookmarkDataTypeControllerTest, StartAssociationFailed) { SetStartExpectations(); // Set up association to fail. EXPECT_CALL(*profile_sync_factory_, CreateBookmarkSyncComponents(_, _)); @@ -179,7 +179,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, bookmark_dtc_->state()); } -TEST_F(BookmarkDataTypeControllerTest, +TEST_F(SyncBookmarkDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { SetStartExpectations(); // Set up association to fail with an unrecoverable error. @@ -195,7 +195,7 @@ TEST_F(BookmarkDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); } -TEST_F(BookmarkDataTypeControllerTest, StartAborted) { +TEST_F(SyncBookmarkDataTypeControllerTest, StartAborted) { SetStartExpectations(); EXPECT_CALL(bookmark_model_, IsLoaded()).WillRepeatedly(Return(false)); @@ -206,7 +206,7 @@ TEST_F(BookmarkDataTypeControllerTest, StartAborted) { EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); } -TEST_F(BookmarkDataTypeControllerTest, Stop) { +TEST_F(SyncBookmarkDataTypeControllerTest, Stop) { SetStartExpectations(); SetAssociateExpectations(); SetStopExpectations(); @@ -221,7 +221,7 @@ TEST_F(BookmarkDataTypeControllerTest, Stop) { EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); } -TEST_F(BookmarkDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncBookmarkDataTypeControllerTest, OnUnrecoverableError) { SetStartExpectations(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). diff --git a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc index fda74e0..22e77e2 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc @@ -23,9 +23,9 @@ namespace browser_sync { namespace { -class BrowserThreadModelWorkerTest : public testing::Test { +class SyncBrowserThreadModelWorkerTest : public testing::Test { public: - BrowserThreadModelWorkerTest() : + SyncBrowserThreadModelWorkerTest() : did_do_work_(false), db_thread_(BrowserThread::DB), io_thread_(BrowserThread::IO, &io_loop_), @@ -33,8 +33,8 @@ class BrowserThreadModelWorkerTest : public testing::Test { bool did_do_work() { return did_do_work_; } BrowserThreadModelWorker* worker() { return worker_.get(); } - OneShotTimer<BrowserThreadModelWorkerTest>* timer() { return &timer_; } - base::WeakPtrFactory<BrowserThreadModelWorkerTest>* factory() { + OneShotTimer<SyncBrowserThreadModelWorkerTest>* timer() { return &timer_; } + base::WeakPtrFactory<SyncBrowserThreadModelWorkerTest>* factory() { return &weak_factory_; } @@ -42,13 +42,13 @@ class BrowserThreadModelWorkerTest : public testing::Test { // DoWork hasn't executed within action_timeout_ms() ms. void ScheduleWork() { // We wait until the callback is done. So it is safe to use unretained. - WorkCallback c = base::Bind(&BrowserThreadModelWorkerTest::DoWork, + WorkCallback c = base::Bind(&SyncBrowserThreadModelWorkerTest::DoWork, base::Unretained(this)); timer()->Start( FROM_HERE, TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms()), this, - &BrowserThreadModelWorkerTest::Timeout); + &SyncBrowserThreadModelWorkerTest::Timeout); worker()->DoWorkAndWaitUntilDone(c); } @@ -84,18 +84,18 @@ class BrowserThreadModelWorkerTest : public testing::Test { private: bool did_do_work_; scoped_refptr<BrowserThreadModelWorker> worker_; - OneShotTimer<BrowserThreadModelWorkerTest> timer_; + OneShotTimer<SyncBrowserThreadModelWorkerTest> timer_; content::TestBrowserThread db_thread_; MessageLoopForIO io_loop_; content::TestBrowserThread io_thread_; - base::WeakPtrFactory<BrowserThreadModelWorkerTest> weak_factory_; + base::WeakPtrFactory<SyncBrowserThreadModelWorkerTest> weak_factory_; }; -TEST_F(BrowserThreadModelWorkerTest, DoesWorkOnDatabaseThread) { +TEST_F(SyncBrowserThreadModelWorkerTest, DoesWorkOnDatabaseThread) { MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&BrowserThreadModelWorkerTest::ScheduleWork, + base::Bind(&SyncBrowserThreadModelWorkerTest::ScheduleWork, factory()->GetWeakPtr())); MessageLoop::current()->Run(); EXPECT_TRUE(did_do_work()); diff --git a/chrome/browser/sync/glue/extension_data_type_controller_unittest.cc b/chrome/browser/sync/glue/extension_data_type_controller_unittest.cc index a4cca03..3042dd6 100644 --- a/chrome/browser/sync/glue/extension_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/extension_data_type_controller_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,9 +30,9 @@ using testing::InvokeWithoutArgs; using testing::Return; using testing::SetArgumentPointee; -class ExtensionDataTypeControllerTest : public testing::Test { +class SyncExtensionDataTypeControllerTest : public testing::Test { public: - ExtensionDataTypeControllerTest() + SyncExtensionDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} virtual void SetUp() { @@ -85,7 +85,7 @@ class ExtensionDataTypeControllerTest : public testing::Test { StartCallbackMock start_callback_; }; -TEST_F(ExtensionDataTypeControllerTest, Start) { +TEST_F(SyncExtensionDataTypeControllerTest, Start) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -96,7 +96,7 @@ TEST_F(ExtensionDataTypeControllerTest, Start) { EXPECT_EQ(DataTypeController::RUNNING, extension_dtc_->state()); } -TEST_F(ExtensionDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncExtensionDataTypeControllerTest, StartFirstRun) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -107,7 +107,7 @@ TEST_F(ExtensionDataTypeControllerTest, StartFirstRun) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(ExtensionDataTypeControllerTest, StartOk) { +TEST_F(SyncExtensionDataTypeControllerTest, StartOk) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -119,7 +119,7 @@ TEST_F(ExtensionDataTypeControllerTest, StartOk) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(ExtensionDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncExtensionDataTypeControllerTest, StartAssociationFailed) { SetStartExpectations(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, AssociateModels(_)). @@ -133,7 +133,7 @@ TEST_F(ExtensionDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, extension_dtc_->state()); } -TEST_F(ExtensionDataTypeControllerTest, +TEST_F(SyncExtensionDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { SetStartExpectations(); // Set up association to fail with an unrecoverable error. @@ -148,7 +148,7 @@ TEST_F(ExtensionDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, extension_dtc_->state()); } -TEST_F(ExtensionDataTypeControllerTest, Stop) { +TEST_F(SyncExtensionDataTypeControllerTest, Stop) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -165,7 +165,7 @@ TEST_F(ExtensionDataTypeControllerTest, Stop) { } // TODO(akalin): Add this test to all the other DTCs. -TEST_F(ExtensionDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncExtensionDataTypeControllerTest, OnUnrecoverableError) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); diff --git a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc index 37e4dcc..d791bb0 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -79,9 +79,9 @@ class FrontendDataTypeControllerFake : public FrontendDataTypeController { FrontendDataTypeControllerMock* mock_; }; -class FrontendDataTypeControllerTest : public testing::Test { +class SyncFrontendDataTypeControllerTest : public testing::Test { public: - FrontendDataTypeControllerTest() + SyncFrontendDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} virtual void SetUp() { @@ -147,7 +147,7 @@ class FrontendDataTypeControllerTest : public testing::Test { StartCallbackMock start_callback_; }; -TEST_F(FrontendDataTypeControllerTest, StartOk) { +TEST_F(SyncFrontendDataTypeControllerTest, StartOk) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(DataTypeController::OK); @@ -157,7 +157,7 @@ TEST_F(FrontendDataTypeControllerTest, StartOk) { EXPECT_EQ(DataTypeController::RUNNING, frontend_dtc_->state()); } -TEST_F(FrontendDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncFrontendDataTypeControllerTest, StartFirstRun) { SetStartExpectations(); EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()). WillOnce(Return(true)); @@ -173,7 +173,7 @@ TEST_F(FrontendDataTypeControllerTest, StartFirstRun) { EXPECT_EQ(DataTypeController::RUNNING, frontend_dtc_->state()); } -TEST_F(FrontendDataTypeControllerTest, AbortDuringStartModels) { +TEST_F(SyncFrontendDataTypeControllerTest, AbortDuringStartModels) { EXPECT_CALL(*dtc_mock_, StartModels()).WillOnce(Return(false)); SetStartFailExpectations(DataTypeController::ABORTED); EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state()); @@ -184,7 +184,7 @@ TEST_F(FrontendDataTypeControllerTest, AbortDuringStartModels) { EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state()); } -TEST_F(FrontendDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncFrontendDataTypeControllerTest, StartAssociationFailed) { SetStartExpectations(); EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()). WillOnce(Return(true)); @@ -202,7 +202,7 @@ TEST_F(FrontendDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, frontend_dtc_->state()); } -TEST_F(FrontendDataTypeControllerTest, +TEST_F(SyncFrontendDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { SetStartExpectations(); SetStartFailExpectations(DataTypeController::UNRECOVERABLE_ERROR); @@ -217,7 +217,7 @@ TEST_F(FrontendDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state()); } -TEST_F(FrontendDataTypeControllerTest, StartAssociationCryptoNotReady) { +TEST_F(SyncFrontendDataTypeControllerTest, StartAssociationCryptoNotReady) { SetStartExpectations(); SetStartFailExpectations(DataTypeController::NEEDS_CRYPTO); // Set up association to fail with a NEEDS_CRYPTO error. @@ -229,7 +229,7 @@ TEST_F(FrontendDataTypeControllerTest, StartAssociationCryptoNotReady) { EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state()); } -TEST_F(FrontendDataTypeControllerTest, Stop) { +TEST_F(SyncFrontendDataTypeControllerTest, Stop) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(DataTypeController::OK); @@ -242,7 +242,7 @@ TEST_F(FrontendDataTypeControllerTest, Stop) { EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state()); } -TEST_F(FrontendDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncFrontendDataTypeControllerTest, OnUnrecoverableError) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(DataTypeController::OK); diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index 9a60966..692180a 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -20,9 +20,9 @@ namespace { const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); } -class HttpBridgeTest : public testing::Test { +class SyncHttpBridgeTest : public testing::Test { public: - HttpBridgeTest() + SyncHttpBridgeTest() : test_server_(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)), fake_default_request_context_getter_(NULL), io_thread_(BrowserThread::IO) { @@ -57,7 +57,7 @@ class HttpBridgeTest : public testing::Test { } static void TestSameHttpNetworkSession(MessageLoop* main_message_loop, - HttpBridgeTest* test) { + SyncHttpBridgeTest* test) { scoped_refptr<HttpBridge> http_bridge(test->BuildBridge()); EXPECT_TRUE(test->GetTestRequestContextGetter()); net::HttpNetworkSession* test_session = @@ -98,7 +98,7 @@ class ShuntedHttpBridge : public HttpBridge { // If |never_finishes| is true, the simulated request never actually // returns. ShuntedHttpBridge(net::URLRequestContextGetter* baseline_context_getter, - HttpBridgeTest* test, bool never_finishes) + SyncHttpBridgeTest* test, bool never_finishes) : HttpBridge(new HttpBridge::RequestContextGetter( baseline_context_getter)), test_(test), never_finishes_(never_finishes) { } @@ -129,22 +129,22 @@ class ShuntedHttpBridge : public HttpBridge { fetcher.SetResponseString(response_content); OnURLFetchComplete(&fetcher); } - HttpBridgeTest* test_; + SyncHttpBridgeTest* test_; bool never_finishes_; }; -TEST_F(HttpBridgeTest, TestUsesSameHttpNetworkSession) { +TEST_F(SyncHttpBridgeTest, TestUsesSameHttpNetworkSession) { // Run this test on the IO thread because we can only call // URLRequestContextGetter::GetURLRequestContext on the IO thread. BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&HttpBridgeTest::TestSameHttpNetworkSession, + base::Bind(&SyncHttpBridgeTest::TestSameHttpNetworkSession, MessageLoop::current(), this)); MessageLoop::current()->Run(); } // Test the HttpBridge without actually making any network requests. -TEST_F(HttpBridgeTest, TestMakeSynchronousPostShunted) { +TEST_F(SyncHttpBridgeTest, TestMakeSynchronousPostShunted) { scoped_refptr<net::URLRequestContextGetter> ctx_getter( new TestURLRequestContextGetter()); scoped_refptr<HttpBridge> http_bridge(new ShuntedHttpBridge( @@ -167,7 +167,7 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostShunted) { // Full round-trip test of the HttpBridge, using default UA string and // no request cookies. -TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveWithPayload) { +TEST_F(SyncHttpBridgeTest, TestMakeSynchronousPostLiveWithPayload) { ASSERT_TRUE(test_server_.Start()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); @@ -190,7 +190,7 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveWithPayload) { } // Full round-trip test of the HttpBridge, using custom UA string -TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) { +TEST_F(SyncHttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) { ASSERT_TRUE(test_server_.Start()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); @@ -217,7 +217,7 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) { EXPECT_NE(std::string::npos, response.find(test_payload.c_str())); } -TEST_F(HttpBridgeTest, TestExtraRequestHeaders) { +TEST_F(SyncHttpBridgeTest, TestExtraRequestHeaders) { ASSERT_TRUE(test_server_.Start()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); @@ -245,7 +245,7 @@ TEST_F(HttpBridgeTest, TestExtraRequestHeaders) { EXPECT_NE(std::string::npos, response.find(test_payload.c_str())); } -TEST_F(HttpBridgeTest, TestResponseHeader) { +TEST_F(SyncHttpBridgeTest, TestResponseHeader) { ASSERT_TRUE(test_server_.Start()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); @@ -268,7 +268,7 @@ TEST_F(HttpBridgeTest, TestResponseHeader) { EXPECT_TRUE(http_bridge->GetResponseHeaderValue("invalid-header").empty()); } -TEST_F(HttpBridgeTest, Abort) { +TEST_F(SyncHttpBridgeTest, Abort) { scoped_refptr<net::URLRequestContextGetter> ctx_getter( new TestURLRequestContextGetter()); scoped_refptr<ShuntedHttpBridge> http_bridge(new ShuntedHttpBridge( @@ -281,13 +281,13 @@ TEST_F(HttpBridgeTest, Abort) { int response_code = 0; BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::Bind(&HttpBridgeTest::Abort, http_bridge)); + base::Bind(&SyncHttpBridgeTest::Abort, http_bridge)); bool success = http_bridge->MakeSynchronousPost(&os_error, &response_code); EXPECT_FALSE(success); EXPECT_EQ(net::ERR_ABORTED, os_error); } -TEST_F(HttpBridgeTest, AbortLate) { +TEST_F(SyncHttpBridgeTest, AbortLate) { scoped_refptr<net::URLRequestContextGetter> ctx_getter( new TestURLRequestContextGetter()); scoped_refptr<ShuntedHttpBridge> http_bridge(new ShuntedHttpBridge( diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc index 01d208b..da5410a 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc @@ -103,9 +103,9 @@ class NonFrontendDataTypeControllerFake : public NonFrontendDataTypeController { NonFrontendDataTypeControllerMock* mock_; }; -class NonFrontendDataTypeControllerTest : public testing::Test { +class SyncNonFrontendDataTypeControllerTest : public testing::Test { public: - NonFrontendDataTypeControllerTest() + SyncNonFrontendDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &message_loop_), db_thread_(BrowserThread::DB), model_associator_(NULL), @@ -173,7 +173,7 @@ class NonFrontendDataTypeControllerTest : public testing::Test { void WaitForDTC() { WaitableEvent done(true, false); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, - base::Bind(&NonFrontendDataTypeControllerTest::SignalDone, &done)); + base::Bind(&SyncNonFrontendDataTypeControllerTest::SignalDone, &done)); done.TimedWait(base::TimeDelta::FromMilliseconds( TestTimeouts::action_timeout_ms())); if (!done.IsSignaled()) { @@ -195,7 +195,7 @@ class NonFrontendDataTypeControllerTest : public testing::Test { StartCallbackMock start_callback_; }; -TEST_F(NonFrontendDataTypeControllerTest, StartOk) { +TEST_F(SyncNonFrontendDataTypeControllerTest, StartOk) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(DataTypeController::OK); @@ -206,7 +206,7 @@ TEST_F(NonFrontendDataTypeControllerTest, StartOk) { EXPECT_EQ(DataTypeController::RUNNING, non_frontend_dtc_->state()); } -TEST_F(NonFrontendDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncNonFrontendDataTypeControllerTest, StartFirstRun) { SetStartExpectations(); EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()). WillOnce(Return(true)); @@ -223,7 +223,7 @@ TEST_F(NonFrontendDataTypeControllerTest, StartFirstRun) { EXPECT_EQ(DataTypeController::RUNNING, non_frontend_dtc_->state()); } -TEST_F(NonFrontendDataTypeControllerTest, AbortDuringStartModels) { +TEST_F(SyncNonFrontendDataTypeControllerTest, AbortDuringStartModels) { EXPECT_CALL(*dtc_mock_, StartModels()).WillOnce(Return(false)); SetStartFailExpectations(DataTypeController::ABORTED); EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); @@ -235,7 +235,7 @@ TEST_F(NonFrontendDataTypeControllerTest, AbortDuringStartModels) { EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); } -TEST_F(NonFrontendDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncNonFrontendDataTypeControllerTest, StartAssociationFailed) { SetStartExpectations(); EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()). WillOnce(Return(true)); @@ -254,7 +254,7 @@ TEST_F(NonFrontendDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, non_frontend_dtc_->state()); } -TEST_F(NonFrontendDataTypeControllerTest, +TEST_F(SyncNonFrontendDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { SetStartExpectations(); SetStartFailExpectations(DataTypeController::UNRECOVERABLE_ERROR); @@ -270,7 +270,7 @@ TEST_F(NonFrontendDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); } -TEST_F(NonFrontendDataTypeControllerTest, StartAssociationCryptoNotReady) { +TEST_F(SyncNonFrontendDataTypeControllerTest, StartAssociationCryptoNotReady) { SetStartExpectations(); SetStartFailExpectations(DataTypeController::NEEDS_CRYPTO); // Set up association to fail with a NEEDS_CRYPTO error. @@ -285,7 +285,7 @@ TEST_F(NonFrontendDataTypeControllerTest, StartAssociationCryptoNotReady) { // Trigger a Stop() call when we check if the model associator has user created // nodes. -TEST_F(NonFrontendDataTypeControllerTest, AbortDuringAssociationInactive) { +TEST_F(SyncNonFrontendDataTypeControllerTest, AbortDuringAssociationInactive) { WaitableEvent wait_for_db_thread_pause(false, false); WaitableEvent pause_db_thread(false, false); @@ -316,7 +316,7 @@ TEST_F(NonFrontendDataTypeControllerTest, AbortDuringAssociationInactive) { } // Same as above but abort during the Activate call. -TEST_F(NonFrontendDataTypeControllerTest, AbortDuringAssociationActivated) { +TEST_F(SyncNonFrontendDataTypeControllerTest, AbortDuringAssociationActivated) { WaitableEvent wait_for_db_thread_pause(false, false); WaitableEvent pause_db_thread(false, false); @@ -347,7 +347,7 @@ TEST_F(NonFrontendDataTypeControllerTest, AbortDuringAssociationActivated) { EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); } -TEST_F(NonFrontendDataTypeControllerTest, Stop) { +TEST_F(SyncNonFrontendDataTypeControllerTest, Stop) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(DataTypeController::OK); @@ -361,7 +361,7 @@ TEST_F(NonFrontendDataTypeControllerTest, Stop) { EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state()); } -TEST_F(NonFrontendDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncNonFrontendDataTypeControllerTest, OnUnrecoverableError) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(DataTypeController::OK); diff --git a/chrome/browser/sync/glue/preference_data_type_controller_unittest.cc b/chrome/browser/sync/glue/preference_data_type_controller_unittest.cc index 9e6681f..af880d6 100644 --- a/chrome/browser/sync/glue/preference_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/preference_data_type_controller_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,9 +31,9 @@ using testing::InvokeWithoutArgs; using testing::Return; using testing::SetArgumentPointee; -class PreferenceDataTypeControllerTest : public testing::Test { +class SyncPreferenceDataTypeControllerTest : public testing::Test { public: - PreferenceDataTypeControllerTest() + SyncPreferenceDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} virtual void SetUp() { @@ -87,7 +87,7 @@ class PreferenceDataTypeControllerTest : public testing::Test { StartCallbackMock start_callback_; }; -TEST_F(PreferenceDataTypeControllerTest, Start) { +TEST_F(SyncPreferenceDataTypeControllerTest, Start) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -98,7 +98,7 @@ TEST_F(PreferenceDataTypeControllerTest, Start) { EXPECT_EQ(DataTypeController::RUNNING, preference_dtc_->state()); } -TEST_F(PreferenceDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncPreferenceDataTypeControllerTest, StartFirstRun) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -109,7 +109,7 @@ TEST_F(PreferenceDataTypeControllerTest, StartFirstRun) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(PreferenceDataTypeControllerTest, StartOk) { +TEST_F(SyncPreferenceDataTypeControllerTest, StartOk) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -121,7 +121,7 @@ TEST_F(PreferenceDataTypeControllerTest, StartOk) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(PreferenceDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncPreferenceDataTypeControllerTest, StartAssociationFailed) { SetStartExpectations(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, AssociateModels(_)). @@ -135,7 +135,7 @@ TEST_F(PreferenceDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, preference_dtc_->state()); } -TEST_F(PreferenceDataTypeControllerTest, +TEST_F(SyncPreferenceDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { SetStartExpectations(); // Set up association to fail with an unrecoverable error. @@ -150,7 +150,7 @@ TEST_F(PreferenceDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, preference_dtc_->state()); } -TEST_F(PreferenceDataTypeControllerTest, Stop) { +TEST_F(SyncPreferenceDataTypeControllerTest, Stop) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -166,7 +166,7 @@ TEST_F(PreferenceDataTypeControllerTest, Stop) { EXPECT_EQ(DataTypeController::NOT_RUNNING, preference_dtc_->state()); } -TEST_F(PreferenceDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncPreferenceDataTypeControllerTest, OnUnrecoverableError) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc index 25789ad..4909162 100644 --- a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -31,9 +31,9 @@ using testing::InvokeWithoutArgs; using testing::Return; using testing::SetArgumentPointee; -class SearchEngineDataTypeControllerTest : public testing::Test { +class SyncSearchEngineDataTypeControllerTest : public testing::Test { public: - SearchEngineDataTypeControllerTest() {} + SyncSearchEngineDataTypeControllerTest() {} virtual void SetUp() { test_util_.SetUp(); @@ -88,7 +88,7 @@ class SearchEngineDataTypeControllerTest : public testing::Test { StartCallbackMock start_callback_; }; -TEST_F(SearchEngineDataTypeControllerTest, StartURLServiceReady) { +TEST_F(SyncSearchEngineDataTypeControllerTest, StartURLServiceReady) { // We want to start ready. PreloadTemplateURLService(); SetAssociateExpectations(); @@ -101,7 +101,7 @@ TEST_F(SearchEngineDataTypeControllerTest, StartURLServiceReady) { EXPECT_EQ(DataTypeController::RUNNING, search_engine_dtc_->state()); } -TEST_F(SearchEngineDataTypeControllerTest, StartURLServiceNotReady) { +TEST_F(SyncSearchEngineDataTypeControllerTest, StartURLServiceNotReady) { SetAssociateExpectations(); EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _)); @@ -117,7 +117,7 @@ TEST_F(SearchEngineDataTypeControllerTest, StartURLServiceNotReady) { EXPECT_EQ(DataTypeController::RUNNING, search_engine_dtc_->state()); } -TEST_F(SearchEngineDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncSearchEngineDataTypeControllerTest, StartFirstRun) { PreloadTemplateURLService(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). @@ -127,7 +127,7 @@ TEST_F(SearchEngineDataTypeControllerTest, StartFirstRun) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(SearchEngineDataTypeControllerTest, StartOk) { +TEST_F(SyncSearchEngineDataTypeControllerTest, StartOk) { PreloadTemplateURLService(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). @@ -138,7 +138,7 @@ TEST_F(SearchEngineDataTypeControllerTest, StartOk) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(SearchEngineDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncSearchEngineDataTypeControllerTest, StartAssociationFailed) { PreloadTemplateURLService(); EXPECT_CALL(*profile_sync_factory_, CreateSearchEngineSyncComponents(_, _)); EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()). @@ -156,7 +156,7 @@ TEST_F(SearchEngineDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, search_engine_dtc_->state()); } -TEST_F(SearchEngineDataTypeControllerTest, +TEST_F(SyncSearchEngineDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { PreloadTemplateURLService(); // Set up association to fail with an unrecoverable error. @@ -172,7 +172,7 @@ TEST_F(SearchEngineDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state()); } -TEST_F(SearchEngineDataTypeControllerTest, Stop) { +TEST_F(SyncSearchEngineDataTypeControllerTest, Stop) { PreloadTemplateURLService(); SetAssociateExpectations(); SetStopExpectations(); @@ -187,7 +187,7 @@ TEST_F(SearchEngineDataTypeControllerTest, Stop) { EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state()); } -TEST_F(SearchEngineDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncSearchEngineDataTypeControllerTest, OnUnrecoverableError) { PreloadTemplateURLService(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)). diff --git a/chrome/browser/sync/glue/session_model_associator.h b/chrome/browser/sync/glue/session_model_associator.h index 9e9ae87..371e759 100644 --- a/chrome/browser/sync/glue/session_model_associator.h +++ b/chrome/browser/sync/glue/session_model_associator.h @@ -219,12 +219,14 @@ class SessionModelAssociator FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceSessionTest, TabNodePoolNonEmpty); FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceSessionTest, ValidTabs); FRIEND_TEST_ALL_PREFIXES(ProfileSyncServiceSessionTest, ExistingTabs); - FRIEND_TEST_ALL_PREFIXES(SessionModelAssociatorTest, PopulateSessionHeader); - FRIEND_TEST_ALL_PREFIXES(SessionModelAssociatorTest, PopulateSessionWindow); - FRIEND_TEST_ALL_PREFIXES(SessionModelAssociatorTest, PopulateSessionTab); - FRIEND_TEST_ALL_PREFIXES(SessionModelAssociatorTest, + FRIEND_TEST_ALL_PREFIXES(SyncSessionModelAssociatorTest, + PopulateSessionHeader); + FRIEND_TEST_ALL_PREFIXES(SyncSessionModelAssociatorTest, + PopulateSessionWindow); + FRIEND_TEST_ALL_PREFIXES(SyncSessionModelAssociatorTest, PopulateSessionTab); + FRIEND_TEST_ALL_PREFIXES(SyncSessionModelAssociatorTest, InitializeCurrentSessionName); - FRIEND_TEST_ALL_PREFIXES(SessionModelAssociatorTest, + FRIEND_TEST_ALL_PREFIXES(SyncSessionModelAssociatorTest, TabNodePool); // Keep all the links to local tab data in one place. diff --git a/chrome/browser/sync/glue/session_model_associator_unittest.cc b/chrome/browser/sync/glue/session_model_associator_unittest.cc index fa951bd..e642820 100644 --- a/chrome/browser/sync/glue/session_model_associator_unittest.cc +++ b/chrome/browser/sync/glue/session_model_associator_unittest.cc @@ -30,9 +30,9 @@ using testing::Return; namespace browser_sync { -class SessionModelAssociatorTest : public testing::Test { +class SyncSessionModelAssociatorTest : public testing::Test { public: - SessionModelAssociatorTest() + SyncSessionModelAssociatorTest() : ui_thread_(BrowserThread::UI, &message_loop_), sync_service_(&profile_) {} virtual void SetUp() OVERRIDE { @@ -50,7 +50,7 @@ class SessionModelAssociatorTest : public testing::Test { scoped_ptr<SessionModelAssociator> model_associator_; }; -TEST_F(SessionModelAssociatorTest, SessionWindowHasNoTabsToSync) { +TEST_F(SyncSessionModelAssociatorTest, SessionWindowHasNoTabsToSync) { SessionWindow win; ASSERT_TRUE(SessionWindowHasNoTabsToSync(win)); scoped_ptr<SessionTab> tab(new SessionTab()); @@ -65,7 +65,7 @@ TEST_F(SessionModelAssociatorTest, SessionWindowHasNoTabsToSync) { ASSERT_FALSE(SessionWindowHasNoTabsToSync(win)); } -TEST_F(SessionModelAssociatorTest, ShouldSyncSessionTab) { +TEST_F(SyncSessionModelAssociatorTest, ShouldSyncSessionTab) { SessionTab tab; ASSERT_FALSE(ShouldSyncSessionTab(tab)); TabNavigation nav(0, GURL(chrome::kChromeUINewTabURL), @@ -86,7 +86,8 @@ TEST_F(SessionModelAssociatorTest, ShouldSyncSessionTab) { ASSERT_TRUE(ShouldSyncSessionTab(tab)); } -TEST_F(SessionModelAssociatorTest, ShouldSyncSessionTabIgnoresFragmentForNtp) { +TEST_F(SyncSessionModelAssociatorTest, + ShouldSyncSessionTabIgnoresFragmentForNtp) { SessionTab tab; ASSERT_FALSE(ShouldSyncSessionTab(tab)); TabNavigation nav(0, GURL(std::string(chrome::kChromeUINewTabURL) + @@ -100,7 +101,7 @@ TEST_F(SessionModelAssociatorTest, ShouldSyncSessionTabIgnoresFragmentForNtp) { ASSERT_FALSE(ShouldSyncSessionTab(tab)); } -TEST_F(SessionModelAssociatorTest, PopulateSessionHeader) { +TEST_F(SyncSessionModelAssociatorTest, PopulateSessionHeader) { sync_pb::SessionHeader header_s; header_s.set_client_name("Client 1"); header_s.set_device_type(sync_pb::SessionHeader_DeviceType_TYPE_WIN); @@ -114,7 +115,7 @@ TEST_F(SessionModelAssociatorTest, PopulateSessionHeader) { ASSERT_EQ(time, session.modified_time); } -TEST_F(SessionModelAssociatorTest, PopulateSessionWindow) { +TEST_F(SyncSessionModelAssociatorTest, PopulateSessionWindow) { sync_pb::SessionWindow window_s; window_s.add_tab(0); window_s.set_browser_type(sync_pb::SessionWindow_BrowserType_TYPE_TABBED); @@ -133,7 +134,7 @@ TEST_F(SessionModelAssociatorTest, PopulateSessionWindow) { ASSERT_EQ(1U, tracker.num_synced_tabs(std::string("tag"))); } -TEST_F(SessionModelAssociatorTest, PopulateSessionTab) { +TEST_F(SyncSessionModelAssociatorTest, PopulateSessionTab) { sync_pb::SessionTab tab_s; tab_s.set_tab_id(5); tab_s.set_tab_visual_index(13); @@ -163,7 +164,7 @@ TEST_F(SessionModelAssociatorTest, PopulateSessionTab) { ASSERT_EQ(GURL("http://foo/1"), tab.navigations[0].virtual_url()); } -TEST_F(SessionModelAssociatorTest, TabNodePool) { +TEST_F(SyncSessionModelAssociatorTest, TabNodePool) { SessionModelAssociator::TabNodePool pool(NULL); pool.set_machine_tag("tag"); ASSERT_TRUE(pool.empty()); @@ -258,7 +259,7 @@ class SyncRefreshListener : public content::NotificationObserver { // Test that AttemptSessionsDataRefresh() triggers the NOTIFICATION_SYNC_REFRESH // notification. -TEST_F(SessionModelAssociatorTest, TriggerSessionRefresh) { +TEST_F(SyncSessionModelAssociatorTest, TriggerSessionRefresh) { SyncRefreshListener refresh_listener; EXPECT_FALSE(refresh_listener.notified_of_refresh()); @@ -268,7 +269,7 @@ TEST_F(SessionModelAssociatorTest, TriggerSessionRefresh) { // Test that we exclude tabs with only chrome:// and file:// schemed navigations // from ShouldSyncTab(..). -TEST_F(SessionModelAssociatorTest, ValidTabs) { +TEST_F(SyncSessionModelAssociatorTest, ValidTabs) { NiceMock<SyncedTabDelegateMock> tab_mock; // A null entry shouldn't crash. diff --git a/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc b/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc index 2170b93..a684dc7 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,9 +30,9 @@ using testing::InvokeWithoutArgs; using testing::Return; using testing::SetArgumentPointee; -class ThemeDataTypeControllerTest : public testing::Test { +class SyncThemeDataTypeControllerTest : public testing::Test { public: - ThemeDataTypeControllerTest() + SyncThemeDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} virtual void SetUp() { @@ -84,7 +84,7 @@ class ThemeDataTypeControllerTest : public testing::Test { StartCallbackMock start_callback_; }; -TEST_F(ThemeDataTypeControllerTest, Start) { +TEST_F(SyncThemeDataTypeControllerTest, Start) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -95,7 +95,7 @@ TEST_F(ThemeDataTypeControllerTest, Start) { EXPECT_EQ(DataTypeController::RUNNING, theme_dtc_->state()); } -TEST_F(ThemeDataTypeControllerTest, StartFirstRun) { +TEST_F(SyncThemeDataTypeControllerTest, StartFirstRun) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -106,7 +106,7 @@ TEST_F(ThemeDataTypeControllerTest, StartFirstRun) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(ThemeDataTypeControllerTest, StartOk) { +TEST_F(SyncThemeDataTypeControllerTest, StartOk) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -118,7 +118,7 @@ TEST_F(ThemeDataTypeControllerTest, StartOk) { base::Bind(&StartCallbackMock::Run, base::Unretained(&start_callback_))); } -TEST_F(ThemeDataTypeControllerTest, StartAssociationFailed) { +TEST_F(SyncThemeDataTypeControllerTest, StartAssociationFailed) { SetStartExpectations(); SetAssociateExpectations(); EXPECT_CALL(*model_associator_, AssociateModels(_)). @@ -132,7 +132,7 @@ TEST_F(ThemeDataTypeControllerTest, StartAssociationFailed) { EXPECT_EQ(DataTypeController::DISABLED, theme_dtc_->state()); } -TEST_F(ThemeDataTypeControllerTest, +TEST_F(SyncThemeDataTypeControllerTest, StartAssociationTriggersUnrecoverableError) { SetStartExpectations(); // Set up association to fail with an unrecoverable error. @@ -147,7 +147,7 @@ TEST_F(ThemeDataTypeControllerTest, EXPECT_EQ(DataTypeController::NOT_RUNNING, theme_dtc_->state()); } -TEST_F(ThemeDataTypeControllerTest, Stop) { +TEST_F(SyncThemeDataTypeControllerTest, Stop) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); @@ -164,7 +164,7 @@ TEST_F(ThemeDataTypeControllerTest, Stop) { } // TODO(akalin): Add this test to all the other DTCs. -TEST_F(ThemeDataTypeControllerTest, OnUnrecoverableError) { +TEST_F(SyncThemeDataTypeControllerTest, OnUnrecoverableError) { SetStartExpectations(); SetAssociateExpectations(); SetActivateExpectations(); diff --git a/chrome/browser/sync/glue/theme_util_unittest.cc b/chrome/browser/sync/glue/theme_util_unittest.cc index 3d728df..b1dad81 100644 --- a/chrome/browser/sync/glue/theme_util_unittest.cc +++ b/chrome/browser/sync/glue/theme_util_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -34,7 +34,7 @@ ProfileKeyedService* BuildMockThemeService(Profile* profile) { return new MockThemeService; } -class ThemeUtilTest : public testing::Test { +class SyncThemeUtilTest : public testing::Test { protected: MockThemeService* BuildForProfile(Profile* profile) { return static_cast<MockThemeService*>( @@ -60,7 +60,7 @@ scoped_refptr<Extension> MakeThemeExtension(const FilePath& extension_path, return extension; } -TEST_F(ThemeUtilTest, AreThemeSpecificsEqualHelper) { +TEST_F(SyncThemeUtilTest, AreThemeSpecificsEqualHelper) { sync_pb::ThemeSpecifics a, b; EXPECT_TRUE(AreThemeSpecificsEqualHelper(a, b, false)); EXPECT_TRUE(AreThemeSpecificsEqualHelper(a, b, true)); @@ -109,7 +109,7 @@ TEST_F(ThemeUtilTest, AreThemeSpecificsEqualHelper) { EXPECT_TRUE(AreThemeSpecificsEqualHelper(a, b, true)); } -TEST_F(ThemeUtilTest, SetCurrentThemeDefaultTheme) { +TEST_F(SyncThemeUtilTest, SetCurrentThemeDefaultTheme) { sync_pb::ThemeSpecifics theme_specifics; TestingProfile profile; MockThemeService* mock_theme_service = BuildForProfile(&profile); @@ -119,7 +119,7 @@ TEST_F(ThemeUtilTest, SetCurrentThemeDefaultTheme) { SetCurrentThemeFromThemeSpecifics(theme_specifics, &profile); } -TEST_F(ThemeUtilTest, SetCurrentThemeSystemTheme) { +TEST_F(SyncThemeUtilTest, SetCurrentThemeSystemTheme) { sync_pb::ThemeSpecifics theme_specifics; theme_specifics.set_use_system_theme_by_default(true); @@ -135,7 +135,7 @@ TEST_F(ThemeUtilTest, SetCurrentThemeSystemTheme) { // enough to be able to write a unittest for SetCurrentTheme for a // custom theme. -TEST_F(ThemeUtilTest, GetThemeSpecificsHelperNoCustomTheme) { +TEST_F(SyncThemeUtilTest, GetThemeSpecificsHelperNoCustomTheme) { sync_pb::ThemeSpecifics theme_specifics; theme_specifics.set_use_custom_theme(true); theme_specifics.set_use_system_theme_by_default(true); @@ -155,7 +155,7 @@ TEST_F(ThemeUtilTest, GetThemeSpecificsHelperNoCustomTheme) { EXPECT_FALSE(theme_specifics.has_custom_theme_update_url()); } -TEST_F(ThemeUtilTest, GetThemeSpecificsHelperNoCustomThemeDistinct) { +TEST_F(SyncThemeUtilTest, GetThemeSpecificsHelperNoCustomThemeDistinct) { sync_pb::ThemeSpecifics theme_specifics; theme_specifics.set_use_custom_theme(true); theme_specifics.set_custom_theme_name("name"); @@ -183,7 +183,7 @@ const FilePath::CharType kExtensionFilePath[] = FILE_PATH_LITERAL("/oo"); #endif } // namespace -TEST_F(ThemeUtilTest, GetThemeSpecificsHelperCustomTheme) { +TEST_F(SyncThemeUtilTest, GetThemeSpecificsHelperCustomTheme) { sync_pb::ThemeSpecifics theme_specifics; theme_specifics.set_use_custom_theme(false); theme_specifics.set_use_system_theme_by_default(true); @@ -202,7 +202,7 @@ TEST_F(ThemeUtilTest, GetThemeSpecificsHelperCustomTheme) { EXPECT_EQ(kThemeUpdateUrl, theme_specifics.custom_theme_update_url()); } -TEST_F(ThemeUtilTest, GetThemeSpecificsHelperCustomThemeDistinct) { +TEST_F(SyncThemeUtilTest, GetThemeSpecificsHelperCustomThemeDistinct) { sync_pb::ThemeSpecifics theme_specifics; theme_specifics.set_use_custom_theme(false); FilePath file_path(kExtensionFilePath); @@ -221,7 +221,7 @@ TEST_F(ThemeUtilTest, GetThemeSpecificsHelperCustomThemeDistinct) { EXPECT_EQ(kThemeUpdateUrl, theme_specifics.custom_theme_update_url()); } -TEST_F(ThemeUtilTest, SetCurrentThemeIfNecessaryDefaultThemeNotNecessary) { +TEST_F(SyncThemeUtilTest, SetCurrentThemeIfNecessaryDefaultThemeNotNecessary) { TestingProfile profile; MockThemeService* mock_theme_service = BuildForProfile(&profile); diff --git a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc index 0da253d..966244d 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc +++ b/chrome/browser/sync/glue/typed_url_model_associator_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -20,7 +20,7 @@ using browser_sync::TypedUrlModelAssociator; using content::BrowserThread; -class TypedUrlModelAssociatorTest : public testing::Test { +class SyncTypedUrlModelAssociatorTest : public testing::Test { public: static history::URLRow MakeTypedUrlRow(const char* url, const char* title, @@ -64,7 +64,7 @@ class TypedUrlModelAssociatorTest : public testing::Test { } }; -TEST_F(TypedUrlModelAssociatorTest, MergeUrls) { +TEST_F(SyncTypedUrlModelAssociatorTest, MergeUrls) { history::VisitVector visits1; history::URLRow row1(MakeTypedUrlRow("http://pie.com/", "pie", 2, 3, false, &visits1)); @@ -153,7 +153,7 @@ TEST_F(TypedUrlModelAssociatorTest, MergeUrls) { EXPECT_EQ(0U, new_visits5.size()); } -TEST_F(TypedUrlModelAssociatorTest, MergeUrlsAfterExpiration) { +TEST_F(SyncTypedUrlModelAssociatorTest, MergeUrlsAfterExpiration) { // Tests to ensure that we don't resurrect expired URLs (URLs that have been // deleted from the history DB but still exist in the sync DB). @@ -193,7 +193,7 @@ TEST_F(TypedUrlModelAssociatorTest, MergeUrlsAfterExpiration) { EXPECT_EQ(4U, history_visits[2].visit_time.ToInternalValue()); } -TEST_F(TypedUrlModelAssociatorTest, DiffVisitsSame) { +TEST_F(SyncTypedUrlModelAssociatorTest, DiffVisitsSame) { history::VisitVector old_visits; sync_pb::TypedUrlSpecifics new_url; @@ -216,7 +216,7 @@ TEST_F(TypedUrlModelAssociatorTest, DiffVisitsSame) { EXPECT_TRUE(removed_visits.empty()); } -TEST_F(TypedUrlModelAssociatorTest, DiffVisitsRemove) { +TEST_F(SyncTypedUrlModelAssociatorTest, DiffVisitsRemove) { history::VisitVector old_visits; sync_pb::TypedUrlSpecifics new_url; @@ -253,7 +253,7 @@ TEST_F(TypedUrlModelAssociatorTest, DiffVisitsRemove) { } } -TEST_F(TypedUrlModelAssociatorTest, DiffVisitsAdd) { +TEST_F(SyncTypedUrlModelAssociatorTest, DiffVisitsAdd) { history::VisitVector old_visits; sync_pb::TypedUrlSpecifics new_url; @@ -294,7 +294,7 @@ static history::VisitRow CreateVisit(content::PageTransition type, type, 0); } -TEST_F(TypedUrlModelAssociatorTest, WriteTypedUrlSpecifics) { +TEST_F(SyncTypedUrlModelAssociatorTest, WriteTypedUrlSpecifics) { history::VisitVector visits; visits.push_back(CreateVisit(content::PAGE_TRANSITION_TYPED, 1)); visits.push_back(CreateVisit(content::PAGE_TRANSITION_RELOAD, 2)); @@ -315,7 +315,7 @@ TEST_F(TypedUrlModelAssociatorTest, WriteTypedUrlSpecifics) { static_cast<content::PageTransition>(typed_url.visit_transitions(1))); } -TEST_F(TypedUrlModelAssociatorTest, TooManyVisits) { +TEST_F(SyncTypedUrlModelAssociatorTest, TooManyVisits) { history::VisitVector visits; int64 timestamp = 1000; visits.push_back(CreateVisit(content::PAGE_TRANSITION_TYPED, timestamp++)); @@ -339,7 +339,7 @@ TEST_F(TypedUrlModelAssociatorTest, TooManyVisits) { static_cast<content::PageTransition>(typed_url.visit_transitions(1))); } -TEST_F(TypedUrlModelAssociatorTest, TooManyTypedVisits) { +TEST_F(SyncTypedUrlModelAssociatorTest, TooManyTypedVisits) { history::VisitVector visits; int64 timestamp = 1000; for (int i = 0 ; i < 102; ++i) { @@ -364,7 +364,7 @@ TEST_F(TypedUrlModelAssociatorTest, TooManyTypedVisits) { } } -TEST_F(TypedUrlModelAssociatorTest, NoTypedVisits) { +TEST_F(SyncTypedUrlModelAssociatorTest, NoTypedVisits) { history::VisitVector visits; history::URLRow url(MakeTypedUrlRow("http://pie.com/", "pie", 1, 1000, false, &visits)); @@ -418,7 +418,7 @@ static void CreateModelAssociator(base::WaitableEvent* startup, // We start up the model associator on the DB thread, block until we abort the // association on the UI thread, then ensure that AssociateModels() returns // false. -TEST_F(TypedUrlModelAssociatorTest, TestAbort) { +TEST_F(SyncTypedUrlModelAssociatorTest, TestAbort) { content::TestBrowserThread db_thread(BrowserThread::DB); base::WaitableEvent startup(false, false); base::WaitableEvent aborted(false, false); diff --git a/chrome/browser/sync/glue/ui_model_worker_unittest.cc b/chrome/browser/sync/glue/ui_model_worker_unittest.cc index 2a3db64..f61731f 100644 --- a/chrome/browser/sync/glue/ui_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/ui_model_worker_unittest.cc @@ -80,10 +80,10 @@ void FakeSyncapiShutdownCallback(base::Thread* syncer_thread, worker->OnSyncerShutdownComplete(); } -class UIModelWorkerTest : public testing::Test { +class SyncUIModelWorkerTest : public testing::Test { public: - UIModelWorkerTest() : faux_syncer_thread_("FauxSyncerThread"), - faux_core_thread_("FauxCoreThread") { } + SyncUIModelWorkerTest() : faux_syncer_thread_("FauxSyncerThread"), + faux_core_thread_("FauxCoreThread") { } virtual void SetUp() { faux_syncer_thread_.Start(); @@ -106,7 +106,7 @@ class UIModelWorkerTest : public testing::Test { scoped_ptr<Syncer> syncer_; }; -TEST_F(UIModelWorkerTest, ScheduledWorkRunsOnUILoop) { +TEST_F(SyncUIModelWorkerTest, ScheduledWorkRunsOnUILoop) { base::WaitableEvent v_was_run(false, false); scoped_ptr<UIModelWorkerVisitor> v( new UIModelWorkerVisitor(&v_was_run, true)); @@ -123,7 +123,7 @@ TEST_F(UIModelWorkerTest, ScheduledWorkRunsOnUILoop) { syncer_thread()->Stop(); } -TEST_F(UIModelWorkerTest, StopWithPendingWork) { +TEST_F(SyncUIModelWorkerTest, StopWithPendingWork) { // What we want to set up is the following: // ("ui_thread" is the thread we are currently executing on) // 1 - simulate the user shutting down the browser, and the ui thread needing @@ -165,7 +165,7 @@ TEST_F(UIModelWorkerTest, StopWithPendingWork) { core_thread()->Stop(); } -TEST_F(UIModelWorkerTest, HypotheticalManualPumpFlooding) { +TEST_F(SyncUIModelWorkerTest, HypotheticalManualPumpFlooding) { // This situation should not happen in real life because the Syncer should // never send more than one CallDoWork notification after early_exit_requested // has been set, but our UIModelWorker is built to handle this case diff --git a/chrome/browser/sync/util/cryptographer.h b/chrome/browser/sync/util/cryptographer.h index d5e98f7..6426a3d 100644 --- a/chrome/browser/sync/util/cryptographer.h +++ b/chrome/browser/sync/util/cryptographer.h @@ -202,7 +202,7 @@ class Cryptographer { syncable::ModelTypeSet encrypted_types); private: - FRIEND_TEST_ALL_PREFIXES(CryptographerTest, PackUnpack); + FRIEND_TEST_ALL_PREFIXES(SyncCryptographerTest, PackUnpack); typedef std::map<std::string, linked_ptr<const Nigori> > NigoriMap; // Merges the given set of encrypted types with the existing set and emits a diff --git a/chrome/browser/sync/util/cryptographer_unittest.cc b/chrome/browser/sync/util/cryptographer_unittest.cc index 2f66fb9..5d3361c 100644 --- a/chrome/browser/sync/util/cryptographer_unittest.cc +++ b/chrome/browser/sync/util/cryptographer_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -32,7 +32,7 @@ class MockObserver : public Cryptographer::Observer { } // namespace -TEST(CryptographerTest, EmptyCantDecrypt) { +TEST(SyncCryptographerTest, EmptyCantDecrypt) { Cryptographer cryptographer; EXPECT_FALSE(cryptographer.is_ready()); @@ -43,7 +43,7 @@ TEST(CryptographerTest, EmptyCantDecrypt) { EXPECT_FALSE(cryptographer.CanDecrypt(encrypted)); } -TEST(CryptographerTest, EmptyCantEncrypt) { +TEST(SyncCryptographerTest, EmptyCantEncrypt) { Cryptographer cryptographer; EXPECT_FALSE(cryptographer.is_ready()); @@ -52,7 +52,7 @@ TEST(CryptographerTest, EmptyCantEncrypt) { EXPECT_FALSE(cryptographer.Encrypt(original, &encrypted)); } -TEST(CryptographerTest, MissingCantDecrypt) { +TEST(SyncCryptographerTest, MissingCantDecrypt) { Cryptographer cryptographer; KeyParams params = {"localhost", "dummy", "dummy"}; @@ -66,7 +66,7 @@ TEST(CryptographerTest, MissingCantDecrypt) { EXPECT_FALSE(cryptographer.CanDecrypt(encrypted)); } -TEST(CryptographerTest, CanEncryptAndDecrypt) { +TEST(SyncCryptographerTest, CanEncryptAndDecrypt) { Cryptographer cryptographer; KeyParams params = {"localhost", "dummy", "dummy"}; @@ -87,7 +87,7 @@ TEST(CryptographerTest, CanEncryptAndDecrypt) { EXPECT_EQ(original.SerializeAsString(), decrypted.SerializeAsString()); } -TEST(CryptographerTest, EncryptOnlyIfDifferent) { +TEST(SyncCryptographerTest, EncryptOnlyIfDifferent) { Cryptographer cryptographer; KeyParams params = {"localhost", "dummy", "dummy"}; @@ -120,7 +120,7 @@ TEST(CryptographerTest, EncryptOnlyIfDifferent) { EXPECT_EQ(original.SerializeAsString(), decrypted.SerializeAsString()); } -TEST(CryptographerTest, AddKeySetsDefault) { +TEST(SyncCryptographerTest, AddKeySetsDefault) { Cryptographer cryptographer; KeyParams params1 = {"localhost", "dummy", "dummy1"}; @@ -157,7 +157,7 @@ TEST(CryptographerTest, AddKeySetsDefault) { #else #define MAYBE_EncryptExportDecrypt EncryptExportDecrypt #endif -TEST(CryptographerTest, MAYBE_EncryptExportDecrypt) { +TEST(SyncCryptographerTest, MAYBE_EncryptExportDecrypt) { sync_pb::EncryptedData nigori; sync_pb::EncryptedData encrypted; @@ -202,7 +202,7 @@ TEST(CryptographerTest, MAYBE_EncryptExportDecrypt) { #else #define MAYBE_PackUnpack PackUnpack #endif -TEST(CryptographerTest, MAYBE_PackUnpack) { +TEST(SyncCryptographerTest, MAYBE_PackUnpack) { #if defined(OS_MACOSX) Encryptor::UseMockKeychain(true); #endif @@ -229,7 +229,7 @@ TEST(CryptographerTest, MAYBE_PackUnpack) { EXPECT_EQ(expected_mac, mac_key); } -TEST(CryptographerTest, NigoriEncryptionTypes) { +TEST(SyncCryptographerTest, NigoriEncryptionTypes) { Cryptographer cryptographer; Cryptographer cryptographer2; sync_pb::NigoriSpecifics nigori; @@ -276,7 +276,7 @@ TEST(CryptographerTest, NigoriEncryptionTypes) { EXPECT_TRUE(encrypted_types.Equals(cryptographer.GetEncryptedTypes())); } -TEST(CryptographerTest, EncryptEverythingExplicit) { +TEST(SyncCryptographerTest, EncryptEverythingExplicit) { ModelTypeSet real_types = syncable::ModelTypeSet::All(); sync_pb::NigoriSpecifics specifics; specifics.set_encrypt_everything(true); @@ -314,7 +314,7 @@ TEST(CryptographerTest, EncryptEverythingExplicit) { cryptographer.RemoveObserver(&observer); } -TEST(CryptographerTest, EncryptEverythingImplicit) { +TEST(SyncCryptographerTest, EncryptEverythingImplicit) { ModelTypeSet real_types = syncable::ModelTypeSet::All(); sync_pb::NigoriSpecifics specifics; specifics.set_encrypt_bookmarks(true); // Non-passwords = encrypt everything @@ -352,7 +352,7 @@ TEST(CryptographerTest, EncryptEverythingImplicit) { cryptographer.RemoveObserver(&observer); } -TEST(CryptographerTest, UnknownSensitiveTypes) { +TEST(SyncCryptographerTest, UnknownSensitiveTypes) { ModelTypeSet real_types = syncable::ModelTypeSet::All(); sync_pb::NigoriSpecifics specifics; // Explicitly setting encrypt everything should override logic for implicit diff --git a/chrome/browser/sync/util/data_encryption_unittest.cc b/chrome/browser/sync/util/data_encryption_unittest.cc index 63bfda5..6a8091c 100644 --- a/chrome/browser/sync/util/data_encryption_unittest.cc +++ b/chrome/browser/sync/util/data_encryption_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,7 +14,7 @@ using std::vector; namespace { -TEST(DataEncryption, TestEncryptDecryptOfSampleString) { +TEST(SyncDataEncryption, TestEncryptDecryptOfSampleString) { vector<uint8> example(EncryptData("example")); ASSERT_FALSE(example.empty()); string result; @@ -22,7 +22,7 @@ TEST(DataEncryption, TestEncryptDecryptOfSampleString) { ASSERT_TRUE(result == "example"); } -TEST(DataEncryption, TestDecryptFailure) { +TEST(SyncDataEncryption, TestDecryptFailure) { vector<uint8> example(0, 0); string result; ASSERT_FALSE(DecryptData(example, &result)); diff --git a/chrome/browser/sync/util/get_session_name_task.h b/chrome/browser/sync/util/get_session_name_task.h index 1de5bde..bdfa479 100644 --- a/chrome/browser/sync/util/get_session_name_task.h +++ b/chrome/browser/sync/util/get_session_name_task.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,8 +33,8 @@ class GetSessionNameTask private: friend class base::RefCountedThreadSafe<GetSessionNameTask>; - FRIEND_TEST_ALL_PREFIXES(GetSessionNameTaskTest, GetHardwareModelName); - FRIEND_TEST_ALL_PREFIXES(GetSessionNameTaskTest, GetComputerName); + FRIEND_TEST_ALL_PREFIXES(SyncGetSessionNameTaskTest, GetHardwareModelName); + FRIEND_TEST_ALL_PREFIXES(SyncGetSessionNameTaskTest, GetComputerName); void InvokeCallback(const std::string& session_name); diff --git a/chrome/browser/sync/util/get_session_name_task_unittest.cc b/chrome/browser/sync/util/get_session_name_task_unittest.cc index 9683014..97f6dfe 100644 --- a/chrome/browser/sync/util/get_session_name_task_unittest.cc +++ b/chrome/browser/sync/util/get_session_name_task_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,11 +9,11 @@ namespace browser_sync { -typedef testing::Test GetSessionNameTaskTest; +typedef testing::Test SyncGetSessionNameTaskTest; #if defined(OS_WIN) // The test is somewhat silly, and just verifies that we return a computer name. -TEST_F(GetSessionNameTaskTest, GetComputerName) { +TEST_F(SyncGetSessionNameTaskTest, GetComputerName) { std::string computer_name = GetSessionNameTask::GetComputerName(); EXPECT_TRUE(!computer_name.empty()); } @@ -22,7 +22,7 @@ TEST_F(GetSessionNameTaskTest, GetComputerName) { #if defined(OS_MACOSX) // The test is somewhat silly, and just verifies that we return a hardware // model name. -TEST_F(GetSessionNameTaskTest, GetHardwareModelName) { +TEST_F(SyncGetSessionNameTaskTest, GetHardwareModelName) { std::string hardware_model = GetSessionNameTask::GetHardwareModelName(); EXPECT_TRUE(!hardware_model.empty()); } diff --git a/chrome/browser/sync/util/nigori_unittest.cc b/chrome/browser/sync/util/nigori_unittest.cc index 9c17762..95afafe 100644 --- a/chrome/browser/sync/util/nigori_unittest.cc +++ b/chrome/browser/sync/util/nigori_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,7 +13,7 @@ namespace browser_sync { namespace { -TEST(NigoriTest, Permute) { +TEST(SyncNigoriTest, Permute) { Nigori nigori; EXPECT_TRUE(nigori.InitByDerivation("example.com", "username", "password")); @@ -27,7 +27,7 @@ TEST(NigoriTest, Permute) { EXPECT_EQ(expected, permuted); } -TEST(NigoriTest, PermuteIsConstant) { +TEST(SyncNigoriTest, PermuteIsConstant) { Nigori nigori1; EXPECT_TRUE(nigori1.InitByDerivation("example.com", "username", "password")); @@ -48,7 +48,7 @@ TEST(NigoriTest, PermuteIsConstant) { EXPECT_EQ(permuted1, permuted2); } -TEST(NigoriTest, EncryptDifferentIv) { +TEST(SyncNigoriTest, EncryptDifferentIv) { Nigori nigori; EXPECT_TRUE(nigori.InitByDerivation("example.com", "username", "password")); @@ -63,7 +63,7 @@ TEST(NigoriTest, EncryptDifferentIv) { EXPECT_NE(encrypted1, encrypted2); } -TEST(NigoriTest, Decrypt) { +TEST(SyncNigoriTest, Decrypt) { Nigori nigori; EXPECT_TRUE(nigori.InitByDerivation("example.com", "username", "password")); @@ -78,7 +78,7 @@ TEST(NigoriTest, Decrypt) { EXPECT_EQ(expected, plaintext); } -TEST(NigoriTest, EncryptDecrypt) { +TEST(SyncNigoriTest, EncryptDecrypt) { Nigori nigori; EXPECT_TRUE(nigori.InitByDerivation("example.com", "username", "password")); @@ -93,7 +93,7 @@ TEST(NigoriTest, EncryptDecrypt) { EXPECT_EQ(plaintext, decrypted); } -TEST(NigoriTest, CorruptedIv) { +TEST(SyncNigoriTest, CorruptedIv) { Nigori nigori; EXPECT_TRUE(nigori.InitByDerivation("example.com", "username", "password")); @@ -111,7 +111,7 @@ TEST(NigoriTest, CorruptedIv) { EXPECT_NE(plaintext, decrypted); } -TEST(NigoriTest, CorruptedCiphertext) { +TEST(SyncNigoriTest, CorruptedCiphertext) { Nigori nigori; EXPECT_TRUE(nigori.InitByDerivation("example.com", "username", "password")); @@ -136,7 +136,7 @@ TEST(NigoriTest, CorruptedCiphertext) { #else #define MAYBE_ExportImport ExportImport #endif -TEST(NigoriTest, MAYBE_ExportImport) { +TEST(SyncNigoriTest, MAYBE_ExportImport) { Nigori nigori1; EXPECT_TRUE(nigori1.InitByDerivation("example.com", "username", "password")); |