Commit 891e65c5 authored by Francois Doray's avatar Francois Doray Committed by Commit Bot

Remove usage of ScopedAsyncTaskScheduler from gl_image_test_template.h.

ScopedAsyncTaskScheduler is deprecated.

Bug: 708584
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I89b92c36e714f4eb02b84f5130a75edf377cd8bf
Reviewed-on: https://chromium-review.googlesource.com/591880Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Reviewed-by: default avatarJohn Bauman <jbauman@chromium.org>
Commit-Queue: Francois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491778}
parent c6d3bde0
......@@ -14,7 +14,6 @@
#include "base/strings/stringize_macros.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_async_task_scheduler.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/buffer_format_util.h"
......@@ -177,7 +176,6 @@ class GLImageTest : public testing::Test {
}
protected:
base::test::ScopedAsyncTaskScheduler scoped_async_task_scheduler_;
scoped_refptr<GLSurface> surface_;
scoped_refptr<GLContext> context_;
GLImageTestDelegate delegate_;
......
......@@ -2,9 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/scoped_task_environment.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
......@@ -14,7 +18,6 @@
#if defined(USE_OZONE)
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
#include "ui/ozone/public/ozone_platform.h"
#endif
......@@ -28,18 +31,26 @@ class GlTestSuite : public base::TestSuite {
protected:
void Initialize() override {
base::TestSuite::Initialize();
#if defined(OS_MACOSX) && !defined(OS_IOS)
// This registers a custom NSApplication. It must be done before
// ScopedTaskEnvironment registers a regular NSApplication.
mock_cr_app::RegisterMockCrApp();
#endif
scoped_task_environment_ =
base::MakeUnique<base::test::ScopedTaskEnvironment>(
base::test::ScopedTaskEnvironment::MainThreadType::UI);
#if defined(USE_OZONE)
main_loop_.reset(new base::MessageLoopForUI());
// Make Ozone run in single-process mode, where it doesn't expect a GPU
// process and it spawns and starts its own DRM thread.
ui::OzonePlatform::InitParams params;
params.single_process = true;
// This initialization must be done after ScopedTaskEnvironment has
// initialized the UI thread.
ui::OzonePlatform::InitializeForUI(params);
#endif
#if defined(OS_MACOSX) && !defined(OS_IOS)
mock_cr_app::RegisterMockCrApp();
#endif
}
void Shutdown() override {
......@@ -47,10 +58,7 @@ class GlTestSuite : public base::TestSuite {
}
private:
#if defined(USE_OZONE)
// On Ozone, the backend initializes the event system using a UI thread.
std::unique_ptr<base::MessageLoopForUI> main_loop_;
#endif
std::unique_ptr<base::test::ScopedTaskEnvironment> scoped_task_environment_;
DISALLOW_COPY_AND_ASSIGN(GlTestSuite);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment