Commit 9f2d3506 authored by danakj's avatar danakj Committed by Commit Bot

Move the test_runner files into //content/shell:web_test_renderer

This will allow for us to break unnecessary abstractions between these
two components and collapse duplicate types (e.g. the two separate
RenderFrameObservers).

Followup CLs will remove the test_runner namespace, and move the files
into the //content/shell/renderer/web_test directory.

R=avi@chromium.org

Bug: 866140
Change-Id: If509c311337b94df7085a6f6b115872678d3635d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2140301
Commit-Queue: Avi Drissman <avi@chromium.org>
Auto-Submit: danakj <danakj@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757208}
parent 954848ed
......@@ -679,7 +679,7 @@ target(link_target_type, "renderer") {
# See comment at the top of //content/BUILD.gn for how this works.
group("for_content_tests") {
visibility = [
"//content/shell/test_runner",
"//content/shell:web_test_renderer",
"//content/test/*",
]
......
......@@ -88,6 +88,14 @@ static_library("web_test_common") {
static_library("web_test_renderer") {
testonly = true
# This is to support our dependency on //content/renderer.
# 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 = [
"renderer/web_test/blink_test_helpers.cc",
"renderer/web_test/blink_test_helpers.h",
......@@ -101,19 +109,90 @@ static_library("web_test_renderer") {
"renderer/web_test/web_test_render_frame_observer.h",
"renderer/web_test/web_test_render_thread_observer.cc",
"renderer/web_test/web_test_render_thread_observer.h",
"test_runner/accessibility_controller.cc",
"test_runner/accessibility_controller.h",
"test_runner/app_banner_service.cc",
"test_runner/app_banner_service.h",
"test_runner/event_sender.cc",
"test_runner/event_sender.h",
"test_runner/gamepad_controller.cc",
"test_runner/gamepad_controller.h",
"test_runner/gc_controller.cc",
"test_runner/gc_controller.h",
"test_runner/layout_dump.cc",
"test_runner/layout_dump.h",
"test_runner/mock_content_settings_client.cc",
"test_runner/mock_content_settings_client.h",
"test_runner/mock_grammar_check.cc",
"test_runner/mock_grammar_check.h",
"test_runner/mock_screen_orientation_client.cc",
"test_runner/mock_screen_orientation_client.h",
"test_runner/mock_spell_check.cc",
"test_runner/mock_spell_check.h",
"test_runner/mock_web_document_subresource_filter.cc",
"test_runner/mock_web_document_subresource_filter.h",
"test_runner/pixel_dump.cc",
"test_runner/pixel_dump.h",
"test_runner/spell_check_client.cc",
"test_runner/spell_check_client.h",
"test_runner/test_interfaces.cc",
"test_runner/test_interfaces.h",
"test_runner/test_plugin.cc",
"test_runner/test_plugin.h",
"test_runner/test_preferences.cc",
"test_runner/test_preferences.h",
"test_runner/test_runner.cc",
"test_runner/test_runner.h",
"test_runner/test_runner_for_specific_view.cc",
"test_runner/test_runner_for_specific_view.h",
"test_runner/text_input_controller.cc",
"test_runner/text_input_controller.h",
"test_runner/tracked_dictionary.cc",
"test_runner/tracked_dictionary.h",
"test_runner/web_ax_object_proxy.cc",
"test_runner/web_ax_object_proxy.h",
"test_runner/web_frame_test_client.cc",
"test_runner/web_frame_test_client.h",
"test_runner/web_frame_test_proxy.cc",
"test_runner/web_frame_test_proxy.h",
"test_runner/web_test_delegate.h",
"test_runner/web_test_runtime_flags.cc",
"test_runner/web_test_runtime_flags.h",
"test_runner/web_view_test_proxy.cc",
"test_runner/web_view_test_proxy.h",
"test_runner/web_widget_test_proxy.cc",
"test_runner/web_widget_test_proxy.h",
]
deps = [
":client_hints_util",
":content_shell_lib",
":web_test_common",
"//base",
"//cc",
"//cc/paint",
"//components/plugins/renderer",
"//components/viz/common",
"//components/web_cache/renderer",
"//content/shell/test_runner",
"//content/public/common",
"//content/public/renderer", # For component builds.
"//content/renderer:for_content_tests", # For non-component builds.
"//content/test:web_test_support_renderer",
"//device/gamepad/public/cpp:shared_with_blink",
"//device/gamepad/public/mojom",
"//gin",
"//gpu",
"//gpu/command_buffer/client:gles2_interface",
"//media/capture",
"//printing",
"//services/device/public/mojom",
"//skia",
"//skia:test_fonts",
"//third_party/blink/public:blink_headers",
"//third_party/blink/public:test_headers",
"//ui/display",
"//ui/events:dom_keycode_converter",
"//ui/events:events_base",
"//ui/events/blink",
"//ui/gfx",
"//ui/gfx/geometry",
"//v8",
......@@ -349,7 +428,6 @@ static_library("content_shell_lib") {
"//content/gpu",
"//content/public/common",
"//content/public/common:service_names",
"//content/shell/test_runner:test_runner",
"//content/test:blink_test_browser_support",
"//content/test:content_test_mojo_bindings",
"//content/test:mojo_web_test_bindings",
......
# 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.
import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
jumbo_component("test_runner") {
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
}
defines = [ "TEST_RUNNER_IMPLEMENTATION" ]
sources = [
"accessibility_controller.cc",
"accessibility_controller.h",
"app_banner_service.cc",
"app_banner_service.h",
"event_sender.cc",
"event_sender.h",
"gamepad_controller.cc",
"gamepad_controller.h",
"gc_controller.cc",
"gc_controller.h",
"layout_dump.cc",
"layout_dump.h",
"mock_content_settings_client.cc",
"mock_content_settings_client.h",
"mock_grammar_check.cc",
"mock_grammar_check.h",
"mock_screen_orientation_client.cc",
"mock_screen_orientation_client.h",
"mock_spell_check.cc",
"mock_spell_check.h",
"mock_web_document_subresource_filter.cc",
"mock_web_document_subresource_filter.h",
"pixel_dump.cc",
"pixel_dump.h",
"spell_check_client.cc",
"spell_check_client.h",
"test_interfaces.cc",
"test_interfaces.h",
"test_plugin.cc",
"test_plugin.h",
"test_preferences.cc",
"test_preferences.h",
"test_runner.cc",
"test_runner.h",
"test_runner_export.h",
"test_runner_for_specific_view.cc",
"test_runner_for_specific_view.h",
"text_input_controller.cc",
"text_input_controller.h",
"tracked_dictionary.cc",
"tracked_dictionary.h",
"web_ax_object_proxy.cc",
"web_ax_object_proxy.h",
"web_frame_test_client.cc",
"web_frame_test_client.h",
"web_frame_test_proxy.cc",
"web_frame_test_proxy.h",
"web_test_delegate.h",
"web_test_runtime_flags.cc",
"web_test_runtime_flags.h",
"web_view_test_proxy.cc",
"web_view_test_proxy.h",
"web_widget_test_proxy.cc",
"web_widget_test_proxy.h",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
"//base:base",
"//base:i18n",
"//cc",
"//cc/paint",
"//components/viz/common",
"//content/public/common",
"//content/public/common:client_hints_mojom",
"//content/public/common:service_names",
"//content/public/renderer",
"//content/renderer:for_content_tests",
"//content/shell:client_hints_util",
"//content/shell:web_test_common",
"//device/base/synchronization",
"//device/gamepad/public/cpp:shared_with_blink",
"//device/gamepad/public/mojom",
"//gin",
"//gpu",
"//gpu/command_buffer/client:gles2_interface",
"//media/midi:mojo",
"//net",
"//printing",
"//services/device/public/mojom",
"//skia",
"//third_party/blink/public:blink",
"//third_party/blink/public:test_support",
"//ui/display",
"//ui/events:dom_keycode_converter",
"//ui/events:events_base",
"//ui/events/blink",
"//ui/gfx",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
"//url",
"//v8",
]
if (is_mac) {
libs = [ "AppKit.framework" ]
}
}
......@@ -9,7 +9,6 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/shell/test_runner/test_runner_export.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"
......@@ -25,7 +24,7 @@ namespace test_runner {
class WebViewTestProxy;
class TEST_RUNNER_EXPORT AccessibilityController {
class AccessibilityController {
public:
explicit AccessibilityController(WebViewTestProxy* web_view_test_proxy);
~AccessibilityController();
......
......@@ -10,7 +10,6 @@
#include "base/callback_forward.h"
#include "base/macros.h"
#include "content/shell/test_runner/test_runner_export.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/mojom/app_banner/app_banner.mojom.h"
......@@ -19,8 +18,7 @@ namespace test_runner {
// Test app banner service that is registered as a Mojo service for
// BeforeInstallPromptEvents to look up when the test runner is executed.
class TEST_RUNNER_EXPORT AppBannerService
: public blink::mojom::AppBannerService {
class AppBannerService : public blink::mojom::AppBannerService {
public:
AppBannerService();
~AppBannerService() override;
......
......@@ -17,7 +17,6 @@
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "content/shell/test_runner/test_runner_export.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#include "third_party/blink/public/common/input/web_touch_point.h"
......@@ -53,7 +52,7 @@ enum KeyLocationCode {
DOMKeyLocationNumpad = 0x03
};
class TEST_RUNNER_EXPORT EventSender {
class EventSender {
public:
explicit EventSender(WebWidgetTestProxy*);
virtual ~EventSender();
......
......@@ -13,7 +13,6 @@
#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"
......@@ -27,8 +26,7 @@ class WebLocalFrame;
namespace test_runner {
class TEST_RUNNER_EXPORT GamepadController
: public base::SupportsWeakPtr<GamepadController> {
class GamepadController : public base::SupportsWeakPtr<GamepadController> {
public:
GamepadController();
~GamepadController();
......
......@@ -7,7 +7,6 @@
#include <string>
#include "content/shell/test_runner/test_runner_export.h"
#include "content/shell/test_runner/web_test_runtime_flags.h"
namespace blink {
......@@ -18,7 +17,7 @@ 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,
std::string DumpLayout(blink::WebLocalFrame* frame,
const WebTestRuntimeFlags& flags);
} // namespace test_runner
......
......@@ -9,7 +9,6 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "content/shell/test_runner/test_runner_export.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
#include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
#include "services/device/public/mojom/screen_orientation.mojom.h"
......@@ -22,8 +21,7 @@ class WebLocalFrame;
namespace test_runner {
class TEST_RUNNER_EXPORT MockScreenOrientationClient
: public device::mojom::ScreenOrientation {
class MockScreenOrientationClient : public device::mojom::ScreenOrientation {
public:
explicit MockScreenOrientationClient();
~MockScreenOrientationClient() override;
......
......@@ -10,7 +10,6 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/shell/test_runner/test_runner_export.h"
namespace blink {
class WebLocalFrame;
......@@ -24,7 +23,7 @@ class TestRunner;
class WebTestDelegate;
class WebViewTestProxy;
class TEST_RUNNER_EXPORT TestInterfaces {
class TestInterfaces {
public:
TestInterfaces();
~TestInterfaces();
......
......@@ -5,14 +5,13 @@
#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 TEST_RUNNER_EXPORT TestPreferences {
struct TestPreferences {
int default_font_size;
int minimum_font_size;
bool allow_file_access_from_file_urls;
......
......@@ -20,7 +20,6 @@
#include "base/optional.h"
#include "base/strings/string16.h"
#include "content/shell/test_runner/mock_screen_orientation_client.h"
#include "content/shell/test_runner/test_runner_export.h"
#include "content/shell/test_runner/web_test_runtime_flags.h"
#include "third_party/blink/public/platform/web_effective_connection_type.h"
#include "third_party/skia/include/core/SkBitmap.h"
......@@ -72,7 +71,7 @@ class WebTestDelegate;
// - Tracking topLoadingFrame that can finish the test when it loads.
// - WorkQueue holding load requests from the TestInterfaces
// - WebTestRuntimeFlags
class TEST_RUNNER_EXPORT TestRunner {
class TestRunner {
public:
explicit TestRunner(TestInterfaces*);
virtual ~TestRunner();
......
// 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_
......@@ -13,7 +13,6 @@
#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/shell/test_runner/test_runner_export.h"
#include "v8/include/v8.h"
class SkBitmap;
......@@ -43,7 +42,7 @@ class WebViewTestProxy;
// - testRunner.capturePixelsAsyncThen
// - testRunner.setPageVisibility
// Note that "global" bindings are handled by TestRunner class.
class TEST_RUNNER_EXPORT TestRunnerForSpecificView {
class TestRunnerForSpecificView {
public:
explicit TestRunnerForSpecificView(WebViewTestProxy* web_view_test_proxy);
~TestRunnerForSpecificView();
......
......@@ -10,7 +10,6 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/shell/test_runner/test_runner_export.h"
namespace blink {
class WebInputMethodController;
......@@ -25,7 +24,7 @@ class WebViewTestProxy;
// TextInputController is bound to window.textInputController in Javascript
// when content_shell is running. Web tests use it to exercise various
// corners of text input.
class TEST_RUNNER_EXPORT TextInputController {
class TextInputController {
public:
explicit TextInputController(WebViewTestProxy* web_view_test_proxy);
~TextInputController();
......
......@@ -10,14 +10,13 @@
#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 TEST_RUNNER_EXPORT TrackedDictionary {
class TrackedDictionary {
public:
TrackedDictionary();
......
......@@ -11,7 +11,6 @@
#include "base/macros.h"
#include "content/renderer/render_frame_impl.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"
......@@ -27,7 +26,7 @@ namespace test_runner {
// WebFrameTestProxy is used during running web tests instead of a
// RenderFrameImpl to inject test-only behaviour by overriding methods in the
// base class.
class TEST_RUNNER_EXPORT WebFrameTestProxy : public content::RenderFrameImpl {
class WebFrameTestProxy : public content::RenderFrameImpl {
public:
template <typename... Args>
explicit WebFrameTestProxy(Args&&... args)
......
......@@ -10,7 +10,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/values.h"
#include "content/shell/test_runner/test_runner_export.h"
#include "content/shell/test_runner/tracked_dictionary.h"
namespace test_runner {
......@@ -18,7 +17,7 @@ namespace test_runner {
// WebTestRuntimeFlags stores flags controlled by web 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 TEST_RUNNER_EXPORT WebTestRuntimeFlags {
class WebTestRuntimeFlags {
public:
// Creates default flags (see also the Reset method).
WebTestRuntimeFlags();
......
......@@ -14,7 +14,6 @@
#include "build/build_config.h"
#include "content/renderer/render_view_impl.h"
#include "content/shell/test_runner/accessibility_controller.h"
#include "content/shell/test_runner/test_runner_export.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_widget_test_proxy.h"
......@@ -59,7 +58,7 @@ class WebTestDelegate;
// Historically, the overridden functionality has been small enough to not
// cause too much trouble. If that changes, then this entire testing
// architecture should be revisited.
class TEST_RUNNER_EXPORT WebViewTestProxy : public content::RenderViewImpl {
class WebViewTestProxy : public content::RenderViewImpl {
public:
template <typename... Args>
explicit WebViewTestProxy(Args&&... args)
......
......@@ -13,7 +13,6 @@
#include "base/memory/weak_ptr.h"
#include "content/renderer/render_widget.h"
#include "content/shell/test_runner/event_sender.h"
#include "content/shell/test_runner/test_runner_export.h"
#include "third_party/blink/public/web/web_widget_client.h"
namespace blink {
......@@ -51,7 +50,7 @@ class WebViewTestProxy;
// Historically, the overridden functionality has been small enough to not
// cause too much trouble. If that changes, then this entire testing
// architecture should be revisited.
class TEST_RUNNER_EXPORT WebWidgetTestProxy : public content::RenderWidget {
class WebWidgetTestProxy : public content::RenderWidget {
public:
template <typename... Args>
explicit WebWidgetTestProxy(Args&&... args)
......
......@@ -784,7 +784,6 @@ static_library("web_test_support_renderer") {
"//content/public/common",
"//content/public/renderer",
"//content/renderer:for_content_tests",
"//content/shell/test_runner:test_runner",
"//ui/events/blink",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment