chromium/content/public/test/browser_task_environment_unittest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/public/test/browser_task_environment.h"

#include <string>

#include "base/atomicops.h"
#include "base/dcheck_is_on.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/current_thread.h"
#include "base/task/thread_pool.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "build/build_config.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

TaskEnvironment;

namespace content {

namespace {

// BrowserTaskEnvironmentTest.RunUntilIdle will run kNumTasks tasks that will
// hop back-and-forth between ThreadPool and UI thread kNumHops times.
// Note: These values are arbitrary.
constexpr int kNumHops =;
constexpr int kNumTasks =;

const char kDeathMatcher[] =;

void PostTaskToUIThread(int iteration, base::subtle::Atomic32* tasks_run);

void PostToThreadPool(int iteration, base::subtle::Atomic32* tasks_run) {}

void PostTaskToUIThread(int iteration, base::subtle::Atomic32* tasks_run) {}

}  // namespace

TEST(BrowserTaskEnvironmentTest, RunUntilIdle) {}

namespace {

void PostRecurringTaskToIOThread(int iteration, int* tasks_run) {}

}  // namespace

TEST(BrowserTaskEnvironmentTest, RunIOThreadUntilIdle) {}

TEST(BrowserTaskEnvironmentTest, MessageLoopTypeMismatch) {}

TEST(BrowserTaskEnvironmentTest, MultipleBrowserTaskEnvironment) {}

TEST(BrowserTaskEnvironmentTest, TraitsConstructor) {}

TEST(BrowserTaskEnvironmentTest, TraitsConstructorOverrideMainThreadType) {}

// Verify that posting tasks to the UI thread without having the
// BrowserTaskEnvironment instance cause a crash.
TEST(BrowserTaskEnvironmentTest, NotInitializedUIThread) {}

// Verify that posting tasks to the IO thread without having the
// BrowserTaskEnvironment instance cause a crash.
TEST(BrowserTaskEnvironmentTest, NotInitializedIOThread) {}

}  // namespace content