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

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

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Rebase Created 4 years, 2 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 0ca09f92337ff9158d42570a5f8bfc101eb48b2d..9ad5d8188ec8253decf575cfdf36197ce2480802 100644
--- a/chrome/browser/sync/test/integration/sync_auth_test.cc
+++ b/chrome/browser/sync/test/integration/sync_auth_test.cc
@@ -10,8 +10,8 @@
#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/single_client_status_change_checker.h"
-#include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
+#include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "google_apis/gaia/google_service_auth_error.h"
@@ -19,7 +19,6 @@
#include "net/url_request/url_request_status.h"
using bookmarks_helper::AddURL;
-using sync_integration_test_util::AwaitCommitActivityCompletion;
const char kShortLivedOAuth2Token[] =
"{"
@@ -51,7 +50,8 @@ const char kMalformedOAuth2Token[] = "{ \"foo\": ";
class TestForAuthError : public SingleClientStatusChangeChecker {
public:
explicit TestForAuthError(browser_sync::ProfileSyncService* service);
- ~TestForAuthError() override;
+
+ // StatusChangeChecker implementation.
bool IsExitConditionSatisfied() override;
std::string GetDebugMessage() const override;
};
@@ -59,8 +59,6 @@ class TestForAuthError : public SingleClientStatusChangeChecker {
TestForAuthError::TestForAuthError(browser_sync::ProfileSyncService* service)
: SingleClientStatusChangeChecker(service) {}
-TestForAuthError::~TestForAuthError() {}
-
bool TestForAuthError::IsExitConditionSatisfied() {
return !service()->HasUnsyncedItems() ||
(service()->GetSyncTokenStatus().last_get_token_error.state() !=
@@ -86,8 +84,7 @@ class SyncAuthTest : public SyncTest {
EXPECT_TRUE(AddURL(0, title, url) != NULL);
// Run until the bookmark is committed or an auth error is encountered.
- TestForAuthError checker_(GetSyncService(0));
- checker_.Wait();
+ TestForAuthError(GetSyncService(0)).Wait();
GoogleServiceAuthError oauth_error =
GetSyncService(0)->GetSyncTokenStatus().last_get_token_error;
@@ -296,7 +293,7 @@ IN_PROC_BROWSER_TEST_F(SyncAuthTest, TokenExpiry) {
net::URLRequestStatus::SUCCESS);
// Verify that the next sync cycle is successful, and uses the new auth token.
- ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService(0)));
+ ASSERT_TRUE(UpdatedProgressMarkerChecker(GetSyncService(0)).Wait());
std::string new_token = GetSyncService(0)->GetAccessTokenForTest();
ASSERT_NE(old_token, new_token);
}

Powered by Google App Engine
This is Rietveld 408576698