Commit 2de48540 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoop in /ui/gfx/range/mojo

MessageLoop will go away, eventually.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you belive your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.

BUG=891670
This CL was uploaded by git cl split

Change-Id: I4f758e010b973362f1c64f8fe6b821ec6f90e760
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1643867Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#666631}
parent 0adc45c2
...@@ -32,6 +32,7 @@ source_set("unit_test") { ...@@ -32,6 +32,7 @@ source_set("unit_test") {
deps = [ deps = [
":test_interfaces", ":test_interfaces",
"//base", "//base",
"//base/test:test_support",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
"//testing/gtest", "//testing/gtest",
"//ui/gfx/range", "//ui/gfx/range",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <utility> #include <utility>
#include "base/message_loop/message_loop.h" #include "base/test/scoped_task_environment.h"
#include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/binding_set.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/range/mojo/range_traits_test_service.mojom.h" #include "ui/gfx/range/mojo/range_traits_test_service.mojom.h"
...@@ -35,7 +35,7 @@ class RangeStructTraitsTest : public testing::Test, ...@@ -35,7 +35,7 @@ class RangeStructTraitsTest : public testing::Test,
std::move(callback).Run(p); std::move(callback).Run(p);
} }
base::MessageLoop loop_; base::test::ScopedTaskEnvironment scoped_task_environment_;
mojo::BindingSet<RangeTraitsTestService> traits_test_bindings_; mojo::BindingSet<RangeTraitsTestService> traits_test_bindings_;
DISALLOW_COPY_AND_ASSIGN(RangeStructTraitsTest); DISALLOW_COPY_AND_ASSIGN(RangeStructTraitsTest);
......
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