chromium/chrome/browser/ui/views/extensions/extensions_menu_view_unittest.cc

// Copyright 2019 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/extensions/extensions_menu_view.h"

#include <memory>
#include <string>
#include <vector>

#include "base/command_line.h"
#include "base/containers/to_vector.h"
#include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/user_action_tester.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/extension_action_test_util.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/load_error_reporter.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_button.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_item_view.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_button.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_unittest.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/extension.h"
#include "extensions/test/test_extension_dir.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "ui/events/event.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/layout/animating_layout_manager_test_util.h"
#include "ui/views/test/ax_event_counter.h"
#include "ui/views/view_utils.h"
#include "ui/views/widget/widget.h"

namespace {

// Manages a Browser instance created by BrowserWithTestWindowTest beyond the
// default instance it creates in SetUp.
class AdditionalBrowser {};

}  // namespace

class ExtensionsMenuViewUnitTest : public ExtensionsToolbarUnitTest {};

void ExtensionsMenuViewUnitTest::SetUp() {}

scoped_refptr<const extensions::Extension>
ExtensionsMenuViewUnitTest::InstallExtensionAndLayout(const std::string& name) {}

ExtensionMenuItemView* ExtensionsMenuViewUnitTest::GetOnlyMenuItem() {}

void ExtensionsMenuViewUnitTest::ClickPinButton(
    ExtensionMenuItemView* menu_item) const {}

void ExtensionsMenuViewUnitTest::ClickContextMenuButton(
    ExtensionMenuItemView* menu_item) const {}

std::vector<ToolbarActionView*>
ExtensionsMenuViewUnitTest::GetPinnedExtensionViews() {}

ExtensionMenuItemView* ExtensionsMenuViewUnitTest::GetExtensionMenuItemView(
    const std::string& name) {}

std::vector<std::string> ExtensionsMenuViewUnitTest::GetPinnedExtensionNames() {}

void ExtensionsMenuViewUnitTest::LayoutMenuIfNecessary() {}

TEST_F(ExtensionsMenuViewUnitTest, ExtensionsAreShownInTheMenu) {}

TEST_F(ExtensionsMenuViewUnitTest, ExtensionsAreSortedInTheMenu) {}

TEST_F(ExtensionsMenuViewUnitTest, PinnedExtensionAppearsInToolbar) {}

TEST_F(ExtensionsMenuViewUnitTest, PinnedExtensionAppearsInAnotherWindow) {}

TEST_F(ExtensionsMenuViewUnitTest, PinnedExtensionRemovedWhenDisabled) {}

TEST_F(ExtensionsMenuViewUnitTest, PinnedExtensionLayout) {}

// Tests that when an extension is reloaded it remains visible in the toolbar
// and extensions menu.
TEST_F(ExtensionsMenuViewUnitTest, ReloadExtension) {}

// Tests that a when an extension is reloaded with manifest errors, and
// therefore fails to be loaded into Chrome, it's removed from the toolbar and
// extensions menu.
TEST_F(ExtensionsMenuViewUnitTest, ReloadExtensionFailed) {}

TEST_F(ExtensionsMenuViewUnitTest, PinButtonUserActionWithAccessibility) {}

TEST_F(ExtensionsMenuViewUnitTest, WindowTitle) {}

// TODO(crbug.com/40636292): When supported, add a test to verify the
// ExtensionsToolbarContainer shrinks when the window is too small to show all
// pinned extensions.
// TODO(crbug.com/40636292): When supported, add a test to verify an extension
// is shown when a bubble pops up and needs to draw attention to it.