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

// Copyright 2023 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/test/scoped_feature_list.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/controls/rich_controls_container_view.h"
#include "chrome/browser/ui/views/location_bar/content_setting_image_view.h"
#include "chrome/browser/ui/views/page_info/page_info_main_view.h"
#include "chrome/browser/ui/views/page_info/permission_toggle_row_view.h"
#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/interaction/interactive_browser_test.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "third_party/blink/public/common/features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/interaction/interaction_test_util_views.h"
#include "ui/views/interaction/interactive_views_test.h"
#include "ui/views/view_utils.h"

namespace {

DEFINE_LOCAL_ELEMENT_IDENTIFIER_VALUE();

}  // namespace

// Test permissions UI behavior when the flag BlockMidiByDefault is enabled.
class MidiPermissionsFlowInteractiveUITest : public InteractiveBrowserTest {};

// Display MIDI permission prompt.
IN_PROC_BROWSER_TEST_F(MidiPermissionsFlowInteractiveUITest, PermissionPrompt) {}

// Display MIDI permission state in page info when denied.
IN_PROC_BROWSER_TEST_F(MidiPermissionsFlowInteractiveUITest,
                       BlockedMidiPermissionInPageInfo) {}

// Display MIDI permission state in page info when allowed.
IN_PROC_BROWSER_TEST_F(MidiPermissionsFlowInteractiveUITest,
                       AllowedMidiPermissionInPageInfo) {}

// Display blockage indicator of MIDI when blocked.
IN_PROC_BROWSER_TEST_F(MidiPermissionsFlowInteractiveUITest,
                       BlockedMidiPermissionIndicator) {}

// Display in-use indicator of MIDI when allowed.
IN_PROC_BROWSER_TEST_F(MidiPermissionsFlowInteractiveUITest,
                       AllowedMidiPermissionIndicator) {}