chromium/third_party/blink/renderer/modules/compute_pressure/pressure_observer_test.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 "third_party/blink/renderer/modules/compute_pressure/pressure_observer.h"

#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/script_function.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_pressure_observer_options.h"
#include "third_party/blink/renderer/modules/compute_pressure/pressure_observer_test_utils.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "v8/include/v8.h"

namespace blink {

namespace {

// Constants to modify ChangeRateMonitor settings for deterministic test.
constexpr uint64_t kChangeCount =;
constexpr base::TimeDelta kDelayTime =;
constexpr base::TimeDelta kPenaltyDuration =;

// Helper class for WaitForPromiseFulfillment(). It provides a
// function that invokes |callback| when a ScriptPromiseUntyped is resolved.
class ClosureRunnerCallable final : public ScriptFunction::Callable {};

void WaitForPromiseFulfillment(ScriptState* script_state,
                               ScriptPromiseUntyped promise) {}

}  // namespace

TEST(PressureObserverTest, PressureObserverDisconnectBeforePenaltyEnd) {}

TEST(PressureObserverTest, PressureObserverUnobserveBeforePenaltyEnd) {}

}  // namespace blink