chromium/components/gcm_driver/account_tracker_unittest.cc

// Copyright 2014 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/gcm_driver/account_tracker.h"

#include <algorithm>
#include <memory>
#include <vector>

#include "base/strings/stringprintf.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

const char kPrimaryAccountEmail[] =;

enum TrackingEventType {};

class TrackingEvent {};

bool CompareByUser(TrackingEvent a, TrackingEvent b) {}

std::string Str(const std::vector<TrackingEvent>& events) {}

}  // namespace

namespace gcm {

class AccountTrackerObserver : public AccountTracker::Observer {};

void AccountTrackerObserver::OnAccountSignInChanged(
    const CoreAccountInfo& account,
    bool is_signed_in) {}

void AccountTrackerObserver::Clear() {}

void AccountTrackerObserver::SortEventsByUser() {}

testing::AssertionResult AccountTrackerObserver::CheckEvents() {}

testing::AssertionResult AccountTrackerObserver::CheckEvents(
    const TrackingEvent& e1) {}

testing::AssertionResult AccountTrackerObserver::CheckEvents(
    const TrackingEvent& e1,
    const TrackingEvent& e2) {}

testing::AssertionResult AccountTrackerObserver::CheckEvents(
    const TrackingEvent& e1,
    const TrackingEvent& e2,
    const TrackingEvent& e3) {}

testing::AssertionResult AccountTrackerObserver::CheckEvents(
    const TrackingEvent& e1,
    const TrackingEvent& e2,
    const TrackingEvent& e3,
    const TrackingEvent& e4) {}

testing::AssertionResult AccountTrackerObserver::CheckEvents(
    const TrackingEvent& e1,
    const TrackingEvent& e2,
    const TrackingEvent& e3,
    const TrackingEvent& e4,
    const TrackingEvent& e5) {}

testing::AssertionResult AccountTrackerObserver::CheckEvents(
    const TrackingEvent& e1,
    const TrackingEvent& e2,
    const TrackingEvent& e3,
    const TrackingEvent& e4,
    const TrackingEvent& e5,
    const TrackingEvent& e6) {}

testing::AssertionResult AccountTrackerObserver::CheckEvents(
    const std::vector<TrackingEvent>& events) {}

class AccountTrackerTest : public testing::Test {};

// Primary tests just involve the Active account

TEST_F(AccountTrackerTest, PrimaryNoEventsBeforeLogin) {}

TEST_F(AccountTrackerTest, PrimaryLoginThenTokenAvailable) {}

TEST_F(AccountTrackerTest, PrimaryRevoke) {}

TEST_F(AccountTrackerTest, PrimaryRevokeThenTokenAvailable) {}

// These tests exercise true login/logout, which are not possible on ChromeOS.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(AccountTrackerTest, PrimaryTokenAvailableThenLogin) {}

TEST_F(AccountTrackerTest, PrimaryTokenAvailableAndRevokedThenLogin) {}

TEST_F(AccountTrackerTest, PrimaryRevokeThenLogin) {}

TEST_F(AccountTrackerTest, PrimaryLogoutThenRevoke) {}

#endif

// Non-primary accounts

TEST_F(AccountTrackerTest, Available) {}

TEST_F(AccountTrackerTest, AvailableRevokeAvailable) {}

TEST_F(AccountTrackerTest, AvailableRevokeRevoke) {}

TEST_F(AccountTrackerTest, AvailableAvailable) {}

TEST_F(AccountTrackerTest, TwoAccounts) {}

// Primary/non-primary interactions

TEST_F(AccountTrackerTest, MultiNoEventsBeforeLogin) {}

TEST_F(AccountTrackerTest, MultiRevokePrimaryDoesNotRemoveAllAccounts) {}

TEST_F(AccountTrackerTest, GetAccountsPrimary) {}

TEST_F(AccountTrackerTest, GetAccountsSignedOut) {}

TEST_F(AccountTrackerTest, GetMultipleAccounts) {}

TEST_F(AccountTrackerTest, GetAccountsReturnNothingWhenPrimarySignedOut) {}

// This test exercises true login/logout, which are not possible on ChromeOS.
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(AccountTrackerTest, MultiLogoutRemovesAllAccounts) {}
#endif

}  // namespace gcm