Files
engine/testing/thread_test.cc
T
Chinmay Garde 58e84c8bf0 Re-land "Support multiple shells in a single process. (#4932)" (#4998)
* Re-land "Support multiple shells in a single process. (#4932)"

This reverts commit 723c7d0143.
2018-04-13 13:48:15 -07:00

34 lines
857 B
C++

// Copyright 2017 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#define FML_USED_ON_EMBEDDER
#include "flutter/testing/thread_test.h"
namespace testing {
void ThreadTest::SetUp() {
thread_ = std::make_unique<fml::Thread>();
thread_task_runner_ = thread_->GetTaskRunner();
fml::MessageLoop::EnsureInitializedForCurrentThread();
current_task_runner_ = fml::MessageLoop::GetCurrent().GetTaskRunner();
}
void ThreadTest::TearDown() {
thread_task_runner_ = nullptr;
thread_ = nullptr;
current_task_runner_ = nullptr;
}
fxl::RefPtr<fml::TaskRunner> ThreadTest::GetCurrentTaskRunner() {
return current_task_runner_;
}
fxl::RefPtr<fml::TaskRunner> ThreadTest::GetThreadTaskRunner() {
return thread_task_runner_;
}
} // namespace testing