chromium/chrome/browser/plus_addresses/plus_address_browsertest.cc

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

#include "base/test/scoped_feature_list.h"
#include "chrome/browser/plus_addresses/plus_address_service_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/chrome_test_utils.h"
#include "chrome/test/base/platform_browser_test.h"
#include "components/plus_addresses/features.h"
#include "components/plus_addresses/plus_address_service.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "content/public/test/browser_test.h"

class PlusAddressServiceBrowserTest : public PlatformBrowserTest {};

// A very basic test for now, to ensure that the service plumbing is set up
// correctly.
IN_PROC_BROWSER_TEST_F(PlusAddressServiceBrowserTest, VerifyNonNullService) {}

// With the primary account available, with an email address, and the feature
// enabled, `ShouldShowManualFallback` should return true. In contrast with the
// unit tests, this ensures the various `KeyedService` factories are wired
// correctly.
IN_PROC_BROWSER_TEST_F(PlusAddressServiceBrowserTest,
                       VerifyShouldShowManualFallback) {}

// Tests that exercise code paths when the plus_address feature is disabled.
class PlusAddressServiceDisabledBrowserTest : public PlatformBrowserTest {};

// Ensure that the service is not created when the feature is disabled.
IN_PROC_BROWSER_TEST_F(PlusAddressServiceDisabledBrowserTest,
                       VerifyNullService) {}