Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1158)

Unified Diff: content/browser/renderer_host/input/input_router_impl_perftest.cc

Issue 2846933002: Use ScopedTaskEnvironment instead of MessageLoopForUI in content tests. (Closed)
Patch Set: self-review Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/input_router_impl_perftest.cc
diff --git a/content/browser/renderer_host/input/input_router_impl_perftest.cc b/content/browser/renderer_host/input/input_router_impl_perftest.cc
index 42f4415fa91895738a12c344da45e1fff1dbea2d..a677f3291c858c00f9b9f7a1735012c56561a614 100644
--- a/content/browser/renderer_host/input/input_router_impl_perftest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_perftest.cc
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "content/browser/renderer_host/input/input_ack_handler.h"
#include "content/browser/renderer_host/input/input_router_client.h"
#include "content/browser/renderer_host/input/input_router_impl.h"
@@ -217,7 +218,10 @@ bool ShouldBlockEventStream(const blink::WebInputEvent& event) {
class InputRouterImplPerfTest : public testing::Test {
public:
- InputRouterImplPerfTest() : last_input_id_(0) {}
+ InputRouterImplPerfTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI),
+ last_input_id_(0) {}
~InputRouterImplPerfTest() override {}
protected:
@@ -348,12 +352,12 @@ class InputRouterImplPerfTest : public testing::Test {
}
private:
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
int64_t last_input_id_;
std::unique_ptr<NullIPCSender> sender_;
std::unique_ptr<NullInputRouterClient> client_;
std::unique_ptr<NullInputAckHandler> ack_handler_;
std::unique_ptr<InputRouterImpl> input_router_;
- base::MessageLoopForUI message_loop_;
};
const size_t kDefaultSteps(100);

Powered by Google App Engine
This is Rietveld 408576698