chromium/chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_internals_handler_browsertest.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 "chrome/browser/ui/webui/privacy_sandbox/privacy_sandbox_internals_handler.h"

#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "chrome/browser/content_settings/cookie_settings_factory.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/webui/privacy_sandbox/privacy_sandbox_internals.mojom.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_pattern_parser.h"
#include "components/tpcd/metadata/browser/parser.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace privacy_sandbox_internals {
namespace {
PageHandler;
AllOf;
Contains;
Eq;
Field;
Ge;
Property;
SizeIs;
StrEq;
UnorderedElementsAreArray;

static const char kPrefName[] =;

// Helper to aid in waiting for mojo callbacks to happen.
class CallbackWaiter {};

class PrivacySandboxInternalsMojoTest : public InProcessBrowserTest {};

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest, ReadPref) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest, ReadPref_NonExistant) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest, GetCookieSettings) {}

// TODO(crbug.com/41490688): Once ConvertGenerator<T>() is provided by
// the version of googletest used by Chromium we can type the test param.
class PrivacySandboxInternalsContentSettingsMojoTest
    : public PrivacySandboxInternalsMojoTest,
      public testing::WithParamInterface<int> {};

INSTANTIATE_TEST_SUITE_P();

IN_PROC_BROWSER_TEST_P(PrivacySandboxInternalsContentSettingsMojoTest,
                       ReadContentSettingsEmpty) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest, GetTpcdMetadataGrants) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest,
                       GetTpcdHeuristicGrants) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest, GetTpcdTrial) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest, GetTopLevelTpcdTrial) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest,
                       ContentSettingsPatternToString) {}

IN_PROC_BROWSER_TEST_F(PrivacySandboxInternalsMojoTest,
                       StringToContentSettingsPattern) {}

}  // namespace
}  // namespace privacy_sandbox_internals