chromium/third_party/perfetto/src/base/task_runner_unittest.cc

/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "perfetto/base/build_config.h"

#include "perfetto/ext/base/unix_task_runner.h"

#include <thread>

#include "perfetto/ext/base/event_fd.h"
#include "perfetto/ext/base/file_utils.h"
#include "perfetto/ext/base/pipe.h"
#include "perfetto/ext/base/scoped_file.h"
#include "perfetto/ext/base/utils.h"
#include "src/base/test/gtest_test_suite.h"
#include "test/gtest_and_gmock.h"

namespace perfetto {
namespace base {
namespace {

class TaskRunnerTest : public ::testing::Test {};

TEST_F(TaskRunnerTest, PostImmediateTask) {}

TEST_F(TaskRunnerTest, PostDelayedTask) {}

TEST_F(TaskRunnerTest, PostImmediateTaskFromTask) {}

TEST_F(TaskRunnerTest, PostDelayedTaskFromTask) {}

TEST_F(TaskRunnerTest, PostImmediateTaskFromOtherThread) {}

TEST_F(TaskRunnerTest, PostDelayedTaskFromOtherThread) {}

TEST_F(TaskRunnerTest, AddFileDescriptorWatch) {}

TEST_F(TaskRunnerTest, RemoveFileDescriptorWatch) {}

TEST_F(TaskRunnerTest, RemoveFileDescriptorWatchFromTask) {}

TEST_F(TaskRunnerTest, AddFileDescriptorWatchFromAnotherWatch) {}

TEST_F(TaskRunnerTest, RemoveFileDescriptorWatchFromAnotherWatch) {}

TEST_F(TaskRunnerTest, ReplaceFileDescriptorWatchFromAnotherWatch) {}

TEST_F(TaskRunnerTest, AddFileDescriptorWatchFromAnotherThread) {}

TEST_F(TaskRunnerTest, FileDescriptorWatchWithMultipleEvents) {}

TEST_F(TaskRunnerTest, PostManyDelayedTasks) {}

TEST_F(TaskRunnerTest, RunAgain) {}

void RepeatingTask(UnixTaskRunner* task_runner) {}

TEST_F(TaskRunnerTest, FileDescriptorWatchesNotStarved) {}

void CountdownTask(UnixTaskRunner* task_runner, int* counter) {}

TEST_F(TaskRunnerTest, NoDuplicateFileDescriptorWatchCallbacks) {}

TEST_F(TaskRunnerTest, ReplaceFileDescriptorWatchFromOtherThread) {}

TEST_F(TaskRunnerTest, IsIdleForTesting) {}

TEST_F(TaskRunnerTest, RunsTasksOnCurrentThread) {}

TEST_F(TaskRunnerTest, FileDescriptorWatchFairness) {}

#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)

// This tests UNIX-specific behavior on pipe closure.
TEST_F(TaskRunnerTest, FileDescriptorClosedEvent) {}

#endif

}  // namespace
}  // namespace base
}  // namespace perfetto