chromium/chrome/browser/ui/views/permissions/permission_request_chip_browsertest.cc

// Copyright 2020 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/run_loop.h"
#include "base/strings/strcat.h"
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/permissions/chip/chip_controller.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chrome/test/permissions/permission_request_manager_test_api.h"
#include "components/metrics/content/subprocess_metrics_provider.h"
#include "components/omnibox/browser/omnibox_edit_model.h"
#include "components/omnibox/browser/omnibox_view.h"
#include "components/omnibox/browser/open_tab_provider.h"
#include "components/permissions/features.h"
#include "components/permissions/test/permission_request_observer.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "ui/gfx/animation/animation.h"
#include "ui/gfx/animation/animation_test_api.h"
#include "ui/views/test/views_test_utils.h"

namespace {

void RequestPermission(Browser* browser) {}

LocationBarView* GetLocationBarView(Browser* browser) {}

}  // namespace

class PermissionRequestChipGestureSensitiveBrowserTest
    : public InProcessBrowserTest {};

IN_PROC_BROWSER_TEST_F(PermissionRequestChipGestureSensitiveBrowserTest,
                       ChipFinalizedWhenInteractingWithOmnibox) {}

IN_PROC_BROWSER_TEST_F(PermissionRequestChipGestureSensitiveBrowserTest,
                       ChipIsNotShownWhenInteractingWithOmnibox) {}

// This is an end-to-end test that verifies that a permission prompt bubble will
// not be shown because of the empty address bar. Under the normal conditions
// such a test should be placed in PermissionsSecurityModelInteractiveUITest but
// due to dependency issues (see crbug.com/1112591) `//chrome/browser` is not
// allowed to have dependencies on `//chrome/browser/ui/views/*`.
IN_PROC_BROWSER_TEST_F(PermissionRequestChipGestureSensitiveBrowserTest,
                       PermissionRequestIsAutoIgnored) {}

IN_PROC_BROWSER_TEST_F(PermissionRequestChipGestureSensitiveBrowserTest,
                       ShouldUpdateActiverPRMAndObservations) {}

class PermissionRequestChipGestureInsensitiveBrowserTest
    : public InProcessBrowserTest {};

IN_PROC_BROWSER_TEST_F(PermissionRequestChipGestureInsensitiveBrowserTest,
                       CallbacksResetWhenInteractingWithOmnibox) {}

class PermissionRequestChipBrowserUiTest : public UiBrowserTest {};

IN_PROC_BROWSER_TEST_F(PermissionRequestChipBrowserUiTest,
                       InvokeUi_geolocation) {}

// This test verifies that the confirmation chip is hidden after it collapses
// even if animation is disabled.
IN_PROC_BROWSER_TEST_F(PermissionRequestChipBrowserUiTest,
                       TestDisabledAnimation) {}