chromium/third_party/blink/renderer/modules/ml/ml_trace_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 "third_party/blink/renderer/modules/ml/ml_trace.h"

#include <map>
#include <string>
#include <utility>

#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/memory/ref_counted_memory.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/bind_post_task.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/trace_event/trace_buffer.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_log.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"

namespace blink {

class ScopedMLTraceTest : public testing::Test {};

TEST_F(ScopedMLTraceTest, SingleScopeWithoutStep) {}

// Both main trace and sub-trace should have pairing begin/end.
TEST_F(ScopedMLTraceTest, SingleScopeWithStep) {}

// Multiple steps should results in multiple begin/end pairs.
TEST_F(ScopedMLTraceTest, MultipleAddSteps) {}

// Nesting top-level traces should have pairing begin/end.
TEST_F(ScopedMLTraceTest, MultipleNestedTraces) {}

// Trace handle should be passed correct across function boundaries.
TEST_F(ScopedMLTraceTest, PassScopedTraceToFunc) {}

// Trace handle should be passed correctly by posting tasks.
TEST_F(ScopedMLTraceTest, WorksWithPostCrossThreadTask) {}

TEST_F(ScopedMLTraceTest, WorksWithBindOnce) {}

}  // namespace blink