#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/test/integration/bookmarks_helper.h"
#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
#include "chrome/common/pref_names.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/sync/service/sync_service_impl.h"
#include "components/sync/service/sync_token_status.h"
#include "content/public/test/browser_test.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "net/base/features.h"
#include "net/base/net_errors.h"
#include "net/http/http_status_code.h"
namespace {
constexpr char kShortLivedOAuth2Token[] = …;
constexpr char kValidOAuth2Token[] = …;
constexpr char kInvalidGrantOAuth2Token[] = …;
constexpr char kInvalidClientOAuth2Token[] = …;
constexpr char kEmptyOAuth2Token[] = …;
constexpr char kMalformedOAuth2Token[] = …;
bool HasUserPrefValue(const PrefService* pref_service,
const std::string& pref) { … }
class TestForAuthError : public UpdatedProgressMarkerChecker { … };
class SyncTransportActiveChecker : public SingleClientStatusChangeChecker { … };
class SyncAuthTest : public SyncTest { … };
class SyncAuthTestOAuthTokens : public SyncAuthTest { … };
IN_PROC_BROWSER_TEST_F(SyncAuthTest, Sanity) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, RetryOnInternalServerError500) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, RetryOnHttpForbidden403) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, RetryOnRequestFailed) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, RetryOnMalformedToken) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, InvalidGrant) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, InvalidClient) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, RetryRequestCanceled) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, FailInitialSetupWithPersistentError) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, RetryInitialSetupWithTransientError) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#define MAYBE_TokenExpiry …
#else
#define MAYBE_TokenExpiry …
#endif
IN_PROC_BROWSER_TEST_F(SyncAuthTestOAuthTokens, MAYBE_TokenExpiry) { … }
class NoAuthErrorChecker : public SingleClientStatusChangeChecker { … };
IN_PROC_BROWSER_TEST_F(SyncAuthTest, SyncPausedState) { … }
IN_PROC_BROWSER_TEST_F(SyncAuthTest, ShouldTrackDeletionsInSyncPausedState) { … }
}