chromium/chrome/browser/ui/views/toolbar/toolbar_view_interactive_uitest.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 "chrome/browser/ui/views/toolbar/toolbar_view.h"

#include <stddef.h>

#include "base/functional/bind.h"
#include "base/location.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_command_controller.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/view_ids.h"
#include "chrome/browser/ui/views/toolbar/reload_button.h"
#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chrome/test/interaction/interactive_browser_test.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/test/ui_controls.h"
#include "ui/base/ui_base_types.h"
#include "ui/views/focus/focus_manager.h"
#include "ui/views/test/widget_activation_waiter.h"
#include "ui/views/test/widget_test.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"

BookmarkModel;

class ToolbarViewTest : public InteractiveBrowserTest {};

void ToolbarViewTest::RunToolbarCycleFocusTest(Browser* browser) {}

IN_PROC_BROWSER_TEST_F(ToolbarViewTest, ToolbarCycleFocus) {}

IN_PROC_BROWSER_TEST_F(ToolbarViewTest, ToolbarCycleFocusWithBookmarkBar) {}

IN_PROC_BROWSER_TEST_F(ToolbarViewTest, BackButtonUpdate) {}

IN_PROC_BROWSER_TEST_F(ToolbarViewTest, BackButtonHoverThenClick) {}

// TODO(crbug.com/40252318): The ui test utils do not seem to adequately
// simulate mouse hovering on Mac.
#if BUILDFLAG(IS_MAC)
#define MAYBE_BackButtonHoverMetricsLogged
#else
#define MAYBE_BackButtonHoverMetricsLogged
#endif
IN_PROC_BROWSER_TEST_F(ToolbarViewTest, MAYBE_BackButtonHoverMetricsLogged) {}

IN_PROC_BROWSER_TEST_F(ToolbarViewTest,
                       ToolbarForRegularProfileHasExtensionsToolbarContainer) {}

// TODO(crbug.com/41474891): Setup test profiles properly for CrOS.
#if BUILDFLAG(IS_CHROMEOS_ASH)
#define MAYBE_ExtensionsToolbarContainerForGuest
#else
#define MAYBE_ExtensionsToolbarContainerForGuest
#endif
IN_PROC_BROWSER_TEST_F(ToolbarViewTest,
                       MAYBE_ExtensionsToolbarContainerForGuest) {}

// Verifies that the identifiers for the pop-up menus are properly assigned so
// that the menu can be located by tests when it is shown.
//
// The back button is just one example for which the menu identifier is defined.
IN_PROC_BROWSER_TEST_F(ToolbarViewTest, BackButtonMenu) {}

// Tests that the browser updates the toolbar's visible security state only
// when the state changes, not every time it's asked to update.
IN_PROC_BROWSER_TEST_F(ToolbarViewTest, SecurityStateChanged) {}