Commit 8fdf0714 authored by John Chen's avatar John Chen Committed by Commit Bot

[ChromeDriver] Fix FetchUrlTest tests on Linux

These tests were failing due to https://crrev.com/504124.
The fix is based on unit tests in that CL.

Bug: chromedriver:2044
Change-Id: Ied0f6ba1b472317f85ebb740accaac7b4c288309
Reviewed-on: https://chromium-review.googlesource.com/688680Reviewed-by: default avatarShuotao Gao <stgao@chromium.org>
Commit-Queue: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505286}
parent 163381df
......@@ -15,6 +15,7 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/scoped_task_environment.h"
#include "base/threading/thread.h"
#include "chrome/test/chromedriver/net/url_request_context_getter.h"
#include "net/base/ip_endpoint.h"
......@@ -33,7 +34,9 @@ class FetchUrlTest : public testing::Test,
public:
FetchUrlTest()
: io_thread_("io"),
response_(kSendHello) {
response_(kSendHello),
scoped_task_environment_(
base::test::ScopedTaskEnvironment::MainThreadType::IO) {
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
CHECK(io_thread_.StartWithOptions(options));
context_getter_ = new URLRequestContextGetter(io_thread_.task_runner());
......@@ -108,6 +111,7 @@ class FetchUrlTest : public testing::Test,
std::unique_ptr<net::HttpServer> server_;
scoped_refptr<URLRequestContextGetter> context_getter_;
std::string server_url_;
base::test::ScopedTaskEnvironment scoped_task_environment_;
};
} // namespace
......
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