Commit 85ddefea authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

Add IO Thread to TestBlinkWebUnitTestSupport

This is required to support moving code from content/renderer
to Blink (i.e., Onion Souping) that uses the IO Thread.

Bug: 928021
Change-Id: I67210ee7e958403d559c2fc99783699991e7ad92
Reviewed-on: https://chromium-review.googlesource.com/c/1450266Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628915}
parent beb5f278
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "cc/trees/layer_tree_settings.h" #include "cc/trees/layer_tree_settings.h"
#include "content/app/mojo/mojo_init.h" #include "content/app/mojo/mojo_init.h"
#include "content/child/child_process.h"
#include "content/public/common/service_names.mojom.h" #include "content/public/common/service_names.mojom.h"
#include "content/renderer/loader/web_data_consumer_handle_impl.h" #include "content/renderer/loader/web_data_consumer_handle_impl.h"
#include "content/renderer/loader/web_url_loader_impl.h" #include "content/renderer/loader/web_url_loader_impl.h"
...@@ -288,6 +289,12 @@ blink::WebString TestBlinkWebUnitTestSupport::DefaultLocale() { ...@@ -288,6 +289,12 @@ blink::WebString TestBlinkWebUnitTestSupport::DefaultLocale() {
return blink::WebString::FromASCII("en-US"); return blink::WebString::FromASCII("en-US");
} }
scoped_refptr<base::SingleThreadTaskRunner>
TestBlinkWebUnitTestSupport::GetIOTaskRunner() const {
return ChildProcess::current() ? ChildProcess::current()->io_task_runner()
: nullptr;
}
blink::WebURLLoaderMockFactory* blink::WebURLLoaderMockFactory*
TestBlinkWebUnitTestSupport::GetURLLoaderMockFactory() { TestBlinkWebUnitTestSupport::GetURLLoaderMockFactory() {
return url_loader_factory_.get(); return url_loader_factory_.get();
......
...@@ -49,6 +49,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { ...@@ -49,6 +49,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl {
const blink::WebString& value1, const blink::WebString& value1,
const blink::WebString& value2) override; const blink::WebString& value2) override;
blink::WebString DefaultLocale() override; blink::WebString DefaultLocale() override;
scoped_refptr<base::SingleThreadTaskRunner> GetIOTaskRunner() const override;
blink::WebURLLoaderMockFactory* GetURLLoaderMockFactory() override; blink::WebURLLoaderMockFactory* GetURLLoaderMockFactory() override;
......
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