chromium/third_party/blink/renderer/platform/graphics/scoped_raster_timer_test.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 "third_party/blink/renderer/platform/graphics/scoped_raster_timer.h"

#include "base/test/metrics/histogram_tester.h"
#include "cc/test/stub_decode_cache.h"
#include "components/viz/test/test_context_provider.h"
#include "components/viz/test/test_gles2_interface.h"
#include "components/viz/test/test_raster_interface.h"
#include "gpu/command_buffer/common/shared_image_usage.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource_provider.h"
#include "third_party/blink/renderer/platform/graphics/gpu/shared_gpu_context.h"
#include "third_party/blink/renderer/platform/graphics/test/gpu_memory_buffer_test_platform.h"
#include "third_party/blink/renderer/platform/graphics/test/gpu_test_utils.h"
#include "third_party/blink/renderer/platform/graphics/web_graphics_context_3d_provider_wrapper.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {

Test;

constexpr base::TimeDelta kExpectedCPUDuration =;
// kExpectedGPUDuration does not need to be related to kMockElapsedTime.
// We chose kMockElapsedTime * 2 arbitrarily to ensure that CPU, GPU, and
// Total duration values all end up in different histogram buckets.
constexpr base::TimeDelta kExpectedGPUDuration =;

// This is a fake raster interface that will always report that GPU
// commands have finished executing in kExpectedGPUDuration microseconds.
class FakeRasterCommandsCompleted : public viz::TestRasterInterface {};

class ScopedRasterTimerTest : public Test {};

TEST_F(ScopedRasterTimerTest, UnacceleratedRasterDuration) {}

TEST_F(ScopedRasterTimerTest, AcceleratedRasterDuration) {}

}  // namespace blink