diff options
author | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 01:05:11 +0000 |
---|---|---|
committer | rsimha@chromium.org <rsimha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 01:05:11 +0000 |
commit | 8a8621a759333d4d7ee332e0183c6dbba451a10c (patch) | |
tree | c8db926fb9be9be44a37e7714e9fa5c5cac7bcba /chrome/test | |
parent | 18af9a22ada195c0ffc524fd4ab12b54e61e7663 (diff) | |
download | chromium_src-8a8621a759333d4d7ee332e0183c6dbba451a10c.zip chromium_src-8a8621a759333d4d7ee332e0183c6dbba451a10c.tar.gz chromium_src-8a8621a759333d4d7ee332e0183c6dbba451a10c.tar.bz2 |
Error reporting for sync setup failure.
The setup step in the sync integration tests sometimes fails on builders due to timing or networking issues. The tests, however, do not report the exact cause of failure. (Setup can fail due to a number of reasons).
Adding some logging that will help debug test failures.
BUG=51741
TEST=sync_integration_tests
Review URL: http://codereview.chromium.org/3160002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55645 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/live_sync/live_sync_test.cc | 13 | ||||
-rw-r--r-- | chrome/test/live_sync/profile_sync_service_test_harness.cc | 21 |
2 files changed, 14 insertions, 20 deletions
diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc index a43ac60..024f6ef 100644 --- a/chrome/test/live_sync/live_sync_test.cc +++ b/chrome/test/live_sync/live_sync_test.cc @@ -130,12 +130,10 @@ bool LiveSyncTest::SetupClients() { for (int i = 0; i < num_clients_; ++i) { profiles_.push_back(MakeProfile( StringPrintf(FILE_PATH_LITERAL("Profile%d"), i))); - if (GetProfile(i) == NULL) - return false; + EXPECT_FALSE(GetProfile(i) == NULL) << "GetProfile(" << i << ") failed."; clients_.push_back(new ProfileSyncServiceTestHarness( GetProfile(i), username_, password_)); - if (GetClient(i) == NULL) - return false; + EXPECT_FALSE(GetClient(i) == NULL) << "GetClient(" << i << ") failed."; } // Create the verifier profile. @@ -146,15 +144,14 @@ bool LiveSyncTest::SetupClients() { bool LiveSyncTest::SetupSync() { // Create sync profiles and clients if they haven't already been created. if (profiles_.empty()) { - if (!SetupClients()) - return false; + EXPECT_TRUE(SetupClients()) << "SetupClients() failed."; } // Sync each of the profiles. for (int i = 0; i < num_clients_; ++i) { - if (!GetClient(i)->SetupSync()) - return false; + EXPECT_TRUE(GetClient(i)->SetupSync()) << "SetupSync() failed."; } + return true; } diff --git a/chrome/test/live_sync/profile_sync_service_test_harness.cc b/chrome/test/live_sync/profile_sync_service_test_harness.cc index 081b0d8..3464610 100644 --- a/chrome/test/live_sync/profile_sync_service_test_harness.cc +++ b/chrome/test/live_sync/profile_sync_service_test_harness.cc @@ -259,18 +259,16 @@ bool ProfileSyncServiceTestHarness::AwaitStatusChangeWithTimeout( bool ProfileSyncServiceTestHarness::WaitForServiceInit() { // Wait for the OnAuthError() callback. EXPECT_EQ(wait_state_, WAITING_FOR_ON_AUTH_ERROR); - if (!AwaitStatusChangeWithTimeout(30, - "Waiting for the OnAuthError() callback.")) { - return false; - } + EXPECT_TRUE(AwaitStatusChangeWithTimeout(30, + "Waiting for the OnAuthError() callback.")) << + "OnAuthError() not seen after 30 seconds."; // Enter GAIA credentials and wait for the OnBackendInitialized() callback. service_->backend()->Authenticate(username_, password_, std::string()); EXPECT_EQ(wait_state_, WAITING_FOR_ON_BACKEND_INITIALIZED); - if (!AwaitStatusChangeWithTimeout(30, - "Waiting for OnBackendInitialized().")) { - return false; - } + EXPECT_TRUE(AwaitStatusChangeWithTimeout(30, + "Waiting for OnBackendInitialized().")) << + "OnBackendInitialized() not seen after 30 seconds."; // Choose datatypes to be synced and wait for notifications_enabled to be set // to true. @@ -281,10 +279,9 @@ bool ProfileSyncServiceTestHarness::WaitForServiceInit() { } service_->OnUserChoseDatatypes(true, set); EXPECT_EQ(wait_state_, WAITING_FOR_NOTIFICATIONS_ENABLED); - if (!AwaitStatusChangeWithTimeout(30, - "Waiting for notifications_enabled to be set to true.")) { - return false; - } + EXPECT_TRUE(AwaitStatusChangeWithTimeout(30, + "Waiting for notifications_enabled to be set to true.")) << + "notifications_enabled not set to true after 30 seconds."; return true; } |