chromium/chrome/browser/ui/views/extensions/extensions_menu_test_util.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_test_util.h"
#include "base/containers/flat_set.h"
#include "base/memory/raw_ptr.h"

#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/extensions/extension_action_view_controller.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/views/extensions/extension_popup.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_button.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_coordinator.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_item_view.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_main_page_view.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_view.h"
#include "chrome/browser/ui/views/extensions/extensions_menu_view_controller.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_coordinator.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "extensions/common/extension_features.h"
#include "ui/events/base_event_utils.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/layout/animating_layout_manager_test_util.h"
#include "ui/views/style/platform_style.h"
#include "ui/views/test/button_test_api.h"
#include "ui/views/view.h"
#include "ui/views/view_utils.h"

#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
#endif

// A view wrapper class that owns the ExtensionsToolbarContainer.
// This is used when we don't have a "real" browser window, because the
// TestBrowserWindow does not have a view instantiated for the container.
class ExtensionsMenuTestUtil::Wrapper {};

ExtensionsMenuTestUtil::ExtensionsMenuTestUtil(Browser* browser,
                                               bool is_real_window)
    :{}

ExtensionsMenuTestUtil::~ExtensionsMenuTestUtil() {}

void ExtensionsMenuTestUtil::OnViewIsDeleting(views::View* observed_view) {}

int ExtensionsMenuTestUtil::NumberOfBrowserActions() {}

bool ExtensionsMenuTestUtil::HasAction(const extensions::ExtensionId& id) {}

void ExtensionsMenuTestUtil::InspectPopup(const extensions::ExtensionId& id) {}

void ExtensionsMenuTestUtil::TriggerPopupForAPI(
    const extensions::ExtensionId& id) {}

gfx::Image ExtensionsMenuTestUtil::GetIcon(const extensions::ExtensionId& id) {}

void ExtensionsMenuTestUtil::Press(const extensions::ExtensionId& id) {}

gfx::NativeView ExtensionsMenuTestUtil::GetPopupNativeView() {}

bool ExtensionsMenuTestUtil::HasPopup() {}

bool ExtensionsMenuTestUtil::HidePopup() {}

ExtensionsContainer* ExtensionsMenuTestUtil::GetExtensionsContainer() {}

void ExtensionsMenuTestUtil::WaitForExtensionsContainerLayout() {}

gfx::Size ExtensionsMenuTestUtil::GetMinPopupSize() {}

gfx::Size ExtensionsMenuTestUtil::GetMaxPopupSize() {}

gfx::Size ExtensionsMenuTestUtil::GetToolbarActionSize() {}

gfx::Size ExtensionsMenuTestUtil::GetMaxAvailableSizeToFitBubbleOnScreen(
    const extensions::ExtensionId& id) {}

ExtensionMenuItemView* ExtensionsMenuTestUtil::GetMenuItemViewForId(
    const extensions::ExtensionId& id) {}

// static
std::unique_ptr<ExtensionActionTestHelper> ExtensionActionTestHelper::Create(
    Browser* browser,
    bool is_real_window) {}