chromium/chrome/browser/ui/views/location_bar/content_setting_bubble_dialog_browsertest.cc

// Copyright 2017 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/auto_reset.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/content_settings/page_specific_content_settings_delegate.h"
#include "chrome/browser/download/download_request_limiter.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/blocked_content/chrome_popup_navigation_delegate.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/content_settings/content_setting_image_model.h"
#include "chrome/browser/ui/location_bar/location_bar.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/browser/ui/views/content_setting_bubble_contents.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/common/chrome_features.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/blocked_content/popup_blocker_tab_helper.h"
#include "components/content_settings/browser/page_specific_content_settings.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/features.h"
#include "components/content_settings/core/test/content_settings_mock_provider.h"
#include "components/content_settings/core/test/content_settings_test_utils.h"
#include "components/permissions/features.h"
#include "components/permissions/permission_request_manager.h"
#include "components/permissions/permission_ui_selector.h"
#include "components/permissions/request_type.h"
#include "components/permissions/test/mock_permission_request.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "url/gurl.h"

namespace {

QuietUiReason;

// Test implementation of NotificationPermissionUiSelector that always forces
// the quiet UI to be used for surfacing notification permission requests.
class TestQuietNotificationPermissionUiSelector
    : public permissions::PermissionUiSelector {};

// An override that returns a fake URL for every blocked popup, so the UI
// displays consistent strings for pixel tests.
class TestPopupNavigationDelegate : public ChromePopupNavigationDelegate {};

std::unique_ptr<blocked_content::PopupNavigationDelegate>
CreateTestPopupNavigationDelegate(NavigateParams params) {}

}  // namespace

ImageType;

class ContentSettingBubbleDialogTest
    : public DialogBrowserTest,
      public testing::WithParamInterface<content_settings::ProviderType> {};

void ContentSettingBubbleDialogTest::ApplyMediastreamSettings(
    bool mic_accessed,
    bool camera_accessed) {}

void ContentSettingBubbleDialogTest::ApplyContentSettingsForType(
    ContentSettingsType content_type) {}

void ContentSettingBubbleDialogTest::TriggerQuietNotificationPermissionRequest(
    QuietUiReason simulated_reason_for_quiet_ui) {}

void ContentSettingBubbleDialogTest::OverrideContentSettingsProvider(
    const std::vector<ContentSettingsType>& types) {}

void ContentSettingBubbleDialogTest::NavigateToContentTab() {}

void ContentSettingBubbleDialogTest::ShowDialogBubble(
    ContentSettingImageModel::ImageType image_type) {}

void ContentSettingBubbleDialogTest::ShowUi(const std::string& name) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_cookies) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_images) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_javascript) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_popups) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_geolocation) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_mixed_script) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest,
                       InvokeUi_mediastream_mic) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest,
                       InvokeUi_mediastream_camera) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest,
                       InvokeUi_mediastream_mic_and_camera) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest,
                       InvokeUi_protocol_handlers) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest,
                       InvokeUi_automatic_downloads) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_midi_sysex) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest, InvokeUi_ads) {}

IN_PROC_BROWSER_TEST_P(ContentSettingBubbleDialogTest,
                       InvokeUi_storage_access) {}

INSTANTIATE_TEST_SUITE_P();