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

Unified Diff: chrome/browser/sync/test/integration/sync_auth_test.cc

Issue 165393010: Draft: Moving code out of ProfileSyncServiceHarness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/sync_auth_test.cc
diff --git a/chrome/browser/sync/test/integration/sync_auth_test.cc b/chrome/browser/sync/test/integration/sync_auth_test.cc
index a943a9463206714636cebfec476d75bc8a66c0fd..2c543c14bad57b6a19d312a559293a5c67d43d34 100644
--- a/chrome/browser/sync/test/integration/sync_auth_test.cc
+++ b/chrome/browser/sync/test/integration/sync_auth_test.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/test/integration/bookmarks_helper.h"
#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
-#include "chrome/browser/sync/test/integration/status_change_checker.h"
+#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "net/http/http_status_code.h"
@@ -45,27 +45,29 @@ const char kEmptyOAuth2Token[] = "";
const char kMalformedOAuth2Token[] = "{ \"foo\": ";
-class TestForAuthError : public StatusChangeChecker {
+class TestForAuthError : public SingleClientStatusChangeChecker {
public:
explicit TestForAuthError(ProfileSyncService* service);
virtual ~TestForAuthError();
virtual bool IsExitConditionSatisfied() OVERRIDE;
-
- private:
- ProfileSyncService* service_;
+ virtual std::string GetDebugMessage() const OVERRIDE;
};
TestForAuthError::TestForAuthError(ProfileSyncService* service)
- : StatusChangeChecker("Testing for auth error"), service_(service) {}
+ : SingleClientStatusChangeChecker(service) {}
TestForAuthError::~TestForAuthError() {}
bool TestForAuthError::IsExitConditionSatisfied() {
- return !service_->HasUnsyncedItems() ||
- (service_->GetSyncTokenStatus().last_get_token_error.state() !=
+ return !service()->HasUnsyncedItems() ||
+ (service()->GetSyncTokenStatus().last_get_token_error.state() !=
GoogleServiceAuthError::NONE);
}
+std::string TestForAuthError::GetDebugMessage() const {
+ return "Waiting for auth error";
+}
+
class SyncAuthTest : public SyncTest {
public:
SyncAuthTest() : SyncTest(SINGLE_CLIENT), bookmark_index_(0) {}
@@ -82,7 +84,7 @@ class SyncAuthTest : public SyncTest {
// Run until the bookmark is committed or an auth error is encountered.
TestForAuthError checker_(GetClient(0)->service());
- GetClient(0)->AwaitStatusChange(&checker_, "Attempt to trigger auth error");
+ GetClient(0)->AwaitStatusChange(&checker_);
GoogleServiceAuthError oauth_error =
GetClient(0)->service()->GetSyncTokenStatus().last_get_token_error;

Powered by Google App Engine
This is Rietveld 408576698