chromium/components/safe_browsing/core/browser/sync/safe_browsing_primary_account_token_fetcher_unittest.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/safe_browsing/core/browser/sync/safe_browsing_primary_account_token_fetcher.h"
#include <memory>

#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "components/safe_browsing/core/browser/safe_browsing_token_fetch_tracker.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace safe_browsing {

class SafeBrowsingPrimaryAccountTokenFetcherTest : public ::testing::Test {};

TEST_F(SafeBrowsingPrimaryAccountTokenFetcherTest, Success) {}

TEST_F(SafeBrowsingPrimaryAccountTokenFetcherTest, Failure) {}

TEST_F(SafeBrowsingPrimaryAccountTokenFetcherTest,
       SuccessWithConsentedPrimaryAccount) {}

// Verifies that destruction of a SafeBrowsingPrimaryAccountTokenFetcher
// instance from within the client callback that the token was fetched doesn't
// cause a crash.
TEST_F(SafeBrowsingPrimaryAccountTokenFetcherTest,
       FetcherDestroyedFromWithinOnTokenFetchedCallback) {}

// Verifies that destruction of a SafeBrowsingPrimaryAccountTokenFetcher
// instance from within the client callback that the token was fetched doesn't
// cause a crash when invoked due to the token fetch timing out.
TEST_F(SafeBrowsingPrimaryAccountTokenFetcherTest,
       FetcherDestroyedFromWithinOnTokenFetchedCallbackInvokedOnTimeout) {}

// Verifies that completion of an access token fetch followed by the timeout
// period for the fetch being reached doesn't cause a crash. Regression test for
// crbug.com/1276273.
TEST_F(SafeBrowsingPrimaryAccountTokenFetcherTest, TimeoutAfterSuccess) {}

}  // namespace safe_browsing