chromium/chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_icon_view_unittest.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 "chrome/browser/ui/views/location_bar/cookie_controls/cookie_controls_icon_view.h"

#include "base/test/metrics/user_action_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/test_with_browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/grit/generated_resources.h"
#include "components/content_settings/core/common/cookie_blocking_3pcd_status.h"
#include "components/content_settings/core/common/features.h"
#include "cookie_controls_bubble_coordinator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/views/accessibility/ax_event_manager.h"
#include "ui/views/test/ax_event_counter.h"

namespace {
NiceMock;

std::u16string AllowedLabel() {}

std::u16string BlockedLabel() {}

std::u16string LimitedLabel() {}

std::u16string TrackingProtectionLabel() {}

std::u16string SiteNotWorkingLabel() {}

const char kUMAIconShown[] =;
const char kUMAIconOpened[] =;
const char kUMAIconAnimated[] =;
const char kUMAIconAnimatedOpened[] =;
const char kUMABubbleOpenedBlocked[] =;
const char kUMABubbleOpenedAllowed[] =;

// A fake CookieControlsBubbleCoordinator that has a no-op ShowBubble().
class MockCookieControlsBubbleCoordinator
    : public CookieControlsBubbleCoordinator {};

}  // namespace

class CookieControlsIconViewUnitTest
    : public TestWithBrowserView,
      public testing::WithParamInterface<CookieBlocking3pcdStatus> {};

INSTANTIATE_TEST_SUITE_P();

/// Enabled third-party cookie blocking.

TEST_P(CookieControlsIconViewUnitTest, DefaultNotVisible) {}

TEST_P(CookieControlsIconViewUnitTest,
       IconAnimatesWhenShouldHighlightIsTrueAndProtectionsAreOn) {}

TEST_P(CookieControlsIconViewUnitTest,
       IconAnimatesOnPageReloadWithChangedSettings) {}

TEST_P(CookieControlsIconViewUnitTest, IconAnimationIsResetOnWebContentChange) {}

TEST_P(CookieControlsIconViewUnitTest, HidingIconDoesNotRetriggerA11yReadOut) {}

TEST_P(CookieControlsIconViewUnitTest,
       IconDoesNotAnimateWhenShouldHighlightIsFalse) {}

TEST_P(CookieControlsIconViewUnitTest, IconHiddenWhenIconVisibleIsFalse) {}

TEST_P(CookieControlsIconViewUnitTest,
       RecordsIconOpenMetricWhenProtectionsAreOff) {}

TEST_P(CookieControlsIconViewUnitTest,
       RecordsIconOpenMetricWhenProtectionsAreOn) {}