chromium/content/browser/compute_pressure/pressure_service_for_worker_unittest.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 <vector>

#include "base/barrier_closure.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ref.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
#include "base/time/time.h"
#include "content/browser/compute_pressure/pressure_client_impl.h"
#include "content/browser/compute_pressure/web_contents_pressure_manager_proxy.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/worker_host/dedicated_worker_host.h"
#include "content/browser/worker_host/dedicated_worker_service_impl.h"
#include "content/browser/worker_host/shared_worker_host.h"
#include "content/browser/worker_host/shared_worker_service_impl.h"
#include "content/public/browser/shared_worker_instance.h"
#include "content/public/test/navigation_simulator.h"
#include "content/test/test_render_frame_host.h"
#include "content/test/test_render_view_host.h"
#include "content/test/test_web_contents.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "services/device/public/cpp/test/scoped_pressure_manager_overrider.h"
#include "services/device/public/mojom/pressure_manager.mojom.h"
#include "services/device/public/mojom/pressure_update.mojom.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/permissions_policy/permissions_policy.h"
#include "third_party/blink/public/common/permissions_policy/permissions_policy_declaration.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/mojom/compute_pressure/web_pressure_manager.mojom.h"
#include "url/gurl.h"

namespace content {

PressureManagerAddClientError;
PressureSource;
PressureState;
PressureUpdate;

namespace {

// Test double for PressureClient that records all updates.
class FakePressureClient : public device::mojom::PressureClient {};

}  // namespace

class PressureServiceForDedicatedWorkerTest
    : public RenderViewHostImplTestHarness {};

TEST_F(PressureServiceForDedicatedWorkerTest, AddClient) {}

TEST_F(PressureServiceForDedicatedWorkerTest,
       WebContentPressureManagerProxyTest) {}

TEST_F(PressureServiceForDedicatedWorkerTest, PermissionsPolicyBlock) {}

class PressureServiceForSharedWorkerTest
    : public RenderViewHostImplTestHarness {};

TEST_F(PressureServiceForSharedWorkerTest, AddClient) {}

TEST_F(PressureServiceForSharedWorkerTest, WebContentPressureManagerProxyTest) {}

TEST_F(PressureServiceForSharedWorkerTest, PermissionsPolicyBlock) {}

TEST_F(PressureServiceForSharedWorkerTest,
       ResetWhenClientWithoutPermissionsPolicy) {}

}  // namespace content