chromium/chrome/browser/ui/views/page_info/page_info_permission_content_view_unittest.cc

// Copyright 2024 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/page_info/page_info_permission_content_view.h"

#if !BUILDFLAG(IS_CHROMEOS)

#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "chrome/browser/ui/page_info/chrome_page_info_delegate.h"
#include "chrome/browser/ui/page_info/chrome_page_info_ui_delegate.h"
#include "chrome/browser/ui/views/frame/test_with_browser_view.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/media_effects/test/fake_audio_service.h"
#include "components/media_effects/test/fake_video_capture_service.h"
#include "components/media_effects/test/scoped_media_device_info.h"
#include "components/permissions/permission_recovery_success_rate_tracker.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/label.h"

Bucket;
ElementsAre;

namespace {

constexpr char kCameraId[] =;
constexpr char kCameraName[] =;
constexpr char kCameraId2[] =;
constexpr char kCameraName2[] =;

constexpr char kMicId[] =;
constexpr char kMicName[] =;
constexpr char kGroupId[] =;
constexpr char kMicId2[] =;
constexpr char kMicName2[] =;
constexpr char kGroupId2[] =;
constexpr char kOriginTrialAllowedHistogramName[] =;

blink::mojom::MediaStreamType GetStreamTypeFromSettingsType(
    ContentSettingsType type) {}

}  // namespace

// Takes care of all setup needed to initialize page info permission content
// view (e.g. web contents, PageInfo, ...), as well as media previews (e.g.
// audio service, video service, ...).
class PageInfoPermissionContentViewTestMediaPreview
    : public TestWithBrowserView {};

// Verify the device counter as well as the tooltip for the title label for page
// info camera subpage.
TEST_F(PageInfoPermissionContentViewTestMediaPreview, MediaPreviewCamera) {}

// Verify the device counter as well as the tooltip for the title label for page
// info ptz camera subpage.
TEST_F(PageInfoPermissionContentViewTestMediaPreview, MediaPreviewPTZCamera) {}

// Verify the device counter as well as the tooltip for the title label for page
// info mic subpage.
TEST_F(PageInfoPermissionContentViewTestMediaPreview, MediaPreviewMic) {}

// Verify there is no preview created when there is no camera or mic permissions
// requested.
TEST_F(PageInfoPermissionContentViewTestMediaPreview,
       MediaPreviewNoCameraOrMic) {}

#endif