Revert "Merge all content_shell renderer layout_test code."

This reverts commit 1fa4591ecc787726b8a7071090e4a7b8b61b57dd.

Reason for revert: In hopes of greening tree. Sample failure from https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Win/71221 : (see the compile no-op stage)

ninja explain: output obj/content/test/nested_message_pump_android.lib doesn't exist
ninja explain: obj/content/test/nested_message_pump_android.lib is dirty

Original change's description:
> Merge all content_shell renderer layout_test code.
> 
> R=​[email protected]
> [email protected]
> 
> Currently layout test code is split over:
> 
> - content/shell/test_runner/ (separate component)
> Has renderer-side code, is allowed to use content/renderer/, does not
> use content/shell/renderer/.
> 
> - content/shell/renderer/layout_test/ (part of content_shell_lib)
> Has renderer-side code, makes light use of content/shell/renderer/, but is
> not able to use content/renderer/.
> 
> - content/shell/browser/layout_test/ (part of content_shell_lib)
> Has browser-side code, makes heavy use of content/shell/browser/, but is
> not able to use content/browser/.
> 
> - content/public/test/layouttest_support.h
> Header for access to content/renderer/ things and content/browser/
> things. Used by content/shell/renderer/layout_test/ and
> content/shell/browser/layout_test/.
> 
> - content/test/layouttest_support.cc
> Impls for access to content/renderer/ and content/browser/ things.
> 
> 
> This patch aims to
> 1. Combine the test_runner/ and shell/renderer/layout_test/ pieces of
> code so they don't need to use indirections to interact. Their
> separation is a legacy of test_runner/ being implemented inside blink
> (WebKit) in the past.
> 2. Move layouttest_support.h out of content/public/ and the .cc out of
> content/test/ to a layout_test-specific code location.
> 
> To do (1), test_runner/* moves to shell/renderer/layout_test/*. This
> is fairly straight forward. We remove the TEST_RUNNER_EXPORT macro
> as they are now part of a static library. They are left in the
> test_runner namespace at the moment.
> 
> To do (2), we move layouttest_support.(cc|h) to
> shell/renderer/layout_test/. There are 3 methods in the file that
> are called from shell/browser/layout_test/ and use content/browser
> so we split those out to shell/browser/layout_test/.
> 
> However this causes a problem that content_shell_lib will depend
> on content/{browser,child,renderer}/ via the layouttest_support.cc
> file. To avoid this, we
> - Move content/shell/renderer/layout_test/* into a separate build
> target called //content/shell:layout_test_renderer_lib and we
> give it visibility to content/renderer/ and content/child/.
> - Move content/shell/browser/layout_test/layouttest_support.* into
> a separate build target called
> //content/shell:browser_layout_test_support_lib. We don't move all
> of content/shell/browser/layout_test/* because of heavy interaction
> between it and its parent directory at this time.
> - For a few files used by the shell/renderer/ (and shell/) and
> shell/renderer/layout_test/ directories, we move them out to a
> shared library as well, called
> //content/shell:content_shell_renderer_common_lib.
> - And for the common/layout_test/layout_test_switches.cc files,
> which are used in both, but we'd like to not leak out of
> content_shell_lib since they are part of .../layout_test/, we
> make a non-public dep on //content/shell:content_shell_common_test_lib
> 
> Ideally, I think we have a separate library for
> //content/shell/browser/layout_test
> //content/shell/common/layout_test
> //content/shell/renderer/layout_test
> 
> But we need better indirection between the content_shell_lib and
> the .../layout_test/ code in order to do that. Once it was so, we
> would be closer to making it possible to have a content_shell build
> target that does not include any test code (and thus truly only uses
> the public APIs), and a separate content_shell-like build target
> that includes the layout test code.
> 
> Bug: 866140
> Change-Id: Ia39f7385711bdb610948a07fd473ad9b346b82ae
> Reviewed-on: https://chromium-review.googlesource.com/1145644
> Reviewed-by: danakj <[email protected]>
> Reviewed-by: Dmitry Gozman <[email protected]>
> Reviewed-by: Daniel Cheng <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#578734}

[email protected],[email protected],[email protected],[email protected]

Change-Id: Ie61b12dcfc00e5c59cf0c5e3137b305d957cb261
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 866140
Reviewed-on: https://chromium-review.googlesource.com/1153611
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Scott Violet <[email protected]>
Cr-Commit-Position: refs/heads/master@{#578764}
diff --git a/components/BUILD.gn b/components/BUILD.gn
index ee9cf48..99ac8b25 100644
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -514,7 +514,7 @@
       sources -= [ "autofill/content/browser/risk/fingerprint_browsertest.cc" ]
       deps += [
         "//content/public/test/android:layouttest_java_support",
-        "//content/test:nested_message_pump_android",
+        "//content/test:layouttest_support",
         "//testing/android/native_test:native_test_support",
       ]
       use_default_launcher = false
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 6b6a64b..71ba3c44 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2463,10 +2463,7 @@
 
 # See comment at the top of //content/BUILD.gn for how this works.
 group("for_content_tests") {
-  visibility = [
-    "//content/shell:browser_layout_test_support_lib",
-    "//content/test/*",
-  ]
+  visibility = [ "//content/test/*" ]
   if (!is_component_build) {
     public_deps = [
       ":browser",
diff --git a/content/child/BUILD.gn b/content/child/BUILD.gn
index d9f0219..1f8971c0 100644
--- a/content/child/BUILD.gn
+++ b/content/child/BUILD.gn
@@ -176,10 +176,7 @@
 
 # See comment at the top of //content/BUILD.gn for how this works.
 group("for_content_tests") {
-  visibility = [
-    "//content/shell:layout_test_renderer_lib",
-    "//content/test/*",
-  ]
+  visibility = [ "//content/test/*" ]
   if (!is_component_build) {
     public_deps = [
       ":child",
diff --git a/content/public/test/content_browser_test.cc b/content/public/test/content_browser_test.cc
index e7dc063..9c1304b 100644
--- a/content/public/test/content_browser_test.cc
+++ b/content/public/test/content_browser_test.cc
@@ -18,7 +18,7 @@
 #include "content/shell/browser/shell_browser_context.h"
 #include "content/shell/browser/shell_content_browser_client.h"
 #include "content/shell/common/shell_switches.h"
-#include "content/shell/renderer/shell_content_renderer_client.h"
+#include "content/shell/renderer/layout_test/layout_test_content_renderer_client.h"
 #include "content/test/test_content_client.h"
 
 #if defined(OS_ANDROID)
@@ -71,7 +71,9 @@
     // setting a global that may be used after ContentBrowserTest is
     // destroyed.
     ContentRendererClient* old_client =
-        SetRendererClientForTesting(new ShellContentRendererClient);
+        switches::IsRunWebTestsSwitchPresent()
+            ? SetRendererClientForTesting(new LayoutTestContentRendererClient)
+            : SetRendererClientForTesting(new ShellContentRendererClient);
     // No-one should have set this value before we did.
     DCHECK(!old_client);
   }
diff --git a/content/shell/renderer/layout_test/layouttest_support.h b/content/public/test/layouttest_support.h
similarity index 84%
rename from content/shell/renderer/layout_test/layouttest_support.h
rename to content/public/test/layouttest_support.h
index 6b4b6cb8..06de084 100644
--- a/content/shell/renderer/layout_test/layouttest_support.h
+++ b/content/public/test/layouttest_support.h
@@ -1,9 +1,9 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUTTEST_SUPPORT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUTTEST_SUPPORT_H_
+#ifndef CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
+#define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
 
 #include <stddef.h>
 
@@ -24,7 +24,7 @@
 class WebURL;
 class WebURLRequest;
 class WebView;
-}  // namespace blink
+}
 
 namespace gfx {
 class ColorSpace;
@@ -34,12 +34,22 @@
 class WebFrameTestProxyBase;
 class WebViewTestProxyBase;
 class WebWidgetTestProxyBase;
-}  // namespace test_runner
+}
 
 namespace content {
 
 class RenderFrame;
 class RenderView;
+class StoragePartition;
+
+// Turn the browser process into layout test mode.
+void EnableBrowserLayoutTestMode();
+
+// Terminates all workers and notifies when complete. This is used for
+// testing when it is important to make sure that all shared worker activity
+// has stopped.
+void TerminateAllSharedWorkersForTesting(StoragePartition* storage_partition,
+                                         base::OnceClosure callback);
 
 ///////////////////////////////////////////////////////////////////////////////
 // The following methods are meant to be used from a renderer.
@@ -108,6 +118,13 @@
 void SetDeviceColorSpace(RenderView* render_view,
                          const gfx::ColorSpace& color_space);
 
+// Sets the scan duration to reflect the given setting.
+enum class BluetoothTestScanDurationSetting {
+  kImmediateTimeout,  // Set the scan duration to 0 seconds.
+  kNeverTimeout,  // Set the scan duration to base::TimeDelta::Max() seconds.
+};
+void SetTestBluetoothScanDuration(BluetoothTestScanDurationSetting setting);
+
 // Enables or disables synchronous resize mode. When enabled, all window-sizing
 // machinery is short-circuited inside the renderer. This mode is necessary for
 // some tests that were written before browsers had multi-process architecture
@@ -142,4 +159,4 @@
 
 }  // namespace content
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUTTEST_SUPPORT_H_
+#endif  // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
diff --git a/content/shell/renderer/layout_test/test_runner_support.h b/content/public/test/test_runner_support.h
similarity index 69%
rename from content/shell/renderer/layout_test/test_runner_support.h
rename to content/public/test/test_runner_support.h
index 647decfa5..8c4d95f9 100644
--- a/content/shell/renderer/layout_test/test_runner_support.h
+++ b/content/public/test/test_runner_support.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_SUPPORT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_SUPPORT_H_
+#ifndef CONTENT_PUBLIC_TEST_TEST_RUNNER_SUPPORT_H_
+#define CONTENT_PUBLIC_TEST_TEST_RUNNER_SUPPORT_H_
 
 #include <string>
 
@@ -19,4 +19,4 @@
 
 }  // namespace content
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_SUPPORT_H_
+#endif  // CONTENT_PUBLIC_TEST_TEST_RUNNER_SUPPORT_H_
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index cd7059c..177147e 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -1034,7 +1034,7 @@
 # See comment at the top of //content/BUILD.gn for how this works.
 group("for_content_tests") {
   visibility = [
-    "//content/shell:layout_test_renderer_lib",
+    "//content/shell/test_runner",
     "//content/test/*",
   ]
 
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn
index 335918aa..698aaa4c 100644
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -46,31 +46,7 @@
   ]
 }
 
-# Stuff that is depended on by shell/ and shell/renderer/layout_test/
-# code, and that is part of the content_shell_lib publicly.
-source_set("content_shell_common_lib") {
-  testonly = true
-  sources = [
-    "common/layout_test/layout_test_messages.cc",
-    "common/layout_test/layout_test_messages.h",
-    "common/power_monitor_test_impl.cc",
-    "common/power_monitor_test_impl.h",
-    "common/shell_messages.cc",
-    "common/shell_messages.h",
-    "common/shell_switches.cc",
-    "common/shell_switches.h",
-  ]
-  deps = [
-    ":content_shell_common_test_lib",
-    "//base",
-    "//content/public/common",
-    "//content/shell:mojo_bindings",
-  ]
-}
-
-# Stuff that is depended on by shell/ and shell/renderer/layout_test/
-# code, and that is for testing only so should be private to content_shell_lib.
-source_set("content_shell_common_test_lib") {
+source_set("layout_test_switches") {
   testonly = true
   sources = [
     "common/layout_test/layout_test_switches.cc",
@@ -78,33 +54,6 @@
   ]
 }
 
-# Renderer code for content shell is separated out of content_shell_lib
-# because content/shell/layout_test/ depends on it as well as content/shell/.
-source_set("content_shell_renderer_lib") {
-  testonly = true
-  sources = [
-    "renderer/shell_content_renderer_client.cc",
-    "renderer/shell_content_renderer_client.h",
-    "renderer/shell_render_view_observer.cc",
-    "renderer/shell_render_view_observer.h",
-  ]
-  deps = [
-    ":content_shell_common_lib",
-    "//base",
-    "//components/cdm/renderer",
-    "//components/web_cache/renderer",
-    "//content/public/child",
-    "//content/public/common",
-    "//content/public/renderer",
-    "//content/test:content_test_mojo_bindings",
-    "//media",
-    "//media/mojo:buildflags",
-    "//ppapi/buildflags",
-    "//third_party/blink/public:blink",
-    "//v8",
-  ]
-}
-
 static_library("content_shell_lib") {
   testonly = true
   sources = [
@@ -224,12 +173,40 @@
     "browser/shell_web_contents_view_delegate_mac.mm",
     "common/layout_test/layout_test_content_client.cc",
     "common/layout_test/layout_test_content_client.h",
+    "common/layout_test/layout_test_messages.cc",
+    "common/layout_test/layout_test_messages.h",
+    "common/power_monitor_test_impl.cc",
+    "common/power_monitor_test_impl.h",
     "common/shell_content_client.cc",
     "common/shell_content_client.h",
+    "common/shell_messages.cc",
+    "common/shell_messages.h",
     "common/shell_origin_trial_policy.cc",
     "common/shell_origin_trial_policy.h",
+    "common/shell_switches.cc",
+    "common/shell_switches.h",
     "gpu/shell_content_gpu_client.cc",
     "gpu/shell_content_gpu_client.h",
+    "renderer/layout_test/blink_test_helpers.cc",
+    "renderer/layout_test/blink_test_helpers.h",
+    "renderer/layout_test/blink_test_runner.cc",
+    "renderer/layout_test/blink_test_runner.h",
+    "renderer/layout_test/layout_test_content_renderer_client.cc",
+    "renderer/layout_test/layout_test_content_renderer_client.h",
+    "renderer/layout_test/layout_test_render_frame_observer.cc",
+    "renderer/layout_test/layout_test_render_frame_observer.h",
+    "renderer/layout_test/layout_test_render_thread_observer.cc",
+    "renderer/layout_test/layout_test_render_thread_observer.h",
+    "renderer/layout_test/test_media_stream_renderer_factory.cc",
+    "renderer/layout_test/test_media_stream_renderer_factory.h",
+    "renderer/layout_test/test_media_stream_video_renderer.cc",
+    "renderer/layout_test/test_media_stream_video_renderer.h",
+    "renderer/layout_test/test_websocket_handshake_throttle_provider.cc",
+    "renderer/layout_test/test_websocket_handshake_throttle_provider.h",
+    "renderer/shell_content_renderer_client.cc",
+    "renderer/shell_content_renderer_client.h",
+    "renderer/shell_render_view_observer.cc",
+    "renderer/shell_render_view_observer.h",
     "utility/shell_content_utility_client.cc",
     "utility/shell_content_utility_client.h",
   ]
@@ -246,8 +223,6 @@
 
   public_deps = [
     ":android_shell_descriptors",
-    ":content_shell_common_lib",
-    ":content_shell_renderer_lib",
 
     # This exposes all public content APIs.
     "//content/public/app:both",
@@ -261,10 +236,8 @@
     "//services/network:network_service",
   ]
   deps = [
-    ":browser_layout_test_support_lib",
-    ":content_shell_common_test_lib",
     ":content_shell_packaged_services_manifest_overlay",
-    ":layout_test_renderer_lib",
+    ":layout_test_switches",
     ":mojo_bindings",
     ":resources",
     "//base",
@@ -290,7 +263,9 @@
     "//content/gpu",
     "//content/public/common",
     "//content/public/common:service_names",
+    "//content/shell/test_runner:test_runner",
     "//content/test:content_test_mojo_bindings",
+    "//content/test:layouttest_support",
     "//content/test:mojo_layouttest_bindings",
     "//content/test:test_support",
     "//device/bluetooth",
@@ -348,6 +323,9 @@
     deps += [ "//third_party/fuchsia-sdk:policy" ]
   }
 
+  # Annoyingly, this target and layouttest_support have circular includes.
+  allow_circular_includes_from = [ "//content/test:layouttest_support" ]
+
   if (enable_plugins) {
     deps += [
       "//cc/paint",
@@ -393,7 +371,6 @@
       "//base/test:test_support",
       "//components/embedder_support/android:view",
       "//content/shell/android:content_shell_jni_headers",
-      "//content/test:nested_message_pump_android",
       "//mojo/public/java/system:test_support",
     ]
   }
@@ -455,172 +432,6 @@
   }
 }
 
-# This uses //content/browser/ private internals. We can't put all of
-# shell/browser/layout_test/ in here at this time, because of circular
-# dependencies between it and shell/browser/
-static_library("browser_layout_test_support_lib") {
-  testonly = true
-  sources = [
-    "browser/layout_test/layouttest_support.cc",
-    "browser/layout_test/layouttest_support.h",
-  ]
-
-  configs += [
-    "//build/config:precompiled_headers",
-
-    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
-    "//build/config/compiler:no_size_t_to_int_warning",
-  ]
-
-  # See comment at the top of //content/BUILD.gn for why this is disabled in
-  # component builds.
-  if (is_component_build) {
-    check_includes = false
-  }
-
-  deps = [
-    "//content/browser:for_content_tests",
-    "//content/public/browser",
-    "//gpu/ipc/service",
-  ]
-}
-
-static_library("layout_test_renderer_lib") {
-  testonly = true
-  sources = [
-    "renderer/layout_test/accessibility_controller.cc",
-    "renderer/layout_test/accessibility_controller.h",
-    "renderer/layout_test/app_banner_service.cc",
-    "renderer/layout_test/app_banner_service.h",
-    "renderer/layout_test/blink_test_helpers.cc",
-    "renderer/layout_test/blink_test_helpers.h",
-    "renderer/layout_test/blink_test_runner.cc",
-    "renderer/layout_test/blink_test_runner.h",
-    "renderer/layout_test/event_sender.cc",
-    "renderer/layout_test/event_sender.h",
-    "renderer/layout_test/gamepad_controller.cc",
-    "renderer/layout_test/gamepad_controller.h",
-    "renderer/layout_test/gc_controller.cc",
-    "renderer/layout_test/gc_controller.h",
-    "renderer/layout_test/layout_and_paint_async_then.cc",
-    "renderer/layout_test/layout_and_paint_async_then.h",
-    "renderer/layout_test/layout_dump.cc",
-    "renderer/layout_test/layout_dump.h",
-    "renderer/layout_test/layout_test_content_renderer_client.cc",
-    "renderer/layout_test/layout_test_content_renderer_client.h",
-    "renderer/layout_test/layout_test_render_frame_observer.cc",
-    "renderer/layout_test/layout_test_render_frame_observer.h",
-    "renderer/layout_test/layout_test_render_thread_observer.cc",
-    "renderer/layout_test/layout_test_render_thread_observer.h",
-    "renderer/layout_test/layout_test_runtime_flags.cc",
-    "renderer/layout_test/layout_test_runtime_flags.h",
-    "renderer/layout_test/layouttest_support.cc",
-    "renderer/layout_test/layouttest_support.h",
-    "renderer/layout_test/mock_content_settings_client.cc",
-    "renderer/layout_test/mock_content_settings_client.h",
-    "renderer/layout_test/mock_grammar_check.cc",
-    "renderer/layout_test/mock_grammar_check.h",
-    "renderer/layout_test/mock_screen_orientation_client.cc",
-    "renderer/layout_test/mock_screen_orientation_client.h",
-    "renderer/layout_test/mock_spell_check.cc",
-    "renderer/layout_test/mock_spell_check.h",
-    "renderer/layout_test/mock_web_document_subresource_filter.cc",
-    "renderer/layout_test/mock_web_document_subresource_filter.h",
-    "renderer/layout_test/mock_web_midi_accessor.cc",
-    "renderer/layout_test/mock_web_midi_accessor.h",
-    "renderer/layout_test/mock_web_theme_engine.cc",
-    "renderer/layout_test/mock_web_theme_engine.h",
-    "renderer/layout_test/pixel_dump.cc",
-    "renderer/layout_test/pixel_dump.h",
-    "renderer/layout_test/spell_check_client.cc",
-    "renderer/layout_test/spell_check_client.h",
-    "renderer/layout_test/test_common.cc",
-    "renderer/layout_test/test_common.h",
-    "renderer/layout_test/test_interfaces.cc",
-    "renderer/layout_test/test_interfaces.h",
-    "renderer/layout_test/test_media_stream_renderer_factory.cc",
-    "renderer/layout_test/test_media_stream_renderer_factory.h",
-    "renderer/layout_test/test_media_stream_video_renderer.cc",
-    "renderer/layout_test/test_media_stream_video_renderer.h",
-    "renderer/layout_test/test_plugin.cc",
-    "renderer/layout_test/test_plugin.h",
-    "renderer/layout_test/test_preferences.cc",
-    "renderer/layout_test/test_preferences.h",
-    "renderer/layout_test/test_runner.cc",
-    "renderer/layout_test/test_runner.h",
-    "renderer/layout_test/test_runner_for_specific_view.cc",
-    "renderer/layout_test/test_runner_for_specific_view.h",
-    "renderer/layout_test/test_runner_support.cc",
-    "renderer/layout_test/test_runner_support.h",
-    "renderer/layout_test/test_websocket_handshake_throttle_provider.cc",
-    "renderer/layout_test/test_websocket_handshake_throttle_provider.h",
-    "renderer/layout_test/text_input_controller.cc",
-    "renderer/layout_test/text_input_controller.h",
-    "renderer/layout_test/tracked_dictionary.cc",
-    "renderer/layout_test/tracked_dictionary.h",
-    "renderer/layout_test/web_ax_object_proxy.cc",
-    "renderer/layout_test/web_ax_object_proxy.h",
-    "renderer/layout_test/web_frame_test_client.cc",
-    "renderer/layout_test/web_frame_test_client.h",
-    "renderer/layout_test/web_frame_test_proxy.cc",
-    "renderer/layout_test/web_frame_test_proxy.h",
-    "renderer/layout_test/web_test_delegate.h",
-    "renderer/layout_test/web_test_interfaces.cc",
-    "renderer/layout_test/web_test_interfaces.h",
-    "renderer/layout_test/web_test_runner.h",
-    "renderer/layout_test/web_view_test_client.cc",
-    "renderer/layout_test/web_view_test_client.h",
-    "renderer/layout_test/web_view_test_proxy.cc",
-    "renderer/layout_test/web_view_test_proxy.h",
-    "renderer/layout_test/web_widget_test_client.cc",
-    "renderer/layout_test/web_widget_test_client.h",
-    "renderer/layout_test/web_widget_test_proxy.cc",
-    "renderer/layout_test/web_widget_test_proxy.h",
-  ]
-
-  configs += [
-    "//build/config:precompiled_headers",
-
-    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
-    "//build/config/compiler:no_size_t_to_int_warning",
-  ]
-
-  # See comment at the top of //content/BUILD.gn for why this is disabled in
-  # component builds.
-  if (is_component_build) {
-    check_includes = false
-  }
-
-  deps = [
-    ":content_shell_common_lib",
-    ":content_shell_common_test_lib",
-    ":content_shell_renderer_lib",
-    ":mojo_bindings",
-    "//base",
-    "//cc",
-    "//cc:test_support",
-    "//cc/paint",
-    "//components/plugins/renderer",
-    "//components/viz/common",
-    "//components/viz/test:test_support",
-    "//components/web_cache/renderer",
-    "//content/child:for_content_tests",
-    "//content/public/renderer",
-    "//content/renderer:for_content_tests",
-    "//device/gamepad/public/cpp:shared_with_blink",
-    "//device/gamepad/public/mojom",
-    "//gin",
-    "//media/capture",
-    "//media/midi:mojo",
-    "//services/ui/public/cpp/gpu",
-    "//third_party/blink/public:blink",
-    "//third_party/blink/public:test_support",
-    "//ui/events/blink",
-    "//ui/gfx:test_support",
-    "//v8",
-  ]
-}
-
 grit("content_shell_resources_grit") {
   # External code should depend on ":resources" instead.
   visibility = [ ":*" ]
@@ -654,66 +465,18 @@
   ]
 }
 
-# Font copies.
-if (is_android || is_fuchsia) {
-  copy("copy_android_fonts_config") {
-    visibility = [ ":*" ]
-    sources = [
-      "renderer/layout_test/resources/fonts/android_fallback_fonts.xml",
-      "renderer/layout_test/resources/fonts/android_main_fonts.xml",
-    ]
-    outputs = [
-      "$root_out_dir/test_fonts/{{source_file_part}}",
-    ]
-  }
-}
-if (is_mac) {
-  bundle_data("test_runner_bundle_data") {
-    public_deps = [
-      "//third_party/test_fonts",
-    ]
-
-    sources = [
-      "$root_out_dir/test_fonts/Ahem.ttf",
-      "renderer/layout_test/resources/fonts/ChromiumAATTest.ttf",
-    ]
-
-    outputs = [
-      "{{bundle_resources_dir}}/{{source_file_part}}",
-    ]
-  }
-}
-
 group("resources") {
   public_deps = [
     ":copy_shell_resources",
   ]
   deps = [
-    ":layout_test_resources",
+    "//content/shell/test_runner:resources",
   ]
   data_deps = [
-    ":layout_test_resources",
+    "//content/shell/test_runner:resources",
   ]
 }
 
-group("layout_test_resources") {
-  deps = []
-  data_deps = []
-
-  if (is_mac) {
-    deps += [ ":test_runner_bundle_data" ]
-    data_deps += [ ":test_runner_bundle_data" ]
-  } else {
-    deps += [ "//third_party/test_fonts" ]
-    data_deps += [ "//third_party/test_fonts" ]
-  }
-
-  if (is_android || is_fuchsia) {
-    deps += [ ":copy_android_fonts_config" ]
-    data_deps += [ ":copy_android_fonts_config" ]
-  }
-}
-
 repack("pak") {
   sources = [
     "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
@@ -789,7 +552,7 @@
       # TODO(rsesek): Remove this after GYP is gone, since it only needs to
       # be here per the comment in blink_test_platform_support_mac.mm about
       # the bundle structure.
-      #"//content/shell/test_runner:resources",
+      "//content/shell/test_runner:resources",
     ]
     info_plist_target = ":content_shell_plist"
     data_deps = [
diff --git a/content/shell/app/shell_main_delegate.cc b/content/shell/app/shell_main_delegate.cc
index 97fde0e..0ec1525 100644
--- a/content/shell/app/shell_main_delegate.cc
+++ b/content/shell/app/shell_main_delegate.cc
@@ -23,12 +23,12 @@
 #include "content/public/browser/browser_main_runner.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/url_constants.h"
+#include "content/public/test/layouttest_support.h"
 #include "content/public/test/ppapi_test_utils.h"
 #include "content/shell/app/blink_test_platform_support.h"
 #include "content/shell/app/shell_crash_reporter_client.h"
 #include "content/shell/browser/layout_test/layout_test_browser_main.h"
 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h"
-#include "content/shell/browser/layout_test/layouttest_support.h"
 #include "content/shell/browser/shell_browser_main.h"
 #include "content/shell/browser/shell_content_browser_client.h"
 #include "content/shell/common/layout_test/layout_test_content_client.h"
diff --git a/content/shell/browser/layout_test/DEPS b/content/shell/browser/layout_test/DEPS
deleted file mode 100644
index 305c13f..0000000
--- a/content/shell/browser/layout_test/DEPS
+++ /dev/null
@@ -1,6 +0,0 @@
-include_rules = [
-  # LayoutTest code is test-only so it's allowed to use non-public content
-  # internals code.
-  "+content/browser",
-  "+gpu/service/ipc",
-]
diff --git a/content/shell/browser/layout_test/blink_test_controller.cc b/content/shell/browser/layout_test/blink_test_controller.cc
index 9ff7722..2c9aae28 100644
--- a/content/shell/browser/layout_test/blink_test_controller.cc
+++ b/content/shell/browser/layout_test/blink_test_controller.cc
@@ -53,13 +53,13 @@
 #include "content/public/common/bindings_policy.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/url_constants.h"
+#include "content/public/test/layouttest_support.h"
 #include "content/shell/browser/layout_test/devtools_protocol_test_bindings.h"
 #include "content/shell/browser/layout_test/fake_bluetooth_chooser.h"
 #include "content/shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h"
 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h"
 #include "content/shell/browser/layout_test/layout_test_devtools_bindings.h"
 #include "content/shell/browser/layout_test/layout_test_first_device_bluetooth_chooser.h"
-#include "content/shell/browser/layout_test/layouttest_support.h"
 #include "content/shell/browser/shell.h"
 #include "content/shell/browser/shell_browser_context.h"
 #include "content/shell/browser/shell_content_browser_client.h"
@@ -69,7 +69,7 @@
 #include "content/shell/common/layout_test/layout_test_switches.h"
 #include "content/shell/common/shell_messages.h"
 #include "content/shell/renderer/layout_test/blink_test_helpers.h"
-#include "content/shell/renderer/layout_test/test_common.h"
+#include "content/shell/test_runner/test_common.h"
 #include "mojo/public/cpp/bindings/sync_call_restrictions.h"
 #include "services/network/public/cpp/features.h"
 #include "services/network/public/mojom/network_service.mojom.h"
diff --git a/content/shell/browser/layout_test/fake_bluetooth_chooser.cc b/content/shell/browser/layout_test/fake_bluetooth_chooser.cc
index 7715098..b1070662 100644
--- a/content/shell/browser/layout_test/fake_bluetooth_chooser.cc
+++ b/content/shell/browser/layout_test/fake_bluetooth_chooser.cc
@@ -8,7 +8,7 @@
 #include <utility>
 
 #include "content/public/browser/bluetooth_chooser.h"
-#include "content/shell/browser/layout_test/layouttest_support.h"
+#include "content/public/test/layouttest_support.h"
 #include "content/shell/common/layout_test/fake_bluetooth_chooser.mojom.h"
 
 namespace content {
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc b/content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc
index f7b34fd..1188d2f 100644
--- a/content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc
+++ b/content/shell/browser/layout_test/layout_test_bluetooth_fake_adapter_setter_impl.cc
@@ -7,8 +7,8 @@
 #include <string>
 #include <utility>
 
+#include "content/public/test/layouttest_support.h"
 #include "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h"
-#include "content/shell/browser/layout_test/layouttest_support.h"
 #include "device/bluetooth/bluetooth_adapter_factory_wrapper.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 
diff --git a/content/shell/browser/layout_test/layout_test_message_filter.cc b/content/shell/browser/layout_test/layout_test_message_filter.cc
index 8c54b56..85d25cd 100644
--- a/content/shell/browser/layout_test/layout_test_message_filter.cc
+++ b/content/shell/browser/layout_test/layout_test_message_filter.cc
@@ -10,6 +10,7 @@
 #include "base/threading/thread_restrictions.h"
 #include "content/public/browser/child_process_security_policy.h"
 #include "content/public/browser/permission_type.h"
+#include "content/public/test/layouttest_support.h"
 #include "content/shell/browser/layout_test/blink_test_controller.h"
 #include "content/shell/browser/layout_test/layout_test_browser_context.h"
 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h"
@@ -18,8 +19,7 @@
 #include "content/shell/browser/shell_content_browser_client.h"
 #include "content/shell/browser/shell_network_delegate.h"
 #include "content/shell/common/layout_test/layout_test_messages.h"
-#include "content/shell/renderer/layout_test/layouttest_support.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
+#include "content/shell/test_runner/web_test_delegate.h"
 #include "content/test/mock_platform_notification_service.h"
 #include "net/base/net_errors.h"
 #include "net/cookies/cookie_store.h"
diff --git a/content/shell/browser/layout_test/layouttest_support.cc b/content/shell/browser/layout_test/layouttest_support.cc
deleted file mode 100644
index d149b58..0000000
--- a/content/shell/browser/layout_test/layouttest_support.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/shell/browser/layout_test/layouttest_support.h"
-
-#include "build/build_config.h"
-#include "content/browser/bluetooth/bluetooth_device_chooser_controller.h"
-#include "content/browser/renderer_host/render_widget_host_impl.h"
-#include "content/browser/shared_worker/shared_worker_service_impl.h"
-#include "content/public/browser/storage_partition.h"
-
-#if defined(OS_MACOSX)
-#include "content/browser/frame_host/popup_menu_helper_mac.h"
-#include "gpu/ipc/service/image_transport_surface.h"
-#endif
-
-namespace content {
-
-void EnableBrowserLayoutTestMode() {
-#if defined(OS_MACOSX)
-  gpu::ImageTransportSurface::SetAllowOSMesaForTesting(true);
-  PopupMenuHelper::DontShowPopupMenuForTesting();
-#endif
-  RenderWidgetHostImpl::DisableResizeAckCheckForTesting();
-}
-
-void TerminateAllSharedWorkersForTesting(StoragePartition* storage_partition,
-                                         base::OnceClosure callback) {
-  static_cast<SharedWorkerServiceImpl*>(
-      storage_partition->GetSharedWorkerService())
-      ->TerminateAllWorkersForTesting(std::move(callback));
-}
-
-void SetTestBluetoothScanDuration(BluetoothTestScanDurationSetting setting) {
-  switch (setting) {
-    case BluetoothTestScanDurationSetting::kImmediateTimeout:
-      BluetoothDeviceChooserController::SetTestScanDurationForTesting(
-          BluetoothDeviceChooserController::TestScanDurationSetting::
-              IMMEDIATE_TIMEOUT);
-      break;
-    case BluetoothTestScanDurationSetting::kNeverTimeout:
-      BluetoothDeviceChooserController::SetTestScanDurationForTesting(
-          BluetoothDeviceChooserController::TestScanDurationSetting::
-              NEVER_TIMEOUT);
-      break;
-  }
-}
-
-}  // namespace content
diff --git a/content/shell/browser/layout_test/layouttest_support.h b/content/shell/browser/layout_test/layouttest_support.h
deleted file mode 100644
index 5d6a9a4..0000000
--- a/content/shell/browser/layout_test/layouttest_support.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUTTEST_SUPPORT_H_
-#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUTTEST_SUPPORT_H_
-
-#include "base/callback_forward.h"
-
-namespace content {
-class StoragePartition;
-
-// Turn the browser process into layout test mode.
-void EnableBrowserLayoutTestMode();
-
-// Terminates all workers and notifies when complete. This is used for
-// testing when it is important to make sure that all shared worker activity
-// has stopped.
-void TerminateAllSharedWorkersForTesting(StoragePartition* storage_partition,
-                                         base::OnceClosure callback);
-
-// Sets the scan duration to reflect the given setting.
-enum class BluetoothTestScanDurationSetting {
-  kImmediateTimeout,  // Set the scan duration to 0 seconds.
-  kNeverTimeout,  // Set the scan duration to base::TimeDelta::Max() seconds.
-};
-
-void SetTestBluetoothScanDuration(BluetoothTestScanDurationSetting setting);
-
-}  // namespace content
-
-#endif  // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUTTEST_SUPPORT_H_
diff --git a/content/shell/renderer/DEPS b/content/shell/renderer/DEPS
index 8a6cc4d..244f046 100644
--- a/content/shell/renderer/DEPS
+++ b/content/shell/renderer/DEPS
@@ -3,5 +3,6 @@
   "+components/cdm",
   "+components/web_cache/renderer",
   "+components/plugins/renderer",
+  "+content/shell/test_runner",
   "+services/service_manager/public/cpp",
 ]
diff --git a/content/shell/renderer/layout_test/blink_test_helpers.cc b/content/shell/renderer/layout_test/blink_test_helpers.cc
index a97ca8f4..af6f7427 100644
--- a/content/shell/renderer/layout_test/blink_test_helpers.cc
+++ b/content/shell/renderer/layout_test/blink_test_helpers.cc
@@ -15,7 +15,7 @@
 #include "content/public/common/content_switches.h"
 #include "content/public/common/web_preferences.h"
 #include "content/shell/common/layout_test/layout_test_switches.h"
-#include "content/shell/renderer/layout_test/test_preferences.h"
+#include "content/shell/test_runner/test_preferences.h"
 #include "net/base/filename_util.h"
 
 #if defined(OS_MACOSX)
diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
index c401243..daceca6 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -41,19 +41,19 @@
 #include "content/public/renderer/render_thread.h"
 #include "content/public/renderer/render_view.h"
 #include "content/public/renderer/render_view_visitor.h"
+#include "content/public/test/layouttest_support.h"
 #include "content/shell/common/layout_test/layout_test_messages.h"
 #include "content/shell/common/shell_messages.h"
 #include "content/shell/common/shell_switches.h"
-#include "content/shell/renderer/layout_test/app_banner_service.h"
 #include "content/shell/renderer/layout_test/blink_test_helpers.h"
-#include "content/shell/renderer/layout_test/gamepad_controller.h"
-#include "content/shell/renderer/layout_test/layout_and_paint_async_then.h"
 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer.h"
-#include "content/shell/renderer/layout_test/layouttest_support.h"
-#include "content/shell/renderer/layout_test/pixel_dump.h"
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_test_runner.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/app_banner_service.h"
+#include "content/shell/test_runner/gamepad_controller.h"
+#include "content/shell/test_runner/layout_and_paint_async_then.h"
+#include "content/shell/test_runner/pixel_dump.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_test_runner.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 #include "media/base/audio_capturer_source.h"
 #include "media/base/audio_parameters.h"
 #include "media/capture/video_capturer_source.h"
diff --git a/content/shell/renderer/layout_test/blink_test_runner.h b/content/shell/renderer/layout_test/blink_test_runner.h
index c66faaa..563e49e 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.h
+++ b/content/shell/renderer/layout_test/blink_test_runner.h
@@ -19,8 +19,8 @@
 #include "content/public/renderer/render_view_observer_tracker.h"
 #include "content/shell/common/layout_test.mojom.h"
 #include "content/shell/common/layout_test/layout_test_bluetooth_fake_adapter_setter.mojom.h"
-#include "content/shell/renderer/layout_test/test_preferences.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
+#include "content/shell/test_runner/test_preferences.h"
+#include "content/shell/test_runner/web_test_delegate.h"
 #include "v8/include/v8.h"
 
 class SkBitmap;
diff --git a/content/shell/renderer/layout_test/layout_and_paint_async_then.h b/content/shell/renderer/layout_test/layout_and_paint_async_then.h
deleted file mode 100644
index 047d542..0000000
--- a/content/shell/renderer/layout_test/layout_and_paint_async_then.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_AND_PAINT_ASYNC_THEN_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_AND_PAINT_ASYNC_THEN_H_
-
-#include "base/callback_forward.h"
-
-namespace blink {
-class WebWidget;
-}  // namespace blink
-
-namespace test_runner {
-
-// Triggers a layout and paint of |web_widget| and its popup (if any).
-// Calls |callback| after the layout and paint happens (for both the
-// |web_widget| and its popup (if any)).
-void LayoutAndPaintAsyncThen(blink::WebWidget* web_widget,
-                             base::OnceClosure callback);
-
-}  // namespace test_runner
-
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_AND_PAINT_ASYNC_THEN_H_
diff --git a/content/shell/renderer/layout_test/layout_dump.h b/content/shell/renderer/layout_test/layout_dump.h
deleted file mode 100644
index d6fb216..0000000
--- a/content/shell/renderer/layout_test/layout_dump.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_DUMP_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_DUMP_H_
-
-#include <string>
-
-#include "content/shell/renderer/layout_test/layout_test_runtime_flags.h"
-
-namespace blink {
-class WebLocalFrame;
-}  // namespace blink
-
-namespace test_runner {
-
-// Dumps textual representation of |frame| contents.  Exact dump mode depends
-// on |flags| (i.e. dump_as_text VS dump_as_markup and/or is_printing).
-std::string DumpLayout(blink::WebLocalFrame* frame,
-                       const LayoutTestRuntimeFlags& flags);
-
-}  // namespace test_runner
-
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_DUMP_H_
diff --git a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
index f94e7e5b..3ef494be 100644
--- a/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
+++ b/content/shell/renderer/layout_test/layout_test_content_renderer_client.cc
@@ -17,20 +17,20 @@
 #include "content/public/renderer/render_frame.h"
 #include "content/public/renderer/render_thread.h"
 #include "content/public/renderer/render_view.h"
+#include "content/public/test/layouttest_support.h"
 #include "content/shell/common/layout_test/layout_test_switches.h"
 #include "content/shell/common/shell_switches.h"
 #include "content/shell/renderer/layout_test/blink_test_helpers.h"
 #include "content/shell/renderer/layout_test/blink_test_runner.h"
 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h"
 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer.h"
-#include "content/shell/renderer/layout_test/layouttest_support.h"
 #include "content/shell/renderer/layout_test/test_media_stream_renderer_factory.h"
 #include "content/shell/renderer/layout_test/test_websocket_handshake_throttle_provider.h"
-#include "content/shell/renderer/layout_test/web_frame_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_test_runner.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
 #include "content/shell/renderer/shell_render_view_observer.h"
+#include "content/shell/test_runner/web_frame_test_proxy.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_test_runner.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 #include "media/base/audio_latency.h"
 #include "media/base/mime_util.h"
 #include "media/media_buildflags.h"
diff --git a/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc b/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc
index ae5df2c0..2d97f8e 100644
--- a/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc
+++ b/content/shell/renderer/layout_test/layout_test_render_frame_observer.cc
@@ -9,8 +9,8 @@
 #include "content/public/renderer/render_frame.h"
 #include "content/shell/renderer/layout_test/blink_test_runner.h"
 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer.h"
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_test_runner.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_test_runner.h"
 #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
 #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
 #include "third_party/blink/public/web/web_frame_widget.h"
diff --git a/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc b/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc
index 078f9c09..99abe77 100644
--- a/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc
+++ b/content/shell/renderer/layout_test/layout_test_render_thread_observer.cc
@@ -6,13 +6,13 @@
 
 #include "content/public/common/content_client.h"
 #include "content/public/renderer/render_thread.h"
+#include "content/public/test/layouttest_support.h"
 #include "content/shell/common/layout_test/layout_test_messages.h"
 #include "content/shell/common/layout_test/layout_test_switches.h"
 #include "content/shell/common/shell_messages.h"
-#include "content/shell/renderer/layout_test/layouttest_support.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_test_runner.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_test_runner.h"
 
 namespace content {
 
diff --git a/content/shell/renderer/layout_test/DEPS b/content/shell/test_runner/DEPS
similarity index 72%
rename from content/shell/renderer/layout_test/DEPS
rename to content/shell/test_runner/DEPS
index 4076598..8796790 100644
--- a/content/shell/renderer/layout_test/DEPS
+++ b/content/shell/test_runner/DEPS
@@ -1,11 +1,7 @@
 include_rules = [
   "+cc",
-  # LayoutTest code is test-only so it's allowed to use non-public content
-  # internals code.
-  "+content/child",
+  "+content/public/test",
   "+content/renderer",
-  "+components/viz/common",
-  "+components/viz/test",
   "+device/gamepad/public/cpp",
   "+device/gamepad/public/mojom",
   "+gin",
@@ -15,7 +11,7 @@
   "+net/base",
   "+services/device/public/cpp/generic_sensor",
   "+services/device/public/mojom",
-  "+services/ui/public/cpp/gpu",
+  "+services/service_manager/public/cpp",
   "+skia",
   "+third_party/khronos/GLES2/gl2.h",
   "+third_party/skia",
diff --git a/content/shell/renderer/layout_test/OWNERS b/content/shell/test_runner/OWNERS
similarity index 100%
rename from content/shell/renderer/layout_test/OWNERS
rename to content/shell/test_runner/OWNERS
diff --git a/content/shell/renderer/layout_test/accessibility_controller.cc b/content/shell/test_runner/accessibility_controller.cc
similarity index 96%
rename from content/shell/renderer/layout_test/accessibility_controller.cc
rename to content/shell/test_runner/accessibility_controller.cc
index 3cf2d83..cf13413 100644
--- a/content/shell/renderer/layout_test/accessibility_controller.cc
+++ b/content/shell/test_runner/accessibility_controller.cc
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/accessibility_controller.h"
+#include "content/shell/test_runner/accessibility_controller.h"
 
 #include <string>
 
 #include "base/macros.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 #include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "gin/wrappable.h"
@@ -190,10 +190,9 @@
 
   // Call global notification listeners.
   v8::Local<v8::Value> argv[] = {
-      element_handle,
-      v8::String::NewFromUtf8(isolate, notification_name.data(),
-                              v8::String::kNormalString,
-                              notification_name.size()),
+      element_handle, v8::String::NewFromUtf8(isolate, notification_name.data(),
+                                              v8::String::kNormalString,
+                                              notification_name.size()),
   };
   local_frame->CallFunctionEvenIfScriptDisabled(
       v8::Local<v8::Function>::New(isolate, notification_callback_),
diff --git a/content/shell/renderer/layout_test/accessibility_controller.h b/content/shell/test_runner/accessibility_controller.h
similarity index 85%
rename from content/shell/renderer/layout_test/accessibility_controller.h
rename to content/shell/test_runner/accessibility_controller.h
index 5d99694..e798114 100644
--- a/content/shell/renderer/layout_test/accessibility_controller.h
+++ b/content/shell/test_runner/accessibility_controller.h
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_ACCESSIBILITY_CONTROLLER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_ACCESSIBILITY_CONTROLLER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
+#define CONTENT_SHELL_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
 
 #include <vector>
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "content/shell/renderer/layout_test/web_ax_object_proxy.h"
+#include "content/shell/test_runner/web_ax_object_proxy.h"
 #include "third_party/blink/public/web/web_ax_object.h"
 #include "v8/include/v8.h"
 
@@ -17,7 +17,7 @@
 class WebLocalFrame;
 class WebString;
 class WebView;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -69,4 +69,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_ACCESSIBILITY_CONTROLLER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
diff --git a/content/shell/renderer/layout_test/app_banner_service.cc b/content/shell/test_runner/app_banner_service.cc
similarity index 95%
rename from content/shell/renderer/layout_test/app_banner_service.cc
rename to content/shell/test_runner/app_banner_service.cc
index acbc6b3a..3af64140 100644
--- a/content/shell/renderer/layout_test/app_banner_service.cc
+++ b/content/shell/test_runner/app_banner_service.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/app_banner_service.h"
+#include "content/shell/test_runner/app_banner_service.h"
 
 namespace test_runner {
 
diff --git a/content/shell/renderer/layout_test/app_banner_service.h b/content/shell/test_runner/app_banner_service.h
similarity index 81%
rename from content/shell/renderer/layout_test/app_banner_service.h
rename to content/shell/test_runner/app_banner_service.h
index 499e9ba..58500fd 100644
--- a/content/shell/renderer/layout_test/app_banner_service.h
+++ b/content/shell/test_runner/app_banner_service.h
@@ -2,14 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_APP_BANNER_SERVICE_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_APP_BANNER_SERVICE_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_APP_BANNER_SERVICE_H_
+#define CONTENT_SHELL_TEST_RUNNER_APP_BANNER_SERVICE_H_
 
 #include <string>
 #include <vector>
 
 #include "base/callback_forward.h"
 #include "base/macros.h"
+#include "content/shell/test_runner/test_runner_export.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "third_party/blink/public/platform/modules/app_banner/app_banner.mojom.h"
 
@@ -17,7 +18,8 @@
 
 // Test app banner service that is registered as a Mojo service for
 // BeforeInstallPromptEvents to look up when the test runner is executed.
-class AppBannerService : public blink::mojom::AppBannerService {
+class TEST_RUNNER_EXPORT AppBannerService
+    : public blink::mojom::AppBannerService {
  public:
   AppBannerService();
   ~AppBannerService() override;
@@ -44,4 +46,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_APP_BANNER_SERVICE_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_APP_BANNER_SERVICE_H_
diff --git a/content/shell/renderer/layout_test/event_sender.cc b/content/shell/test_runner/event_sender.cc
similarity index 99%
rename from content/shell/renderer/layout_test/event_sender.cc
rename to content/shell/test_runner/event_sender.cc
index b61ca70..5de4022 100644
--- a/content/shell/renderer/layout_test/event_sender.cc
+++ b/content/shell/test_runner/event_sender.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/event_sender.h"
+#include "content/shell/test_runner/event_sender.h"
 
 #include <stddef.h>
 
@@ -20,11 +20,11 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
-#include "content/shell/renderer/layout_test/mock_spell_check.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/mock_spell_check.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 #include "gin/handle.h"
 #include "gin/object_template_builder.h"
 #include "gin/wrappable.h"
diff --git a/content/shell/renderer/layout_test/event_sender.h b/content/shell/test_runner/event_sender.h
similarity index 97%
rename from content/shell/renderer/layout_test/event_sender.h
rename to content/shell/test_runner/event_sender.h
index 1bef392..217fc772 100644
--- a/content/shell/renderer/layout_test/event_sender.h
+++ b/content/shell/test_runner/event_sender.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_EVENT_SENDER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_EVENT_SENDER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_EVENT_SENDER_H_
+#define CONTENT_SHELL_TEST_RUNNER_EVENT_SENDER_H_
 
 #include <stdint.h>
 
@@ -31,7 +31,7 @@
 class WebView;
 class WebWidget;
 struct WebContextMenuData;
-}  // namespace blink
+}
 
 namespace gin {
 class Arguments;
@@ -332,4 +332,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_EVENT_SENDER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_EVENT_SENDER_H_
diff --git a/content/shell/renderer/layout_test/gamepad_controller.cc b/content/shell/test_runner/gamepad_controller.cc
similarity index 98%
rename from content/shell/renderer/layout_test/gamepad_controller.cc
rename to content/shell/test_runner/gamepad_controller.cc
index dd3790d..7542b92 100644
--- a/content/shell/renderer/layout_test/gamepad_controller.cc
+++ b/content/shell/test_runner/gamepad_controller.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/gamepad_controller.h"
+#include "content/shell/test_runner/gamepad_controller.h"
 
 #include <string.h>
 
 #include "base/macros.h"
 #include "content/public/common/service_names.mojom.h"
 #include "content/public/renderer/render_frame.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
+#include "content/shell/test_runner/web_test_delegate.h"
 #include "gin/arguments.h"
 #include "gin/handle.h"
 #include "gin/object_template_builder.h"
diff --git a/content/shell/renderer/layout_test/gamepad_controller.h b/content/shell/test_runner/gamepad_controller.h
similarity index 86%
rename from content/shell/renderer/layout_test/gamepad_controller.h
rename to content/shell/test_runner/gamepad_controller.h
index ece019c..0ef452e7 100644
--- a/content/shell/renderer/layout_test/gamepad_controller.h
+++ b/content/shell/test_runner/gamepad_controller.h
@@ -2,14 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_GAMEPAD_CONTROLLER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_GAMEPAD_CONTROLLER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
+#define CONTENT_SHELL_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
 
 #include <bitset>
 
 #include "base/macros.h"
 #include "base/memory/read_only_shared_memory_region.h"
 #include "base/memory/weak_ptr.h"
+#include "content/shell/test_runner/test_runner_export.h"
 #include "device/gamepad/public/cpp/gamepads.h"
 #include "device/gamepad/public/mojom/gamepad.mojom.h"
 #include "device/gamepad/public/mojom/gamepad_hardware_buffer.h"
@@ -22,8 +23,9 @@
 
 namespace test_runner {
 
-class GamepadController : public device::mojom::GamepadMonitor,
-                          public base::SupportsWeakPtr<GamepadController> {
+class TEST_RUNNER_EXPORT GamepadController
+    : public device::mojom::GamepadMonitor,
+      public base::SupportsWeakPtr<GamepadController> {
  public:
   GamepadController();
   ~GamepadController() override;
@@ -72,4 +74,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_GAMEPAD_CONTROLLER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
diff --git a/content/shell/renderer/layout_test/gc_controller.cc b/content/shell/test_runner/gc_controller.cc
similarity index 97%
rename from content/shell/renderer/layout_test/gc_controller.cc
rename to content/shell/test_runner/gc_controller.cc
index d48eac3..fa14050 100644
--- a/content/shell/renderer/layout_test/gc_controller.cc
+++ b/content/shell/test_runner/gc_controller.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/gc_controller.h"
+#include "content/shell/test_runner/gc_controller.h"
 
 #include "gin/arguments.h"
 #include "gin/handle.h"
diff --git a/content/shell/renderer/layout_test/gc_controller.h b/content/shell/test_runner/gc_controller.h
similarity index 82%
rename from content/shell/renderer/layout_test/gc_controller.h
rename to content/shell/test_runner/gc_controller.h
index 5ecf9f9..9c34adcf 100644
--- a/content/shell/renderer/layout_test/gc_controller.h
+++ b/content/shell/test_runner/gc_controller.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_GC_CONTROLLER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_GC_CONTROLLER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_GC_CONTROLLER_H_
+#define CONTENT_SHELL_TEST_RUNNER_GC_CONTROLLER_H_
 
 #include "base/macros.h"
 #include "gin/wrappable.h"
@@ -40,4 +40,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_GC_CONTROLLER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_GC_CONTROLLER_H_
diff --git a/content/shell/renderer/layout_test/layout_and_paint_async_then.cc b/content/shell/test_runner/layout_and_paint_async_then.cc
similarity index 91%
rename from content/shell/renderer/layout_test/layout_and_paint_async_then.cc
rename to content/shell/test_runner/layout_and_paint_async_then.cc
index 90d2465..eff5548 100644
--- a/content/shell/renderer/layout_test/layout_and_paint_async_then.cc
+++ b/content/shell/test_runner/layout_and_paint_async_then.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/layout_and_paint_async_then.h"
+#include "content/shell/test_runner/layout_and_paint_async_then.h"
 
 #include "base/barrier_closure.h"
 #include "base/callback.h"
diff --git a/content/shell/test_runner/layout_and_paint_async_then.h b/content/shell/test_runner/layout_and_paint_async_then.h
new file mode 100644
index 0000000..3584ff4
--- /dev/null
+++ b/content/shell/test_runner/layout_and_paint_async_then.h
@@ -0,0 +1,25 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_TEST_RUNNER_LAYOUT_AND_PAINT_ASYNC_THEN_H_
+#define CONTENT_SHELL_TEST_RUNNER_LAYOUT_AND_PAINT_ASYNC_THEN_H_
+
+#include "base/callback_forward.h"
+#include "content/shell/test_runner/test_runner_export.h"
+
+namespace blink {
+class WebWidget;
+}  // namespace blink
+
+namespace test_runner {
+
+// Triggers a layout and paint of |web_widget| and its popup (if any).
+// Calls |callback| after the layout and paint happens (for both the
+// |web_widget| and its popup (if any)).
+TEST_RUNNER_EXPORT void LayoutAndPaintAsyncThen(blink::WebWidget* web_widget,
+                                                base::OnceClosure callback);
+
+}  // namespace test_runner
+
+#endif  // CONTENT_SHELL_TEST_RUNNER_LAYOUT_AND_PAINT_ASYNC_THEN_H_
diff --git a/content/shell/renderer/layout_test/layout_dump.cc b/content/shell/test_runner/layout_dump.cc
similarity index 95%
rename from content/shell/renderer/layout_test/layout_dump.cc
rename to content/shell/test_runner/layout_dump.cc
index 2647e0a..9eb98f0 100644
--- a/content/shell/renderer/layout_test/layout_dump.cc
+++ b/content/shell/test_runner/layout_dump.cc
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/layout_dump.h"
+#include "content/shell/test_runner/layout_dump.h"
 
 #include "base/logging.h"
 #include "base/strings/stringprintf.h"
-#include "content/shell/renderer/layout_test/test_runner_support.h"
+#include "content/public/test/test_runner_support.h"
 #include "third_party/blink/public/platform/web_size.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/web/web_document.h"
diff --git a/content/shell/test_runner/layout_dump.h b/content/shell/test_runner/layout_dump.h
new file mode 100644
index 0000000..09bb976d
--- /dev/null
+++ b/content/shell/test_runner/layout_dump.h
@@ -0,0 +1,26 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_TEST_RUNNER_LAYOUT_DUMP_H_
+#define CONTENT_SHELL_TEST_RUNNER_LAYOUT_DUMP_H_
+
+#include <string>
+
+#include "content/shell/test_runner/layout_test_runtime_flags.h"
+#include "content/shell/test_runner/test_runner_export.h"
+
+namespace blink {
+class WebLocalFrame;
+}  // namespace blink
+
+namespace test_runner {
+
+// Dumps textual representation of |frame| contents.  Exact dump mode depends
+// on |flags| (i.e. dump_as_text VS dump_as_markup and/or is_printing).
+TEST_RUNNER_EXPORT std::string DumpLayout(blink::WebLocalFrame* frame,
+                                          const LayoutTestRuntimeFlags& flags);
+
+}  // namespace test_runner
+
+#endif  // CONTENT_SHELL_TEST_RUNNER_LAYOUT_DUMP_H_
diff --git a/content/shell/renderer/layout_test/layout_test_runtime_flags.cc b/content/shell/test_runner/layout_test_runtime_flags.cc
similarity index 96%
rename from content/shell/renderer/layout_test/layout_test_runtime_flags.cc
rename to content/shell/test_runner/layout_test_runtime_flags.cc
index 0bc5ea90..5791ddb 100644
--- a/content/shell/renderer/layout_test/layout_test_runtime_flags.cc
+++ b/content/shell/test_runner/layout_test_runtime_flags.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/layout_test_runtime_flags.h"
+#include "content/shell/test_runner/layout_test_runtime_flags.h"
 
 namespace test_runner {
 
diff --git a/content/shell/renderer/layout_test/layout_test_runtime_flags.h b/content/shell/test_runner/layout_test_runtime_flags.h
similarity index 95%
rename from content/shell/renderer/layout_test/layout_test_runtime_flags.h
rename to content/shell/test_runner/layout_test_runtime_flags.h
index ee722ad..d269371 100644
--- a/content/shell/renderer/layout_test/layout_test_runtime_flags.h
+++ b/content/shell/test_runner/layout_test_runtime_flags.h
@@ -2,22 +2,23 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RUNTIME_FLAGS_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RUNTIME_FLAGS_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_
+#define CONTENT_SHELL_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_
 
 #include <string>
 
 #include "base/logging.h"
 #include "base/macros.h"
 #include "base/values.h"
-#include "content/shell/renderer/layout_test/tracked_dictionary.h"
+#include "content/shell/test_runner/test_runner_export.h"
+#include "content/shell/test_runner/tracked_dictionary.h"
 
 namespace test_runner {
 
 // LayoutTestRuntimeFlags stores flags controlled by layout tests at runtime
 // (i.e. by calling testRunner.dumpAsText() or testRunner.waitUntilDone()).
 // Changes to the flags are tracked (to help replicate them across renderers).
-class LayoutTestRuntimeFlags {
+class TEST_RUNNER_EXPORT LayoutTestRuntimeFlags {
  public:
   // Creates default flags (see also the Reset method).
   LayoutTestRuntimeFlags();
@@ -210,4 +211,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LAYOUT_TEST_RUNTIME_FLAGS_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_LAYOUT_TEST_RUNTIME_FLAGS_H_
diff --git a/content/shell/renderer/layout_test/mock_content_settings_client.cc b/content/shell/test_runner/mock_content_settings_client.cc
similarity index 88%
rename from content/shell/renderer/layout_test/mock_content_settings_client.cc
rename to content/shell/test_runner/mock_content_settings_client.cc
index 4ae9c9c..55d92303 100644
--- a/content/shell/renderer/layout_test/mock_content_settings_client.cc
+++ b/content/shell/test_runner/mock_content_settings_client.cc
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/mock_content_settings_client.h"
+#include "content/shell/test_runner/mock_content_settings_client.h"
 
-#include "content/shell/renderer/layout_test/layout_test_runtime_flags.h"
-#include "content/shell/renderer/layout_test/test_common.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
+#include "content/shell/test_runner/layout_test_runtime_flags.h"
+#include "content/shell/test_runner/test_common.h"
+#include "content/shell/test_runner/web_test_delegate.h"
 #include "third_party/blink/public/platform/web_url.h"
 
 namespace test_runner {
diff --git a/content/shell/renderer/layout_test/mock_content_settings_client.h b/content/shell/test_runner/mock_content_settings_client.h
similarity index 86%
rename from content/shell/renderer/layout_test/mock_content_settings_client.h
rename to content/shell/test_runner/mock_content_settings_client.h
index 88c08790..97909cf 100644
--- a/content/shell/renderer/layout_test/mock_content_settings_client.h
+++ b/content/shell/test_runner/mock_content_settings_client.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_CONTENT_SETTINGS_CLIENT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_CONTENT_SETTINGS_CLIENT_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_
+#define CONTENT_SHELL_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_
 
 #include "base/macros.h"
 #include "third_party/blink/public/platform/web_content_settings_client.h"
@@ -45,4 +45,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_CONTENT_SETTINGS_CLIENT_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_MOCK_CONTENT_SETTINGS_CLIENT_H_
diff --git a/content/shell/renderer/layout_test/mock_grammar_check.cc b/content/shell/test_runner/mock_grammar_check.cc
similarity index 93%
rename from content/shell/renderer/layout_test/mock_grammar_check.cc
rename to content/shell/test_runner/mock_grammar_check.cc
index a78aa236..a3971ef 100644
--- a/content/shell/renderer/layout_test/mock_grammar_check.cc
+++ b/content/shell/test_runner/mock_grammar_check.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/mock_grammar_check.h"
+#include "content/shell/test_runner/mock_grammar_check.h"
 
 #include <stddef.h>
 
@@ -10,7 +10,7 @@
 
 #include "base/logging.h"
 #include "base/macros.h"
-#include "content/shell/renderer/layout_test/test_common.h"
+#include "content/shell/test_runner/test_common.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/web/web_text_checking_result.h"
 
diff --git a/content/shell/renderer/layout_test/mock_grammar_check.h b/content/shell/test_runner/mock_grammar_check.h
similarity index 79%
rename from content/shell/renderer/layout_test/mock_grammar_check.h
rename to content/shell/test_runner/mock_grammar_check.h
index d1bd4b2..4e80de7 100644
--- a/content/shell/renderer/layout_test/mock_grammar_check.h
+++ b/content/shell/test_runner/mock_grammar_check.h
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_GRAMMAR_CHECK_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_GRAMMAR_CHECK_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
+#define CONTENT_SHELL_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
 
 #include <vector>
 
 namespace blink {
 class WebString;
 struct WebTextCheckingResult;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -27,4 +27,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_GRAMMAR_CHECK_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
diff --git a/content/shell/renderer/layout_test/mock_screen_orientation_client.cc b/content/shell/test_runner/mock_screen_orientation_client.cc
similarity index 98%
rename from content/shell/renderer/layout_test/mock_screen_orientation_client.cc
rename to content/shell/test_runner/mock_screen_orientation_client.cc
index a81860b..f3a00f18 100644
--- a/content/shell/renderer/layout_test/mock_screen_orientation_client.cc
+++ b/content/shell/test_runner/mock_screen_orientation_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/mock_screen_orientation_client.h"
+#include "content/shell/test_runner/mock_screen_orientation_client.h"
 
 #include <memory>
 
diff --git a/content/shell/renderer/layout_test/mock_screen_orientation_client.h b/content/shell/test_runner/mock_screen_orientation_client.h
similarity index 86%
rename from content/shell/renderer/layout_test/mock_screen_orientation_client.h
rename to content/shell/test_runner/mock_screen_orientation_client.h
index ea9ed179b..5dd4360 100644
--- a/content/shell/renderer/layout_test/mock_screen_orientation_client.h
+++ b/content/shell/test_runner/mock_screen_orientation_client.h
@@ -2,13 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_SCREEN_ORIENTATION_CLIENT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_SCREEN_ORIENTATION_CLIENT_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
+#define CONTENT_SHELL_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
 
 #include <memory>
 
 #include "base/compiler_specific.h"
 #include "base/macros.h"
+#include "content/shell/test_runner/test_runner_export.h"
 #include "mojo/public/cpp/bindings/associated_binding_set.h"
 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
 #include "services/device/public/mojom/screen_orientation.mojom.h"
@@ -21,7 +22,8 @@
 
 namespace test_runner {
 
-class MockScreenOrientationClient : public device::mojom::ScreenOrientation {
+class TEST_RUNNER_EXPORT MockScreenOrientationClient
+    : public device::mojom::ScreenOrientation {
  public:
   explicit MockScreenOrientationClient();
   ~MockScreenOrientationClient() override;
@@ -65,4 +67,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_SCREEN_ORIENTATION_CLIENT_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
diff --git a/content/shell/renderer/layout_test/mock_spell_check.cc b/content/shell/test_runner/mock_spell_check.cc
similarity index 97%
rename from content/shell/renderer/layout_test/mock_spell_check.cc
rename to content/shell/test_runner/mock_spell_check.cc
index e0adb44c..141dc40 100644
--- a/content/shell/renderer/layout_test/mock_spell_check.cc
+++ b/content/shell/test_runner/mock_spell_check.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/mock_spell_check.h"
+#include "content/shell/test_runner/mock_spell_check.h"
 
 #include <stddef.h>
 
@@ -10,7 +10,7 @@
 
 #include "base/logging.h"
 #include "base/macros.h"
-#include "content/shell/renderer/layout_test/test_common.h"
+#include "content/shell/test_runner/test_common.h"
 
 namespace test_runner {
 
diff --git a/content/shell/renderer/layout_test/mock_spell_check.h b/content/shell/test_runner/mock_spell_check.h
similarity index 93%
rename from content/shell/renderer/layout_test/mock_spell_check.h
rename to content/shell/test_runner/mock_spell_check.h
index 19e2a06..160c638 100644
--- a/content/shell/renderer/layout_test/mock_spell_check.h
+++ b/content/shell/test_runner/mock_spell_check.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_SPELL_CHECK_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_SPELL_CHECK_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_SPELL_CHECK_H_
+#define CONTENT_SHELL_TEST_RUNNER_MOCK_SPELL_CHECK_H_
 
 #include <vector>
 
@@ -72,4 +72,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_SPELL_CHECK_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_MOCK_SPELL_CHECK_H_
diff --git a/content/shell/renderer/layout_test/mock_web_document_subresource_filter.cc b/content/shell/test_runner/mock_web_document_subresource_filter.cc
similarity index 95%
rename from content/shell/renderer/layout_test/mock_web_document_subresource_filter.cc
rename to content/shell/test_runner/mock_web_document_subresource_filter.cc
index 4d3cf7f4..24b1851 100644
--- a/content/shell/renderer/layout_test/mock_web_document_subresource_filter.cc
+++ b/content/shell/test_runner/mock_web_document_subresource_filter.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/mock_web_document_subresource_filter.h"
+#include "content/shell/test_runner/mock_web_document_subresource_filter.h"
 
 #include <algorithm>
 
diff --git a/content/shell/renderer/layout_test/mock_web_document_subresource_filter.h b/content/shell/test_runner/mock_web_document_subresource_filter.h
similarity index 83%
rename from content/shell/renderer/layout_test/mock_web_document_subresource_filter.h
rename to content/shell/test_runner/mock_web_document_subresource_filter.h
index 8552112..bc82a23 100644
--- a/content/shell/renderer/layout_test/mock_web_document_subresource_filter.h
+++ b/content/shell/test_runner/mock_web_document_subresource_filter.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_
+#define CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_
 
 #include <string>
 #include <vector>
@@ -43,4 +43,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_DOCUMENT_SUBRESOURCE_FILTER_H_
diff --git a/content/shell/renderer/layout_test/mock_web_midi_accessor.cc b/content/shell/test_runner/mock_web_midi_accessor.cc
similarity index 92%
rename from content/shell/renderer/layout_test/mock_web_midi_accessor.cc
rename to content/shell/test_runner/mock_web_midi_accessor.cc
index f890506f..8470b213 100644
--- a/content/shell/renderer/layout_test/mock_web_midi_accessor.cc
+++ b/content/shell/test_runner/mock_web_midi_accessor.cc
@@ -2,16 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/mock_web_midi_accessor.h"
+#include "content/shell/test_runner/mock_web_midi_accessor.h"
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/macros.h"
 #include "base/strings/stringprintf.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_test_runner.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_test_runner.h"
 #include "third_party/blink/public/platform/modules/webmidi/web_midi_accessor_client.h"
 #include "third_party/blink/public/platform/web_string.h"
 
diff --git a/content/shell/renderer/layout_test/mock_web_midi_accessor.h b/content/shell/test_runner/mock_web_midi_accessor.h
similarity index 88%
rename from content/shell/renderer/layout_test/mock_web_midi_accessor.h
rename to content/shell/test_runner/mock_web_midi_accessor.h
index 9858bf1..81e5c735 100644
--- a/content/shell/renderer/layout_test/mock_web_midi_accessor.h
+++ b/content/shell/test_runner/mock_web_midi_accessor.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_MIDI_ACCESSOR_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_MIDI_ACCESSOR_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
+#define CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
 
 #include <stddef.h>
 #include <vector>
@@ -55,4 +55,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_MIDI_ACCESSOR_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
diff --git a/content/shell/renderer/layout_test/mock_web_theme_engine.cc b/content/shell/test_runner/mock_web_theme_engine.cc
similarity index 99%
rename from content/shell/renderer/layout_test/mock_web_theme_engine.cc
rename to content/shell/test_runner/mock_web_theme_engine.cc
index 58f831cdcd..cdd49cd37 100644
--- a/content/shell/renderer/layout_test/mock_web_theme_engine.cc
+++ b/content/shell/test_runner/mock_web_theme_engine.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/mock_web_theme_engine.h"
+#include "content/shell/test_runner/mock_web_theme_engine.h"
 
 #if !defined(OS_MACOSX)
 
diff --git a/content/shell/renderer/layout_test/mock_web_theme_engine.h b/content/shell/test_runner/mock_web_theme_engine.h
similarity index 79%
rename from content/shell/renderer/layout_test/mock_web_theme_engine.h
rename to content/shell/test_runner/mock_web_theme_engine.h
index ab414d77..eb0fc5a 100644
--- a/content/shell/renderer/layout_test/mock_web_theme_engine.h
+++ b/content/shell/test_runner/mock_web_theme_engine.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_THEME_ENGINE_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_THEME_ENGINE_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
+#define CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
 
 #include "build/build_config.h"
 #include "third_party/blink/public/platform/web_theme_engine.h"
@@ -27,4 +27,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_MOCK_WEB_THEME_ENGINE_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
diff --git a/content/shell/renderer/layout_test/pixel_dump.cc b/content/shell/test_runner/pixel_dump.cc
similarity index 97%
rename from content/shell/renderer/layout_test/pixel_dump.cc
rename to content/shell/test_runner/pixel_dump.cc
index 0ffea741..f5aeff05 100644
--- a/content/shell/renderer/layout_test/pixel_dump.cc
+++ b/content/shell/test_runner/pixel_dump.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/pixel_dump.h"
+#include "content/shell/test_runner/pixel_dump.h"
 
 #include <memory>
 #include <utility>
@@ -16,7 +16,7 @@
 #include "base/trace_event/trace_event.h"
 #include "cc/paint/paint_flags.h"
 #include "cc/paint/skia_paint_canvas.h"
-#include "content/shell/renderer/layout_test/layout_test_runtime_flags.h"
+#include "content/shell/test_runner/layout_test_runtime_flags.h"
 #include "services/service_manager/public/cpp/connector.h"
 // FIXME: Including platform_canvas.h here is a layering violation.
 #include "skia/ext/platform_canvas.h"
diff --git a/content/shell/renderer/layout_test/pixel_dump.h b/content/shell/test_runner/pixel_dump.h
similarity index 90%
rename from content/shell/renderer/layout_test/pixel_dump.h
rename to content/shell/test_runner/pixel_dump.h
index af0846f..9a2edb9 100644
--- a/content/shell/renderer/layout_test/pixel_dump.h
+++ b/content/shell/test_runner/pixel_dump.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_PIXEL_DUMP_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_PIXEL_DUMP_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_
+#define CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_
 
 #include "base/callback_forward.h"
 
@@ -46,4 +46,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_PIXEL_DUMP_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_
diff --git a/content/shell/renderer/layout_test/resources/fonts/ChromiumAATTest.ttf b/content/shell/test_runner/resources/fonts/ChromiumAATTest.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/ChromiumAATTest.ttf
rename to content/shell/test_runner/resources/fonts/ChromiumAATTest.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher100.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher100.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher100.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher100.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher200.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher200.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher200.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher200.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher300.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher300.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher300.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher300.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher400.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher400.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher400.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher400.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher500.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher500.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher500.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher500.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher600.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher600.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher600.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher600.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher700.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher700.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher700.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher700.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher800.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher800.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher800.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher800.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher900.ttf b/content/shell/test_runner/resources/fonts/WebKitWeightWatcher900.ttf
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/WebKitWeightWatcher900.ttf
rename to content/shell/test_runner/resources/fonts/WebKitWeightWatcher900.ttf
Binary files differ
diff --git a/content/shell/renderer/layout_test/resources/fonts/android_fallback_fonts.xml b/content/shell/test_runner/resources/fonts/android_fallback_fonts.xml
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/android_fallback_fonts.xml
rename to content/shell/test_runner/resources/fonts/android_fallback_fonts.xml
diff --git a/content/shell/renderer/layout_test/resources/fonts/android_main_fonts.xml b/content/shell/test_runner/resources/fonts/android_main_fonts.xml
similarity index 100%
rename from content/shell/renderer/layout_test/resources/fonts/android_main_fonts.xml
rename to content/shell/test_runner/resources/fonts/android_main_fonts.xml
diff --git a/content/shell/renderer/layout_test/spell_check_client.cc b/content/shell/test_runner/spell_check_client.cc
similarity index 94%
rename from content/shell/renderer/layout_test/spell_check_client.cc
rename to content/shell/test_runner/spell_check_client.cc
index 25d8fc9..f7f9791 100644
--- a/content/shell/renderer/layout_test/spell_check_client.cc
+++ b/content/shell/test_runner/spell_check_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/spell_check_client.h"
+#include "content/shell/test_runner/spell_check_client.h"
 
 #include <stddef.h>
 
@@ -10,9 +10,9 @@
 #include "base/bind_helpers.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "content/shell/renderer/layout_test/mock_grammar_check.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
+#include "content/shell/test_runner/mock_grammar_check.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/web_test_delegate.h"
 #include "third_party/blink/public/web/blink.h"
 #include "third_party/blink/public/web/web_local_frame.h"
 #include "third_party/blink/public/web/web_text_checking_completion.h"
diff --git a/content/shell/renderer/layout_test/spell_check_client.h b/content/shell/test_runner/spell_check_client.h
similarity index 89%
rename from content/shell/renderer/layout_test/spell_check_client.h
rename to content/shell/test_runner/spell_check_client.h
index 07ca748d..f5a8061 100644
--- a/content/shell/renderer/layout_test/spell_check_client.h
+++ b/content/shell/test_runner/spell_check_client.h
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_SPELL_CHECK_CLIENT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_SPELL_CHECK_CLIENT_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
+#define CONTENT_SHELL_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
 
 #include <stdint.h>
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "content/shell/renderer/layout_test/mock_spell_check.h"
+#include "content/shell/test_runner/mock_spell_check.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/platform/web_vector.h"
 #include "third_party/blink/public/web/web_text_check_client.h"
@@ -79,4 +79,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_SPELL_CHECK_CLIENT_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
diff --git a/content/shell/renderer/layout_test/test_common.cc b/content/shell/test_runner/test_common.cc
similarity index 97%
rename from content/shell/renderer/layout_test/test_common.cc
rename to content/shell/test_runner/test_common.cc
index 5f3169c..8bf67ee7 100644
--- a/content/shell/renderer/layout_test/test_common.cc
+++ b/content/shell/test_runner/test_common.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/test_common.h"
+#include "content/shell/test_runner/test_common.h"
 
 #include <stddef.h>
 
diff --git a/content/shell/renderer/layout_test/test_common.h b/content/shell/test_runner/test_common.h
similarity index 74%
rename from content/shell/renderer/layout_test/test_common.h
rename to content/shell/test_runner/test_common.h
index 4a2a611c9..20887b6 100644
--- a/content/shell/renderer/layout_test/test_common.h
+++ b/content/shell/test_runner/test_common.h
@@ -2,12 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_COMMON_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_COMMON_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEST_COMMON_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEST_COMMON_H_
 
 #include <string>
 
 #include "base/strings/string_util.h"
+#include "content/shell/test_runner/test_runner_export.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/web/web_navigation_policy.h"
 #include "v8/include/v8.h"
@@ -24,7 +25,7 @@
   return !IsASCIIAlpha(ch);
 }
 
-std::string NormalizeLayoutTestURL(const std::string& url);
+TEST_RUNNER_EXPORT std::string NormalizeLayoutTestURL(const std::string& url);
 
 std::string URLDescription(const GURL& url);
 const char* WebNavigationPolicyToString(
@@ -35,4 +36,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_COMMON_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEST_COMMON_H_
diff --git a/content/shell/renderer/layout_test/test_interfaces.cc b/content/shell/test_runner/test_interfaces.cc
similarity index 91%
rename from content/shell/renderer/layout_test/test_interfaces.cc
rename to content/shell/test_runner/test_interfaces.cc
index f4b9bb13..16bdf89 100644
--- a/content/shell/renderer/layout_test/test_interfaces.cc
+++ b/content/shell/test_runner/test_interfaces.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/test_interfaces.h"
+#include "content/shell/test_runner/test_interfaces.h"
 
 #include <stddef.h>
 
@@ -13,11 +13,11 @@
 #include "base/logging.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
-#include "content/shell/renderer/layout_test/gamepad_controller.h"
-#include "content/shell/renderer/layout_test/gc_controller.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/text_input_controller.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/gamepad_controller.h"
+#include "content/shell/test_runner/gc_controller.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/text_input_controller.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 #include "third_party/blink/public/platform/web_cache.h"
 #include "third_party/blink/public/platform/web_url.h"
 #include "third_party/blink/public/web/blink.h"
diff --git a/content/shell/renderer/layout_test/test_interfaces.h b/content/shell/test_runner/test_interfaces.h
similarity index 84%
rename from content/shell/renderer/layout_test/test_interfaces.h
rename to content/shell/test_runner/test_interfaces.h
index 3d76213..f520c81 100644
--- a/content/shell/renderer/layout_test/test_interfaces.h
+++ b/content/shell/test_runner/test_interfaces.h
@@ -2,22 +2,22 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_INTERFACES_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_INTERFACES_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEST_INTERFACES_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEST_INTERFACES_H_
 
 #include <memory>
 #include <vector>
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "content/shell/renderer/layout_test/mock_web_theme_engine.h"
+#include "content/shell/test_runner/mock_web_theme_engine.h"
 
 namespace blink {
 class WebLocalFrame;
 class WebThemeEngine;
 class WebURL;
 class WebView;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -65,4 +65,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_INTERFACES_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEST_INTERFACES_H_
diff --git a/content/shell/renderer/layout_test/test_plugin.cc b/content/shell/test_runner/test_plugin.cc
similarity index 97%
rename from content/shell/renderer/layout_test/test_plugin.cc
rename to content/shell/test_runner/test_plugin.cc
index 9010f1d6..84795a8 100644
--- a/content/shell/renderer/layout_test/test_plugin.cc
+++ b/content/shell/test_runner/test_plugin.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/test_plugin.h"
+#include "content/shell/test_runner/test_plugin.h"
 
 #include <stddef.h>
 #include <stdint.h>
@@ -17,7 +17,7 @@
 #include "cc/layers/texture_layer.h"
 #include "cc/resources/cross_thread_shared_bitmap.h"
 #include "components/viz/common/resources/bitmap_allocation.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
+#include "content/shell/test_runner/web_test_delegate.h"
 #include "gpu/command_buffer/client/gles2_interface.h"
 #include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/public/platform/web_coalesced_input_event.h"
@@ -222,10 +222,11 @@
   return supports_keyboard_focus_;
 }
 
-void TestPlugin::UpdateGeometry(const blink::WebRect& window_rect,
-                                const blink::WebRect& clip_rect,
-                                const blink::WebRect& unobscured_rect,
-                                bool is_visible) {
+void TestPlugin::UpdateGeometry(
+    const blink::WebRect& window_rect,
+    const blink::WebRect& clip_rect,
+    const blink::WebRect& unobscured_rect,
+    bool is_visible) {
   if (clip_rect == rect_)
     return;
   rect_ = clip_rect;
diff --git a/content/shell/renderer/layout_test/test_plugin.h b/content/shell/test_runner/test_plugin.h
similarity index 96%
rename from content/shell/renderer/layout_test/test_plugin.h
rename to content/shell/test_runner/test_plugin.h
index 83a4831..01c431c 100644
--- a/content/shell/renderer/layout_test/test_plugin.h
+++ b/content/shell/test_runner/test_plugin.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_PLUGIN_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_PLUGIN_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEST_PLUGIN_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEST_PLUGIN_H_
 
 #include <memory>
 #include <string>
@@ -24,7 +24,7 @@
 namespace blink {
 class WebGraphicsContext3DProvider;
 struct WebPluginParams;
-}  // namespace blink
+}
 
 namespace cc {
 class CrossThreadSharedBitmap;
@@ -34,7 +34,7 @@
 namespace gles2 {
 class GLES2Interface;
 }
-}  // namespace gpu
+}
 
 namespace viz {
 struct TransferableResource;
@@ -192,4 +192,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_PLUGIN_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEST_PLUGIN_H_
diff --git a/content/shell/renderer/layout_test/test_preferences.cc b/content/shell/test_runner/test_preferences.cc
similarity index 95%
rename from content/shell/renderer/layout_test/test_preferences.cc
rename to content/shell/test_runner/test_preferences.cc
index da38d5ac..da9ae34 100644
--- a/content/shell/renderer/layout_test/test_preferences.cc
+++ b/content/shell/test_runner/test_preferences.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/test_preferences.h"
+#include "content/shell/test_runner/test_preferences.h"
 
 #include "build/build_config.h"
 
diff --git a/content/shell/renderer/layout_test/test_preferences.h b/content/shell/test_runner/test_preferences.h
similarity index 82%
rename from content/shell/renderer/layout_test/test_preferences.h
rename to content/shell/test_runner/test_preferences.h
index 11f4541..886ee2d5 100644
--- a/content/shell/renderer/layout_test/test_preferences.h
+++ b/content/shell/test_runner/test_preferences.h
@@ -2,16 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_PREFERENCES_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_PREFERENCES_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEST_PREFERENCES_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEST_PREFERENCES_H_
 
+#include "content/shell/test_runner/test_runner_export.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/platform/web_url.h"
 #include "third_party/blink/public/web/web_settings.h"
 
 namespace test_runner {
 
-struct TestPreferences {
+struct TEST_RUNNER_EXPORT TestPreferences {
   int default_font_size;
   int minimum_font_size;
   bool xss_auditor_enabled;
@@ -40,6 +41,6 @@
   TestPreferences();
   void Reset();
 };
-}  // namespace test_runner
+}
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_PREFERENCES_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEST_PREFERENCES_H_
diff --git a/content/shell/renderer/layout_test/test_runner.cc b/content/shell/test_runner/test_runner.cc
similarity index 98%
rename from content/shell/renderer/layout_test/test_runner.cc
rename to content/shell/test_runner/test_runner.cc
index e9d54e7..2ecbe903 100644
--- a/content/shell/renderer/layout_test/test_runner.cc
+++ b/content/shell/test_runner/test_runner.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/test_runner.h"
+#include "content/shell/test_runner/test_runner.h"
 
 #include <stddef.h>
 
@@ -20,19 +20,19 @@
 #include "build/build_config.h"
 #include "cc/paint/paint_canvas.h"
 #include "content/shell/common/layout_test/layout_test_switches.h"
-#include "content/shell/renderer/layout_test/layout_and_paint_async_then.h"
-#include "content/shell/renderer/layout_test/layout_dump.h"
-#include "content/shell/renderer/layout_test/mock_content_settings_client.h"
-#include "content/shell/renderer/layout_test/mock_screen_orientation_client.h"
-#include "content/shell/renderer/layout_test/mock_web_document_subresource_filter.h"
-#include "content/shell/renderer/layout_test/pixel_dump.h"
-#include "content/shell/renderer/layout_test/spell_check_client.h"
-#include "content/shell/renderer/layout_test/test_common.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_preferences.h"
-#include "content/shell/renderer/layout_test/test_runner_for_specific_view.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/layout_and_paint_async_then.h"
+#include "content/shell/test_runner/layout_dump.h"
+#include "content/shell/test_runner/mock_content_settings_client.h"
+#include "content/shell/test_runner/mock_screen_orientation_client.h"
+#include "content/shell/test_runner/mock_web_document_subresource_filter.h"
+#include "content/shell/test_runner/pixel_dump.h"
+#include "content/shell/test_runner/spell_check_client.h"
+#include "content/shell/test_runner/test_common.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_preferences.h"
+#include "content/shell/test_runner/test_runner_for_specific_view.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 #include "gin/arguments.h"
 #include "gin/array_buffer.h"
 #include "gin/handle.h"
diff --git a/content/shell/renderer/layout_test/test_runner.h b/content/shell/test_runner/test_runner.h
similarity index 98%
rename from content/shell/renderer/layout_test/test_runner.h
rename to content/shell/test_runner/test_runner.h
index e490c6f..767d61a 100644
--- a/content/shell/renderer/layout_test/test_runner.h
+++ b/content/shell/test_runner/test_runner.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_H_
 
 #include <stdint.h>
 
@@ -17,8 +17,9 @@
 #include "base/memory/weak_ptr.h"
 #include "base/optional.h"
 #include "base/strings/string16.h"
-#include "content/shell/renderer/layout_test/layout_test_runtime_flags.h"
-#include "content/shell/renderer/layout_test/web_test_runner.h"
+#include "content/shell/test_runner/layout_test_runtime_flags.h"
+#include "content/shell/test_runner/test_runner_export.h"
+#include "content/shell/test_runner/web_test_runner.h"
 #include "media/midi/midi_service.mojom.h"
 #include "third_party/blink/public/platform/web_effective_connection_type.h"
 #include "third_party/blink/public/platform/web_image.h"
@@ -33,12 +34,12 @@
 class WebLocalFrame;
 class WebString;
 class WebView;
-}  // namespace blink
+}
 
 namespace gin {
 class ArrayBufferView;
 class Arguments;
-}  // namespace gin
+}
 
 namespace test_runner {
 
@@ -608,4 +609,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_H_
diff --git a/content/shell/test_runner/test_runner_export.h b/content/shell/test_runner/test_runner_export.h
new file mode 100644
index 0000000..3f7336f2
--- /dev/null
+++ b/content/shell/test_runner/test_runner_export.h
@@ -0,0 +1,29 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_EXPORT_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_EXPORT_H_
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(TEST_RUNNER_IMPLEMENTATION)
+#define TEST_RUNNER_EXPORT __declspec(dllexport)
+#else
+#define TEST_RUNNER_EXPORT __declspec(dllimport)
+#endif  // defined(TEST_RUNNER_IMPLEMENTATION)
+
+#else  // defined(WIN32)
+#if defined(TEST_RUNNER_IMPLEMENTATION)
+#define TEST_RUNNER_EXPORT __attribute__((visibility("default")))
+#else
+#define TEST_RUNNER_EXPORT
+#endif
+#endif
+
+#else  // defined(COMPONENT_BUILD)
+#define TEST_RUNNER_EXPORT
+#endif
+
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_EXPORT_H_
diff --git a/content/shell/renderer/layout_test/test_runner_for_specific_view.cc b/content/shell/test_runner/test_runner_for_specific_view.cc
similarity index 96%
rename from content/shell/renderer/layout_test/test_runner_for_specific_view.cc
rename to content/shell/test_runner/test_runner_for_specific_view.cc
index bfd6867..dce1c04b 100644
--- a/content/shell/renderer/layout_test/test_runner_for_specific_view.cc
+++ b/content/shell/test_runner/test_runner_for_specific_view.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/test_runner_for_specific_view.h"
+#include "content/shell/test_runner/test_runner_for_specific_view.h"
 
 #include <stddef.h>
 #include <limits>
@@ -15,18 +15,18 @@
 #include "base/strings/string_number_conversions.h"
 #include "build/build_config.h"
 #include "cc/paint/paint_canvas.h"
-#include "content/shell/renderer/layout_test/layout_and_paint_async_then.h"
-#include "content/shell/renderer/layout_test/layout_dump.h"
-#include "content/shell/renderer/layout_test/mock_content_settings_client.h"
-#include "content/shell/renderer/layout_test/mock_screen_orientation_client.h"
-#include "content/shell/renderer/layout_test/pixel_dump.h"
-#include "content/shell/renderer/layout_test/spell_check_client.h"
-#include "content/shell/renderer/layout_test/test_common.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_preferences.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/layout_and_paint_async_then.h"
+#include "content/shell/test_runner/layout_dump.h"
+#include "content/shell/test_runner/mock_content_settings_client.h"
+#include "content/shell/test_runner/mock_screen_orientation_client.h"
+#include "content/shell/test_runner/pixel_dump.h"
+#include "content/shell/test_runner/spell_check_client.h"
+#include "content/shell/test_runner/test_common.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_preferences.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 #include "gin/arguments.h"
 #include "gin/array_buffer.h"
 #include "gin/handle.h"
diff --git a/content/shell/renderer/layout_test/test_runner_for_specific_view.h b/content/shell/test_runner/test_runner_for_specific_view.h
similarity index 96%
rename from content/shell/renderer/layout_test/test_runner_for_specific_view.h
rename to content/shell/test_runner/test_runner_for_specific_view.h
index bc8053b..1ca05bce7 100644
--- a/content/shell/renderer/layout_test/test_runner_for_specific_view.h
+++ b/content/shell/test_runner/test_runner_for_specific_view.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_
 
 #include <stdint.h>
 
@@ -22,7 +22,7 @@
 struct Manifest;
 class WebLocalFrame;
 class WebView;
-}  // namespace blink
+}
 
 namespace gin {
 class Arguments;
@@ -229,4 +229,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEST_RUNNER_FOR_SPECIFIC_VIEW_H_
diff --git a/content/shell/renderer/layout_test/text_input_controller.cc b/content/shell/test_runner/text_input_controller.cc
similarity index 98%
rename from content/shell/renderer/layout_test/text_input_controller.cc
rename to content/shell/test_runner/text_input_controller.cc
index a7b2452..d82c0d3 100644
--- a/content/shell/renderer/layout_test/text_input_controller.cc
+++ b/content/shell/test_runner/text_input_controller.cc
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/text_input_controller.h"
+#include "content/shell/test_runner/text_input_controller.h"
 
 #include "base/macros.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 #include "gin/arguments.h"
 #include "gin/handle.h"
 #include "gin/object_template_builder.h"
diff --git a/content/shell/renderer/layout_test/text_input_controller.h b/content/shell/test_runner/text_input_controller.h
similarity index 89%
rename from content/shell/renderer/layout_test/text_input_controller.h
rename to content/shell/test_runner/text_input_controller.h
index 37e5e0b..df9d1f2 100644
--- a/content/shell/renderer/layout_test/text_input_controller.h
+++ b/content/shell/test_runner/text_input_controller.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEXT_INPUT_CONTROLLER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEXT_INPUT_CONTROLLER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
+#define CONTENT_SHELL_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
 
 #include <string>
 #include <vector>
@@ -15,7 +15,7 @@
 class WebInputMethodController;
 class WebLocalFrame;
 class WebView;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -64,4 +64,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TEXT_INPUT_CONTROLLER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
diff --git a/content/shell/renderer/layout_test/tracked_dictionary.cc b/content/shell/test_runner/tracked_dictionary.cc
similarity index 94%
rename from content/shell/renderer/layout_test/tracked_dictionary.cc
rename to content/shell/test_runner/tracked_dictionary.cc
index 713efb1a..e88c890 100644
--- a/content/shell/renderer/layout_test/tracked_dictionary.cc
+++ b/content/shell/test_runner/tracked_dictionary.cc
@@ -2,10 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/tracked_dictionary.h"
+#include "content/shell/test_runner/tracked_dictionary.h"
 
 #include <utility>
 
+
 namespace test_runner {
 
 TrackedDictionary::TrackedDictionary() {}
diff --git a/content/shell/renderer/layout_test/tracked_dictionary.h b/content/shell/test_runner/tracked_dictionary.h
similarity index 85%
rename from content/shell/renderer/layout_test/tracked_dictionary.h
rename to content/shell/test_runner/tracked_dictionary.h
index 394e48a2..73c5791f 100644
--- a/content/shell/renderer/layout_test/tracked_dictionary.h
+++ b/content/shell/test_runner/tracked_dictionary.h
@@ -2,21 +2,22 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_TRACKED_DICTIONARY_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_TRACKED_DICTIONARY_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_TRACKED_DICTIONARY_H_
+#define CONTENT_SHELL_TEST_RUNNER_TRACKED_DICTIONARY_H_
 
 #include <memory>
 #include <string>
 
 #include "base/macros.h"
 #include "base/values.h"
+#include "content/shell/test_runner/test_runner_export.h"
 
 namespace test_runner {
 
 // TrackedDictionary wraps base::DictionaryValue, but forces all mutations to go
 // through TrackedDictionary's Set methods.  This allows tracking of changes
 // accumulated since the last call to ResetChangeTracking.
-class TrackedDictionary {
+class TEST_RUNNER_EXPORT TrackedDictionary {
  public:
   TrackedDictionary();
 
@@ -54,4 +55,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_TRACKED_DICTIONARY_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_TRACKED_DICTIONARY_H_
diff --git a/content/shell/renderer/layout_test/web_ax_object_proxy.cc b/content/shell/test_runner/web_ax_object_proxy.cc
similarity index 99%
rename from content/shell/renderer/layout_test/web_ax_object_proxy.cc
rename to content/shell/test_runner/web_ax_object_proxy.cc
index 6b6792f..cc148f2c 100644
--- a/content/shell/renderer/layout_test/web_ax_object_proxy.cc
+++ b/content/shell/test_runner/web_ax_object_proxy.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_ax_object_proxy.h"
+#include "content/shell/test_runner/web_ax_object_proxy.h"
 
 #include <stddef.h>
 
diff --git a/content/shell/renderer/layout_test/web_ax_object_proxy.h b/content/shell/test_runner/web_ax_object_proxy.h
similarity index 96%
rename from content/shell/renderer/layout_test/web_ax_object_proxy.h
rename to content/shell/test_runner/web_ax_object_proxy.h
index a58b3872..79d25a6 100644
--- a/content/shell/renderer/layout_test/web_ax_object_proxy.h
+++ b/content/shell/test_runner/web_ax_object_proxy.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_AX_OBJECT_PROXY_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_AX_OBJECT_PROXY_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
 
 #include <stdint.h>
 
@@ -249,4 +249,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_AX_OBJECT_PROXY_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
diff --git a/content/shell/renderer/layout_test/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc
similarity index 96%
rename from content/shell/renderer/layout_test/web_frame_test_client.cc
rename to content/shell/test_runner/web_frame_test_client.cc
index bfd02f3..f1a260d 100644
--- a/content/shell/renderer/layout_test/web_frame_test_client.cc
+++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_frame_test_client.h"
+#include "content/shell/test_runner/web_frame_test_client.h"
 
 #include <memory>
 
@@ -10,18 +10,18 @@
 #include "base/strings/string_piece.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
-#include "content/shell/renderer/layout_test/accessibility_controller.h"
-#include "content/shell/renderer/layout_test/event_sender.h"
-#include "content/shell/renderer/layout_test/mock_screen_orientation_client.h"
-#include "content/shell/renderer/layout_test/test_common.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_plugin.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/test_runner_support.h"
-#include "content/shell/renderer/layout_test/web_frame_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/public/test/test_runner_support.h"
+#include "content/shell/test_runner/accessibility_controller.h"
+#include "content/shell/test_runner/event_sender.h"
+#include "content/shell/test_runner/mock_screen_orientation_client.h"
+#include "content/shell/test_runner/test_common.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_plugin.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/web_frame_test_proxy.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 #include "net/base/net_errors.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/platform/web_url.h"
diff --git a/content/shell/renderer/layout_test/web_frame_test_client.h b/content/shell/test_runner/web_frame_test_client.h
similarity index 95%
rename from content/shell/renderer/layout_test/web_frame_test_client.h
rename to content/shell/test_runner/web_frame_test_client.h
index b656c4b..b63ff5f2 100644
--- a/content/shell/renderer/layout_test/web_frame_test_client.h
+++ b/content/shell/test_runner/web_frame_test_client.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_FRAME_TEST_CLIENT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_FRAME_TEST_CLIENT_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_
 
 #include <map>
 #include <string>
@@ -108,4 +108,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_FRAME_TEST_CLIENT_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_FRAME_TEST_CLIENT_H_
diff --git a/content/shell/renderer/layout_test/web_frame_test_proxy.cc b/content/shell/test_runner/web_frame_test_proxy.cc
similarity index 97%
rename from content/shell/renderer/layout_test/web_frame_test_proxy.cc
rename to content/shell/test_runner/web_frame_test_proxy.cc
index c48699b..0adaee59 100644
--- a/content/shell/renderer/layout_test/web_frame_test_proxy.cc
+++ b/content/shell/test_runner/web_frame_test_proxy.cc
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_frame_test_proxy.h"
+#include "content/shell/test_runner/web_frame_test_proxy.h"
 
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 
 namespace test_runner {
 
diff --git a/content/shell/renderer/layout_test/web_frame_test_proxy.h b/content/shell/test_runner/web_frame_test_proxy.h
similarity index 90%
rename from content/shell/renderer/layout_test/web_frame_test_proxy.h
rename to content/shell/test_runner/web_frame_test_proxy.h
index d51ebbd..9338c7e 100644
--- a/content/shell/renderer/layout_test/web_frame_test_proxy.h
+++ b/content/shell/test_runner/web_frame_test_proxy.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_FRAME_TEST_PROXY_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_FRAME_TEST_PROXY_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
 
 #include <memory>
 #include <string>
@@ -11,7 +11,8 @@
 
 #include "base/macros.h"
 #include "content/renderer/render_frame_impl.h"
-#include "content/shell/renderer/layout_test/web_frame_test_client.h"
+#include "content/shell/test_runner/test_runner_export.h"
+#include "content/shell/test_runner/web_frame_test_client.h"
 #include "third_party/blink/public/platform/web_effective_connection_type.h"
 #include "third_party/blink/public/platform/web_string.h"
 #include "third_party/blink/public/web/web_local_frame.h"
@@ -24,7 +25,7 @@
 namespace test_runner {
 class WebTestInterfaces;
 
-class WebFrameTestProxyBase {
+class TEST_RUNNER_EXPORT WebFrameTestProxyBase {
  public:
   blink::WebLocalFrame* web_frame() const { return web_frame_; }
   void set_web_frame(blink::WebLocalFrame* frame) {
@@ -45,8 +46,8 @@
 
 // WebFrameTestProxy is used during LayoutTests instead of a RenderFrameImpl to
 // inject test-only behaviour by overriding methods in the base class.
-class WebFrameTestProxy : public content::RenderFrameImpl,
-                          public WebFrameTestProxyBase {
+class TEST_RUNNER_EXPORT WebFrameTestProxy : public content::RenderFrameImpl,
+                                             public WebFrameTestProxyBase {
  public:
   template <typename... Args>
   explicit WebFrameTestProxy(Args&&... args)
@@ -121,4 +122,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_FRAME_TEST_PROXY_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
diff --git a/content/shell/renderer/layout_test/web_test_delegate.h b/content/shell/test_runner/web_test_delegate.h
similarity index 97%
rename from content/shell/renderer/layout_test/web_test_delegate.h
rename to content/shell/test_runner/web_test_delegate.h
index 0804157..6d62d0c 100644
--- a/content/shell/renderer/layout_test/web_test_delegate.h
+++ b/content/shell/test_runner/web_test_delegate.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_DELEGATE_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_DELEGATE_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_TEST_DELEGATE_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_TEST_DELEGATE_H_
 
 #include <memory>
 #include <string>
@@ -34,7 +34,7 @@
 struct WebSize;
 class WebURLRequest;
 class WebView;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -273,4 +273,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_DELEGATE_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_TEST_DELEGATE_H_
diff --git a/content/shell/renderer/layout_test/web_test_interfaces.cc b/content/shell/test_runner/web_test_interfaces.cc
similarity index 83%
rename from content/shell/renderer/layout_test/web_test_interfaces.cc
rename to content/shell/test_runner/web_test_interfaces.cc
index 3e66705..44bb763 100644
--- a/content/shell/renderer/layout_test/web_test_interfaces.cc
+++ b/content/shell/test_runner/web_test_interfaces.cc
@@ -2,18 +2,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
 
 #include <utility>
 
-#include "content/shell/renderer/layout_test/mock_web_midi_accessor.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/web_frame_test_client.h"
-#include "content/shell/renderer/layout_test/web_view_test_client.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_widget_test_client.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/mock_web_midi_accessor.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/web_frame_test_client.h"
+#include "content/shell/test_runner/web_view_test_client.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_widget_test_client.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 #include "third_party/blink/public/platform/modules/webmidi/web_midi_accessor.h"
 
 using namespace blink;
diff --git a/content/shell/renderer/layout_test/web_test_interfaces.h b/content/shell/test_runner/web_test_interfaces.h
similarity index 92%
rename from content/shell/renderer/layout_test/web_test_interfaces.h
rename to content/shell/test_runner/web_test_interfaces.h
index 84c3ea7..768a464e 100644
--- a/content/shell/renderer/layout_test/web_test_interfaces.h
+++ b/content/shell/test_runner/web_test_interfaces.h
@@ -2,13 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_INTERFACES_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_INTERFACES_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_TEST_INTERFACES_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_TEST_INTERFACES_H_
 
 #include <memory>
 #include <vector>
 
 #include "base/macros.h"
+#include "content/shell/test_runner/test_runner_export.h"
 
 namespace blink {
 class WebLocalFrameClient;
@@ -19,7 +20,7 @@
 class WebThemeEngine;
 class WebURL;
 class WebView;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -33,7 +34,7 @@
 class WebViewTestClient;
 class WebWidgetTestClient;
 
-class WebTestInterfaces {
+class TEST_RUNNER_EXPORT WebTestInterfaces {
  public:
   WebTestInterfaces();
   ~WebTestInterfaces();
@@ -101,4 +102,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_INTERFACES_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_TEST_INTERFACES_H_
diff --git a/content/shell/renderer/layout_test/web_test_runner.h b/content/shell/test_runner/web_test_runner.h
similarity index 93%
rename from content/shell/renderer/layout_test/web_test_runner.h
rename to content/shell/test_runner/web_test_runner.h
index 7af9dc1..f126114 100644
--- a/content/shell/renderer/layout_test/web_test_runner.h
+++ b/content/shell/test_runner/web_test_runner.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_RUNNER_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_RUNNER_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_TEST_RUNNER_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_TEST_RUNNER_H_
 
 #include <string>
 #include <vector>
@@ -21,7 +21,7 @@
 class WebLocalFrame;
 class WebTextCheckClient;
 class WebView;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -87,4 +87,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_TEST_RUNNER_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_TEST_RUNNER_H_
diff --git a/content/shell/renderer/layout_test/web_view_test_client.cc b/content/shell/test_runner/web_view_test_client.cc
similarity index 85%
rename from content/shell/renderer/layout_test/web_view_test_client.cc
rename to content/shell/test_runner/web_view_test_client.cc
index ae7aa77..285bca1 100644
--- a/content/shell/renderer/layout_test/web_view_test_client.cc
+++ b/content/shell/test_runner/web_view_test_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_view_test_client.h"
+#include "content/shell/test_runner/web_view_test_client.h"
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
@@ -10,14 +10,14 @@
 #include "base/strings/string16.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/time/time.h"
-#include "content/shell/renderer/layout_test/event_sender.h"
-#include "content/shell/renderer/layout_test/test_common.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/test_runner_for_specific_view.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/event_sender.h"
+#include "content/shell/test_runner/test_common.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/test_runner_for_specific_view.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 #include "third_party/blink/public/platform/web_url_request.h"
 #include "third_party/blink/public/web/web_frame.h"
 #include "third_party/blink/public/web/web_local_frame.h"
diff --git a/content/shell/renderer/layout_test/web_view_test_client.h b/content/shell/test_runner/web_view_test_client.h
similarity index 90%
rename from content/shell/renderer/layout_test/web_view_test_client.h
rename to content/shell/test_runner/web_view_test_client.h
index 6a9ed80..9a4e48dac 100644
--- a/content/shell/renderer/layout_test/web_view_test_client.h
+++ b/content/shell/test_runner/web_view_test_client.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_VIEW_TEST_CLIENT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_VIEW_TEST_CLIENT_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
 
 #include "base/macros.h"
 #include "third_party/blink/public/web/web_view_client.h"
@@ -58,4 +58,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_VIEW_TEST_CLIENT_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_CLIENT_H_
diff --git a/content/shell/renderer/layout_test/web_view_test_proxy.cc b/content/shell/test_runner/web_view_test_proxy.cc
similarity index 93%
rename from content/shell/renderer/layout_test/web_view_test_proxy.cc
rename to content/shell/test_runner/web_view_test_proxy.cc
index 0aa951a..04c192d 100644
--- a/content/shell/renderer/layout_test/web_view_test_proxy.cc
+++ b/content/shell/test_runner/web_view_test_proxy.cc
@@ -2,19 +2,19 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 
 #include <stddef.h>
 #include <stdint.h>
 
-#include "content/shell/renderer/layout_test/accessibility_controller.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/test_runner_for_specific_view.h"
-#include "content/shell/renderer/layout_test/text_input_controller.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/accessibility_controller.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/test_runner_for_specific_view.h"
+#include "content/shell/test_runner/text_input_controller.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 #include "third_party/blink/public/web/web_frame.h"
 #include "third_party/blink/public/web/web_view.h"
 
diff --git a/content/shell/renderer/layout_test/web_view_test_proxy.h b/content/shell/test_runner/web_view_test_proxy.h
similarity index 91%
rename from content/shell/renderer/layout_test/web_view_test_proxy.h
rename to content/shell/test_runner/web_view_test_proxy.h
index 1b3491d..43c5c89 100644
--- a/content/shell/renderer/layout_test/web_view_test_proxy.h
+++ b/content/shell/test_runner/web_view_test_proxy.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_VIEW_TEST_PROXY_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_VIEW_TEST_PROXY_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_PROXY_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_PROXY_H_
 
 #include <memory>
 #include <string>
@@ -13,9 +13,10 @@
 #include "base/macros.h"
 #include "build/build_config.h"
 #include "content/renderer/render_view_impl.h"
-#include "content/shell/renderer/layout_test/web_view_test_client.h"
-#include "content/shell/renderer/layout_test/web_widget_test_client.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/test_runner_export.h"
+#include "content/shell/test_runner/web_view_test_client.h"
+#include "content/shell/test_runner/web_widget_test_client.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 #include "third_party/blink/public/platform/web_drag_operation.h"
 #include "third_party/blink/public/platform/web_rect.h"
 #include "third_party/blink/public/platform/web_screen_info.h"
@@ -36,7 +37,7 @@
 class WebWidget;
 struct WebPoint;
 struct WebWindowFeatures;
-}  // namespace blink
+}
 
 namespace test_runner {
 
@@ -53,7 +54,7 @@
 // the |test_widget_client| is a test-only WebWidgetClient. Mostly calls are
 // forwarded to the |base_class_widget_client|, but some are intercepted and
 // sent to the |test_widget_client| instead, or to both.
-class ProxyWebWidgetClient : public blink::WebWidgetClient {
+class TEST_RUNNER_EXPORT ProxyWebWidgetClient : public blink::WebWidgetClient {
  public:
   ProxyWebWidgetClient(blink::WebWidgetClient* base_class_widget_client,
                        blink::WebWidgetClient* widget_test_client);
@@ -115,7 +116,7 @@
 //
 // Uses private inheritence to ensure that code doesn't assume WebViews are
 // WebWidgets, and gets to the WebWidget through an accessor instead.
-class WebViewTestProxyBase : private WebWidgetTestProxyBase {
+class TEST_RUNNER_EXPORT WebViewTestProxyBase : private WebWidgetTestProxyBase {
  public:
   blink::WebView* web_view() { return web_view_; }
   void set_web_view(blink::WebView* view) {
@@ -177,8 +178,8 @@
 //    override RenderViewImpl's getter and call a getter from
 //    WebViewTestProxyBase instead. In addition, WebViewTestProxyBase will have
 //    a public setter that could be called from the TestRunner.
-class WebViewTestProxy : public content::RenderViewImpl,
-                         public WebViewTestProxyBase {
+class TEST_RUNNER_EXPORT WebViewTestProxy : public content::RenderViewImpl,
+                                            public WebViewTestProxyBase {
  public:
   template <typename... Args>
   explicit WebViewTestProxy(Args&&... args)
@@ -210,4 +211,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_VIEW_TEST_PROXY_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_VIEW_TEST_PROXY_H_
diff --git a/content/shell/renderer/layout_test/web_widget_test_client.cc b/content/shell/test_runner/web_widget_test_client.cc
similarity index 85%
rename from content/shell/renderer/layout_test/web_widget_test_client.cc
rename to content/shell/test_runner/web_widget_test_client.cc
index 06ab537..9e24724 100644
--- a/content/shell/renderer/layout_test/web_widget_test_client.cc
+++ b/content/shell/test_runner/web_widget_test_client.cc
@@ -2,20 +2,20 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_widget_test_client.h"
+#include "content/shell/test_runner/web_widget_test_client.h"
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/logging.h"
 #include "base/time/time.h"
-#include "content/shell/renderer/layout_test/event_sender.h"
-#include "content/shell/renderer/layout_test/mock_screen_orientation_client.h"
-#include "content/shell/renderer/layout_test/test_interfaces.h"
-#include "content/shell/renderer/layout_test/test_runner.h"
-#include "content/shell/renderer/layout_test/test_runner_for_specific_view.h"
-#include "content/shell/renderer/layout_test/web_test_delegate.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/event_sender.h"
+#include "content/shell/test_runner/mock_screen_orientation_client.h"
+#include "content/shell/test_runner/test_interfaces.h"
+#include "content/shell/test_runner/test_runner.h"
+#include "content/shell/test_runner/test_runner_for_specific_view.h"
+#include "content/shell/test_runner/web_test_delegate.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 #include "third_party/blink/public/platform/web_screen_info.h"
 #include "third_party/blink/public/web/web_page_popup.h"
 #include "third_party/blink/public/web/web_widget.h"
diff --git a/content/shell/renderer/layout_test/web_widget_test_client.h b/content/shell/test_runner/web_widget_test_client.h
similarity index 90%
rename from content/shell/renderer/layout_test/web_widget_test_client.h
rename to content/shell/test_runner/web_widget_test_client.h
index 506bd01..54e103b 100644
--- a/content/shell/renderer/layout_test/web_widget_test_client.h
+++ b/content/shell/test_runner/web_widget_test_client.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_WIDGET_TEST_CLIENT_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_WIDGET_TEST_CLIENT_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
@@ -62,4 +62,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_WIDGET_TEST_CLIENT_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_WIDGET_TEST_CLIENT_H_
diff --git a/content/shell/renderer/layout_test/web_widget_test_proxy.cc b/content/shell/test_runner/web_widget_test_proxy.cc
similarity index 90%
rename from content/shell/renderer/layout_test/web_widget_test_proxy.cc
rename to content/shell/test_runner/web_widget_test_proxy.cc
index 1bf723c..65ce1c1b 100644
--- a/content/shell/renderer/layout_test/web_widget_test_proxy.cc
+++ b/content/shell/test_runner/web_widget_test_proxy.cc
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
 
-#include "content/shell/renderer/layout_test/event_sender.h"
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
+#include "content/shell/test_runner/event_sender.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
 
 namespace test_runner {
 
diff --git a/content/shell/renderer/layout_test/web_widget_test_proxy.h b/content/shell/test_runner/web_widget_test_proxy.h
similarity index 88%
rename from content/shell/renderer/layout_test/web_widget_test_proxy.h
rename to content/shell/test_runner/web_widget_test_proxy.h
index 83eb529..873ec237 100644
--- a/content/shell/renderer/layout_test/web_widget_test_proxy.h
+++ b/content/shell/test_runner/web_widget_test_proxy.h
@@ -2,22 +2,23 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_WIDGET_TEST_PROXY_H_
-#define CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_WIDGET_TEST_PROXY_H_
+#ifndef CONTENT_SHELL_TEST_RUNNER_WEB_WIDGET_TEST_PROXY_H_
+#define CONTENT_SHELL_TEST_RUNNER_WEB_WIDGET_TEST_PROXY_H_
 
 #include <memory>
 
 #include "base/logging.h"
 #include "base/macros.h"
 #include "content/renderer/render_widget.h"
-#include "content/shell/renderer/layout_test/web_widget_test_client.h"
+#include "content/shell/test_runner/test_runner_export.h"
+#include "content/shell/test_runner/web_widget_test_client.h"
 #include "third_party/blink/public/web/web_widget_client.h"
 
 namespace blink {
 class WebLocalFrame;
 class WebString;
 class WebWidget;
-}  // namespace blink
+}
 
 namespace content {
 class RenderViewImpl;
@@ -29,7 +30,7 @@
 class WebTestInterfaces;
 class WebViewTestProxyBase;
 
-class WebWidgetTestProxyBase {
+class TEST_RUNNER_EXPORT WebWidgetTestProxyBase {
  public:
   blink::WebWidget* web_widget() { return web_widget_; }
   void set_web_widget(blink::WebWidget* widget) {
@@ -93,8 +94,8 @@
 //    override RenderViewImpl's getter and call a getter from
 //    WebWidgetTestProxyBase instead. In addition, WebWidgetTestProxyBase will
 //    have a public setter that could be called from the TestRunner.
-class WebWidgetTestProxy : public content::RenderWidget,
-                           public WebWidgetTestProxyBase {
+class TEST_RUNNER_EXPORT WebWidgetTestProxy : public content::RenderWidget,
+                                              public WebWidgetTestProxyBase {
  public:
   template <typename... Args>
   explicit WebWidgetTestProxy(Args&&... args)
@@ -126,4 +127,4 @@
 
 }  // namespace test_runner
 
-#endif  // CONTENT_SHELL_RENDERER_LAYOUT_TEST_WEB_WIDGET_TEST_PROXY_H_
+#endif  // CONTENT_SHELL_TEST_RUNNER_WEB_WIDGET_TEST_PROXY_H_
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 3fbd7ed..651bcd6 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -513,6 +513,7 @@
   ]
 
   deps = [
+    ":layouttest_support",
     ":test_support",
     "//base",
     "//base:i18n",
@@ -533,10 +534,7 @@
   ]
 
   if (is_android) {
-    deps += [
-      ":nested_message_pump_android",
-      "//content/public/app:both",
-    ]
+    deps += [ "//content/public/app:both" ]
   } else {
     deps += [ "//content/public/browser" ]
   }
@@ -584,8 +582,7 @@
   ]
 }
 
-# TODO(danakj): Move these files into another target.
-static_library("nested_message_pump_android") {
+static_library("layouttest_support") {
   testonly = true
 
   # See comment at the top of //content/BUILD.gn for why this is disabled in
@@ -595,12 +592,33 @@
   }
 
   sources = [
+    "../public/test/layouttest_support.h",
     "../public/test/nested_message_pump_android.cc",
     "../public/test/nested_message_pump_android.h",
+    "layouttest_support.cc",
   ]
 
   deps = [
-    "//base",
+    ":test_support",
+    "//cc",
+    "//components/viz/test:test_support",
+    "//content/browser:for_content_tests",
+    "//content/child:for_content_tests",
+    "//content/public/common",
+    "//content/public/renderer",
+    "//content/renderer:for_content_tests",
+    "//content/shell:layout_test_switches",
+    "//content/shell/test_runner:test_runner",
+    "//device/bluetooth",
+    "//device/gamepad/public/cpp:shared_with_blink",
+    "//gpu/ipc/service",
+    "//services/device/public/cpp/generic_sensor",
+    "//services/ui/public/cpp/gpu",
+    "//skia",
+    "//ui/accessibility:ax_enums_mojo",
+    "//ui/events/blink",
+    "//ui/gfx:test_support",
+    "//v8",
   ]
 
   if (is_android) {
@@ -608,6 +626,27 @@
   }
 }
 
+static_library("test_runner_support") {
+  testonly = true
+
+  # See comment at the top of //content/BUILD.gn for why this is disabled in
+  # component builds.
+  if (is_component_build) {
+    check_includes = false
+  }
+
+  sources = [
+    "../public/test/test_runner_support.h",
+    "test_runner_support.cc",
+  ]
+
+  deps = [
+    "//content/public/renderer",
+    "//content/renderer:for_content_tests",
+    "//third_party/blink/public:blink",
+  ]
+}
+
 if (is_android) {
   import("//build/config/android/rules.gni")
 
@@ -866,6 +905,7 @@
   deps = [
     ":browsertest_support",
     ":content_test_mojo_bindings",
+    ":layouttest_support",
     ":test_support",
     ":web_ui_test_mojo_bindings",
     "//base/test:test_support",
@@ -959,10 +999,6 @@
     "//third_party/mesa:osmesa",
   ]
 
-  if (is_android) {
-    deps += [ ":nested_message_pump_android" ]
-  }
-
   if (enable_plugins) {
     deps += [
       "//ppapi/host",
diff --git a/content/shell/renderer/layout_test/layouttest_support.cc b/content/test/layouttest_support.cc
similarity index 90%
rename from content/shell/renderer/layout_test/layouttest_support.cc
rename to content/test/layouttest_support.cc
index 324a1f1..c8bac12 100644
--- a/content/shell/renderer/layout_test/layouttest_support.cc
+++ b/content/test/layouttest_support.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/layouttest_support.h"
+#include "content/public/test/layouttest_support.h"
 
 #include <stddef.h>
 
@@ -20,9 +20,14 @@
 #include "components/viz/common/features.h"
 #include "components/viz/common/frame_sinks/copy_output_request.h"
 #include "components/viz/test/test_layer_tree_frame_sink.h"
+#include "content/browser/bluetooth/bluetooth_device_chooser_controller.h"
+#include "content/browser/renderer_host/render_process_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
+#include "content/browser/shared_worker/shared_worker_service_impl.h"
 #include "content/common/gpu_stream_constants.h"
 #include "content/common/renderer.mojom.h"
 #include "content/common/unique_name_helper.h"
+#include "content/public/browser/storage_partition.h"
 #include "content/public/common/page_state.h"
 #include "content/public/common/screen_info.h"
 #include "content/renderer/gpu/layer_tree_view.h"
@@ -39,11 +44,12 @@
 #include "content/shell/common/shell_switches.h"
 #include "content/shell/renderer/layout_test/blink_test_runner.h"
 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer.h"
-#include "content/shell/renderer/layout_test/test_common.h"
-#include "content/shell/renderer/layout_test/web_frame_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_test_interfaces.h"
-#include "content/shell/renderer/layout_test/web_view_test_proxy.h"
-#include "content/shell/renderer/layout_test/web_widget_test_proxy.h"
+#include "content/shell/test_runner/test_common.h"
+#include "content/shell/test_runner/web_frame_test_proxy.h"
+#include "content/shell/test_runner/web_test_interfaces.h"
+#include "content/shell/test_runner/web_view_test_proxy.h"
+#include "content/shell/test_runner/web_widget_test_proxy.h"
+#include "gpu/ipc/service/image_transport_surface.h"
 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
 #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
 #include "third_party/blink/public/platform/web_float_rect.h"
@@ -56,7 +62,9 @@
 #include "ui/gfx/icc_profile.h"
 #include "ui/gfx/test/icc_profiles.h"
 
-#if defined(OS_WIN)
+#if defined(OS_MACOSX)
+#include "content/browser/frame_host/popup_menu_helper_mac.h"
+#elif defined(OS_WIN)
 #include "content/child/font_warmup_win.h"
 #include "third_party/blink/public/web/win/web_font_rendering.h"
 #include "third_party/skia/include/core/SkFontMgr.h"
@@ -425,17 +433,33 @@
 #endif
 }
 
+void EnableBrowserLayoutTestMode() {
+#if defined(OS_MACOSX)
+  gpu::ImageTransportSurface::SetAllowOSMesaForTesting(true);
+  PopupMenuHelper::DontShowPopupMenuForTesting();
+#endif
+  RenderWidgetHostImpl::DisableResizeAckCheckForTesting();
+}
+
+void TerminateAllSharedWorkersForTesting(StoragePartition* storage_partition,
+                                         base::OnceClosure callback) {
+  static_cast<SharedWorkerServiceImpl*>(
+      storage_partition->GetSharedWorkerService())
+      ->TerminateAllWorkersForTesting(std::move(callback));
+}
+
 int GetLocalSessionHistoryLength(RenderView* render_view) {
-  return static_cast<RenderViewImpl*>(render_view)
-      ->GetLocalSessionHistoryLengthForTesting();
+  return static_cast<RenderViewImpl*>(render_view)->
+      GetLocalSessionHistoryLengthForTesting();
 }
 
 void SetFocusAndActivate(RenderView* render_view, bool enable) {
-  static_cast<RenderViewImpl*>(render_view)
-      ->SetFocusAndActivateForTesting(enable);
+  static_cast<RenderViewImpl*>(render_view)->
+      SetFocusAndActivateForTesting(enable);
 }
 
-void ForceResizeRenderView(RenderView* render_view, const WebSize& new_size) {
+void ForceResizeRenderView(RenderView* render_view,
+                           const WebSize& new_size) {
   auto* render_view_impl = static_cast<RenderViewImpl*>(render_view);
   gfx::Rect window_rect(render_view_impl->RootWindowRect().x,
                         render_view_impl->RootWindowRect().y, new_size.width,
@@ -489,6 +513,21 @@
   render_widget->SetDeviceColorSpaceForTesting(color_space);
 }
 
+void SetTestBluetoothScanDuration(BluetoothTestScanDurationSetting setting) {
+  switch (setting) {
+    case BluetoothTestScanDurationSetting::kImmediateTimeout:
+      BluetoothDeviceChooserController::SetTestScanDurationForTesting(
+          BluetoothDeviceChooserController::TestScanDurationSetting::
+              IMMEDIATE_TIMEOUT);
+      break;
+    case BluetoothTestScanDurationSetting::kNeverTimeout:
+      BluetoothDeviceChooserController::SetTestScanDurationForTesting(
+          BluetoothDeviceChooserController::TestScanDurationSetting::
+              NEVER_TIMEOUT);
+      break;
+  }
+}
+
 void UseSynchronousResizeMode(RenderView* render_view, bool enable) {
   RenderWidget* render_widget =
       static_cast<RenderViewImpl*>(render_view)->GetWidget();
diff --git a/content/shell/renderer/layout_test/test_runner_support.cc b/content/test/test_runner_support.cc
similarity index 89%
rename from content/shell/renderer/layout_test/test_runner_support.cc
rename to content/test/test_runner_support.cc
index 730b264..4ceda09 100644
--- a/content/shell/renderer/layout_test/test_runner_support.cc
+++ b/content/test/test_runner_support.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "content/shell/renderer/layout_test/test_runner_support.h"
+#include "content/public/test/test_runner_support.h"
 
 #include "content/common/unique_name_helper.h"
 #include "content/renderer/render_frame_impl.h"