0

Move test runner to a component

BUG=478250
R=mkwst@chromium.org,torne@chromium.org,jam@chromium.org

Review URL: https://codereview.chromium.org/1167703002

Cr-Commit-Position: refs/heads/master@{#332583}
This commit is contained in:
jochen
2015-06-03 03:01:46 -07:00
committed by Commit bot
parent d993e8ec7b
commit 73e711c4c6
109 changed files with 1278 additions and 1196 deletions
BUILD.gn
android_webview/tools
build
components
BUILD.gn
test_runner
BUILD.gnDEPSOWNERSaccessibility_controller.ccaccessibility_controller.happ_banner_client.ccapp_banner_client.hevent_sender.ccevent_sender.hgamepad_controller.ccgamepad_controller.h
helper
mock_color_chooser.ccmock_color_chooser.hmock_constraints.ccmock_constraints.hmock_credential_manager_client.ccmock_credential_manager_client.hmock_grammar_check.ccmock_grammar_check.hmock_screen_orientation_client.ccmock_screen_orientation_client.hmock_spell_check.ccmock_spell_check.hmock_web_audio_device.ccmock_web_audio_device.hmock_web_media_stream_center.ccmock_web_media_stream_center.hmock_web_midi_accessor.ccmock_web_midi_accessor.hmock_web_speech_recognizer.ccmock_web_speech_recognizer.hmock_web_theme_engine.ccmock_web_theme_engine.hmock_web_user_media_client.ccmock_web_user_media_client.hmock_webrtc_data_channel_handler.ccmock_webrtc_data_channel_handler.hmock_webrtc_dtmf_sender_handler.ccmock_webrtc_dtmf_sender_handler.hmock_webrtc_peer_connection_handler.ccmock_webrtc_peer_connection_handler.h
resources
spell_check_client.ccspell_check_client.htest_common.cctest_common.htest_interfaces.cctest_interfaces.htest_plugin.cctest_plugin.htest_preferences.cctest_preferences.htest_runner.cctest_runner.gyptest_runner.htext_input_controller.cctext_input_controller.hweb_ax_object_proxy.ccweb_ax_object_proxy.hweb_content_settings.ccweb_content_settings.hweb_frame_test_proxy.hweb_task.ccweb_task.hweb_test_delegate.hweb_test_interfaces.ccweb_test_interfaces.hweb_test_proxy.ccweb_test_proxy.hweb_test_runner.h
content

@ -748,8 +748,8 @@ if (!is_ios) {
if (is_win) {
deps += [
"//components/test_runner:layout_test_helper",
"//content/shell:crash_service",
"//content/shell:layout_test_helper",
]
}
@ -760,7 +760,7 @@ if (!is_ios) {
if (is_mac) {
deps += [
"//breakpad:dump_syms($host_toolchain)",
"//content/shell:layout_test_helper",
"//components/test_runner:layout_test_helper",
]
}

@ -201,3 +201,7 @@ content/browser/appcache/appcache_manifest_parser.h
content/child/multipart_response_delegate.h
# String 'copyright' used in code.
ui/webui/resources/js/cr/ui/array_data_model.js
# Copyright The Chromium Authors and Apple Inc; BSD license. This third-party
# code is taken from WebKit, the license for which we already pick up from
# webkit/.
components/test_runner/helper/layout_test_helper_mac.mm

@ -533,8 +533,8 @@
}],
['OS=="win"', {
'dependencies': [
'../components/test_runner/test_runner.gyp:layout_test_helper',
'../content/content_shell_and_tests.gyp:content_shell_crash_service',
'../content/content_shell_and_tests.gyp:layout_test_helper',
],
}],
['OS!="win" and OS!="android"', {
@ -544,8 +544,8 @@
}],
['OS=="mac"', {
'dependencies': [
'../components/test_runner/test_runner.gyp:layout_test_helper',
'../breakpad/breakpad.gyp:dump_syms#host',
'../content/content_shell_and_tests.gyp:layout_test_helper',
],
}],
['OS=="linux"', {
@ -1144,9 +1144,9 @@
'target_name': 'chromium_builder_lkgr_drmemory_win',
'type': 'none',
'dependencies': [
'../components/test_runner/test_runner.gyp:layout_test_helper',
'../content/content_shell_and_tests.gyp:content_shell',
'../content/content_shell_and_tests.gyp:content_shell_crash_service',
'../content/content_shell_and_tests.gyp:layout_test_helper',
],
},
{
@ -1166,10 +1166,10 @@
'../chrome_elf/chrome_elf.gyp:chrome_elf_unittests',
'../cloud_print/cloud_print.gyp:cloud_print_unittests',
'../components/components_tests.gyp:components_unittests',
'../components/test_runner/test_runner.gyp:layout_test_helper',
'../content/content_shell_and_tests.gyp:content_browsertests',
'../content/content_shell_and_tests.gyp:content_shell',
'../content/content_shell_and_tests.gyp:content_shell_crash_service',
'../content/content_shell_and_tests.gyp:layout_test_helper',
'../content/content_shell_and_tests.gyp:content_unittests',
'../courgette/courgette.gyp:courgette_unittests',
'../crypto/crypto.gyp:crypto_unittests',

@ -634,8 +634,8 @@
'../cloud_print/service/service.gyp:cloud_print_service_setup',
'../cloud_print/virtual_driver/win/install/virtual_driver_install.gyp:virtual_driver_setup',
'../cloud_print/virtual_driver/win/virtual_driver.gyp:gcp_portmon',
'../components/test_runner/test_runner.gyp:layout_test_helper',
'../content/content_shell_and_tests.gyp:content_shell_crash_service',
'../content/content_shell_and_tests.gyp:layout_test_helper',
'../gpu/gpu.gyp:angle_end2end_tests',
'../gpu/gpu.gyp:angle_perftests',
'../net/net.gyp:net_docs',

@ -242,6 +242,7 @@ group("all_components") {
"//components/guest_view/renderer",
"//components/safe_json_parser",
"//components/scheduler",
"//components/test_runner",
]
}

@ -0,0 +1,176 @@
# 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/ui.gni")
if (is_android) {
import("//build/config/android/config.gni")
}
static_library("test_runner") {
testonly = true
sources = [
"accessibility_controller.cc",
"accessibility_controller.h",
"app_banner_client.cc",
"app_banner_client.h",
"event_sender.cc",
"event_sender.h",
"gamepad_controller.cc",
"gamepad_controller.h",
"mock_color_chooser.cc",
"mock_color_chooser.h",
"mock_constraints.cc",
"mock_constraints.h",
"mock_credential_manager_client.cc",
"mock_credential_manager_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_audio_device.cc",
"mock_web_audio_device.h",
"mock_web_media_stream_center.cc",
"mock_web_media_stream_center.h",
"mock_web_midi_accessor.cc",
"mock_web_midi_accessor.h",
"mock_web_speech_recognizer.cc",
"mock_web_speech_recognizer.h",
"mock_web_theme_engine.cc",
"mock_web_theme_engine.h",
"mock_web_user_media_client.cc",
"mock_web_user_media_client.h",
"mock_webrtc_data_channel_handler.cc",
"mock_webrtc_data_channel_handler.h",
"mock_webrtc_dtmf_sender_handler.cc",
"mock_webrtc_dtmf_sender_handler.h",
"mock_webrtc_peer_connection_handler.cc",
"mock_webrtc_peer_connection_handler.h",
"spell_check_client.cc",
"spell_check_client.h",
"test_common.cc",
"test_common.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",
"text_input_controller.cc",
"text_input_controller.h",
"web_ax_object_proxy.cc",
"web_ax_object_proxy.h",
"web_content_settings.cc",
"web_content_settings.h",
"web_frame_test_proxy.h",
"web_task.cc",
"web_task.h",
"web_test_delegate.h",
"web_test_interfaces.cc",
"web_test_interfaces.h",
"web_test_proxy.cc",
"web_test_proxy.h",
"web_test_runner.h",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":resources",
"//base",
"//base:base_static",
"//cc",
"//gin",
"//skia",
"//third_party/WebKit/public:blink",
"//ui/events:events_base",
"//ui/gfx",
"//ui/gfx/geometry",
"//v8",
#'copy_test_netscape_plugin', TODO(GYP)
]
}
# Font copies.
if (!is_mac) {
copy("copy_ahem") {
visibility = [ ":*" ]
sources = [
"resources/fonts/AHEM____.TTF",
]
outputs = [
"$root_out_dir/AHEM____.TTF",
]
}
}
if (use_x11) {
copy("copy_x11_fonts") {
visibility = [ ":*" ]
sources = [
"//third_party/gardiner_mod/GardinerModBug.ttf",
"//third_party/gardiner_mod/GardinerModCat.ttf",
"resources/fonts/fonts.conf",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}
if (is_android) {
copy("copy_android_fonts") {
visibility = [ ":*" ]
sources = [
"resources/fonts/android_fallback_fonts.xml",
"resources/fonts/android_main_fonts.xml",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}
group("resources") {
deps = []
if (is_mac) {
# TODO(GYP) Mac bundle resources.
#'all_dependent_settings': {
# 'mac_bundle_resources': [
# 'resources/fonts/AHEM____.TTF',
# 'resources/fonts/ChromiumAATTest.ttf',
# '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
# '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
# ],
#},
} else {
deps += [ ":copy_ahem" ]
}
if (use_x11) {
deps += [ ":copy_x11_fonts" ]
}
if (is_android) {
deps += [ ":copy_android_fonts" ]
}
}
if (is_mac || is_win) {
# GYP version: components/test_runner/test_runner.gyp:layout_test_helper
executable("layout_test_helper") {
sources = [
"helper/layout_test_helper_mac.mm",
"helper/layout_test_helper_win.cc",
]
if (is_mac) {
libs = [ "AppKit.framework" ]
}
}
}

@ -0,0 +1,11 @@
include_rules = [
"+cc",
"+gin",
"+skia",
"+third_party/skia",
"+third_party/WebKit/public/platform",
"+third_party/WebKit/public/web",
"+ui/events",
"+ui/gfx",
"+v8/include",
]

@ -1,6 +1,8 @@
abarth@chromium.org
dmazzoni@chromium.org
dpranke@chromium.org
mkwst@chromium.org
pfeldman@chromium.org
rbyers@chromium.org
tkent@chromium.org
tommyw@chromium.org

@ -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/test_runner/accessibility_controller.h"
#include "components/test_runner/accessibility_controller.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"

@ -2,13 +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_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
#ifndef COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
#define COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
#include <vector>
#include "base/memory/weak_ptr.h"
#include "content/shell/renderer/test_runner/web_ax_object_proxy.h"
#include "components/test_runner/web_ax_object_proxy.h"
#include "third_party/WebKit/public/web/WebAXObject.h"
#include "v8/include/v8.h"
@ -72,4 +72,4 @@ class AccessibilityController :
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_
#endif // COMPONENTS_TEST_RUNNER_ACCESSIBILITY_CONTROLLER_H_

@ -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/test_runner/app_banner_client.h"
#include "components/test_runner/app_banner_client.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.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_TEST_RUNNER_APP_BANNER_CLIENT_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_APP_BANNER_CLIENT_H_
#ifndef COMPONENTS_TEST_RUNNER_APP_BANNER_CLIENT_H_
#define COMPONENTS_TEST_RUNNER_APP_BANNER_CLIENT_H_
#include "base/id_map.h"
#include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClient.h"
@ -32,4 +32,4 @@ class AppBannerClient : public blink::WebAppBannerClient {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_APP_BANNER_CLIENT_H_
#endif // COMPONENTS_TEST_RUNNER_APP_BANNER_CLIENT_H_

@ -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/test_runner/event_sender.h"
#include "components/test_runner/event_sender.h"
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "content/shell/renderer/test_runner/mock_spell_check.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "components/test_runner/mock_spell_check.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_proxy.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
#include "gin/wrappable.h"
@ -659,8 +659,10 @@ void EventSenderBindings::ReleaseTouchPoint(unsigned index) {
}
void EventSenderBindings::UpdateTouchPoint(unsigned index, double x, double y) {
if (sender_)
sender_->UpdateTouchPoint(index, static_cast<float>(x), static_cast<float>(y));
if (sender_) {
sender_->UpdateTouchPoint(index, static_cast<float>(x),
static_cast<float>(y));
}
}
void EventSenderBindings::CancelTouchPoint(unsigned index) {
@ -1490,7 +1492,8 @@ std::vector<std::string> EventSender::ContextClick() {
pressed_button_= WebMouseEvent::ButtonNone;
#endif
std::vector<std::string> menu_items = MakeMenuItemStringsFor(last_context_menu_data_.get(), delegate_);
std::vector<std::string> menu_items =
MakeMenuItemStringsFor(last_context_menu_data_.get(), delegate_);
last_context_menu_data_.reset();
return menu_items;
}

@ -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_TEST_RUNNER_EVENT_SENDER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_EVENT_SENDER_H_
#ifndef COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
#define COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
#include <queue>
#include <string>
@ -13,7 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/platform/WebDragData.h"
#include "third_party/WebKit/public/platform/WebPoint.h"
#include "third_party/WebKit/public/web/WebDragOperation.h"
@ -286,4 +286,4 @@ class EventSender : public base::SupportsWeakPtr<EventSender> {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_EVENT_SENDER_H_
#endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_

@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/shell/renderer/test_runner/gamepad_controller.h"
#include "components/test_runner/gamepad_controller.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_delegate.h"
#include "gin/arguments.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
@ -85,7 +85,8 @@ gin::ObjectTemplateBuilder GamepadControllerBindings::GetObjectTemplateBuilder(
return gin::Wrappable<GamepadControllerBindings>::GetObjectTemplateBuilder(
isolate)
.SetMethod("connect", &GamepadControllerBindings::Connect)
.SetMethod("dispatchConnected", &GamepadControllerBindings::DispatchConnected)
.SetMethod("dispatchConnected",
&GamepadControllerBindings::DispatchConnected)
.SetMethod("disconnect", &GamepadControllerBindings::Disconnect)
.SetMethod("setId", &GamepadControllerBindings::SetId)
.SetMethod("setButtonCount", &GamepadControllerBindings::SetButtonCount)

@ -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_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
#ifndef COMPONENTS_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
#define COMPONENTS_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
#include <map>
@ -64,4 +64,4 @@ class GamepadController : public base::SupportsWeakPtr<GamepadController> {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_GAMEPAD_CONTROLLER_H_
#endif // COMPONENTS_TEST_RUNNER_GAMEPAD_CONTROLLER_H_

@ -176,7 +176,8 @@ void InstallLayoutTestColorProfile() {
CMGetProfileByAVID((CMDisplayIDType)kCGDirectMainDisplay, &profile);
if (!error) {
UInt32 size = sizeof(initial_color_profile_location);
error = NCMGetProfileLocation(profile, &initial_color_profile_location, &size);
error =
NCMGetProfileLocation(profile, &initial_color_profile_location, &size);
CMCloseProfile(profile);
}
if (error) {

@ -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/test_runner/mock_color_chooser.h"
#include "components/test_runner/mock_color_chooser.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_proxy.h"
namespace content {

@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_COLOR_CHOOSER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_COLOR_CHOOSER_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_COLOR_CHOOSER_H_
#define COMPONENTS_TEST_RUNNER_MOCK_COLOR_CHOOSER_H_
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/web/WebColorChooser.h"
#include "third_party/WebKit/public/web/WebColorChooserClient.h"
@ -40,4 +40,4 @@ private:
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_COLOR_CHOOSER_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_COLOR_CHOOSER_H_

@ -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/test_runner/mock_constraints.h"
#include "components/test_runner/mock_constraints.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebString.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_TEST_RUNNER_MOCK_CONSTRAINTS_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_CONSTRAINTS_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_CONSTRAINTS_H_
#define COMPONENTS_TEST_RUNNER_MOCK_CONSTRAINTS_H_
namespace blink {
class WebMediaConstraints;
@ -20,4 +20,4 @@ class MockConstraints {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_CONSTRAINTS_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_CONSTRAINTS_H_

@ -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/test_runner/mock_credential_manager_client.h"
#include "components/test_runner/mock_credential_manager_client.h"
#include "third_party/WebKit/public/platform/WebCredential.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_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_
#define COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_
#include "base/memory/scoped_ptr.h"
#include "third_party/WebKit/public/platform/WebCredentialManagerClient.h"
@ -44,4 +44,4 @@ class MockCredentialManagerClient : public blink::WebCredentialManagerClient {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_CREDENTIAL_MANAGER_CLIENT_H_

@ -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/test_runner/mock_grammar_check.h"
#include "components/test_runner/mock_grammar_check.h"
#include <algorithm>
#include "base/logging.h"
#include "content/shell/renderer/test_runner/test_common.h"
#include "components/test_runner/test_common.h"
#include "third_party/WebKit/public/platform/WebCString.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebTextCheckingResult.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_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
#define COMPONENTS_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
#include <vector>
@ -27,4 +27,4 @@ class MockGrammarCheck {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_GRAMMAR_CHECK_H_

@ -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/test_runner/mock_screen_orientation_client.h"
#include "components/test_runner/mock_screen_orientation_client.h"
#include "base/bind.h"
#include "base/logging.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_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
#define COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
#include "base/macros.h"
#include "third_party/WebKit/public/platform/WebLockOrientationCallback.h"
@ -54,4 +54,4 @@ class MockScreenOrientationClient : public blink::WebScreenOrientationClient {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_SCREEN_ORIENTATION_CLIENT_H_

@ -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/test_runner/mock_spell_check.h"
#include "components/test_runner/mock_spell_check.h"
#include "base/logging.h"
#include "content/shell/renderer/test_runner/test_common.h"
#include "components/test_runner/test_common.h"
#include "third_party/WebKit/public/platform/WebCString.h"
namespace content {

@ -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_TEST_RUNNER_MOCK_SPELL_CHECK_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SPELL_CHECK_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_SPELL_CHECK_H_
#define COMPONENTS_TEST_RUNNER_MOCK_SPELL_CHECK_H_
#include <vector>
@ -72,4 +72,4 @@ class MockSpellCheck {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_SPELL_CHECK_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_SPELL_CHECK_H_

@ -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/test_runner/mock_web_audio_device.h"
#include "components/test_runner/mock_web_audio_device.h"
namespace content {

@ -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_TEST_RUNNER_MOCK_WEB_AUDIO_DEVICE_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_AUDIO_DEVICE_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_AUDIO_DEVICE_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEB_AUDIO_DEVICE_H_
#include "base/macros.h"
#include "third_party/WebKit/public/platform/WebAudioDevice.h"
@ -28,4 +28,4 @@ class MockWebAudioDevice : public blink::WebAudioDevice {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_AUDIO_DEVICE_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_AUDIO_DEVICE_H_

@ -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/test_runner/mock_web_media_stream_center.h"
#include "components/test_runner/mock_web_media_stream_center.h"
#include "base/logging.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebAudioDestinationConsumer.h"
#include "third_party/WebKit/public/platform/WebAudioSourceProvider.h"
#include "third_party/WebKit/public/platform/WebMediaStream.h"

@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_MEDIA_STREAM_CENTER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_MEDIA_STREAM_CENTER_H_
#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_MEDIA_STREAM_CENTER_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEB_MEDIA_STREAM_CENTER_H_
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
namespace blink {
class WebAudioSourceProvider;
@ -53,4 +52,4 @@ class MockWebMediaStreamCenter : public blink::WebMediaStreamCenter {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_MEDIA_STREAM_CENTER_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_MEDIA_STREAM_CENTER_H_

@ -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/test_runner/mock_web_midi_accessor.h"
#include "components/test_runner/mock_web_midi_accessor.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/test_runner.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "content/shell/renderer/test_runner/web_test_runner.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/test_runner.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_runner.h"
#include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h"
namespace content {

@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/platform/WebMIDIAccessor.h"
namespace blink {
@ -43,4 +43,4 @@ class MockWebMIDIAccessor : public blink::WebMIDIAccessor {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_MIDI_ACCESSOR_H_

@ -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/test_runner/mock_web_speech_recognizer.h"
#include "components/test_runner/mock_web_speech_recognizer.h"
#include "base/logging.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/web/WebSpeechRecognitionResult.h"
#include "third_party/WebKit/public/web/WebSpeechRecognizerClient.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_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_
#include <deque>
#include <vector>
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/web/WebSpeechRecognizer.h"
namespace blink {
@ -95,4 +95,4 @@ class MockWebSpeechRecognizer : public blink::WebSpeechRecognizer {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_

@ -0,0 +1,594 @@
// Copyright 2014 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 "components/test_runner/mock_web_theme_engine.h"
#if !defined(OS_MACOSX)
#include "base/logging.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/skia/include/core/SkRect.h"
using blink::WebCanvas;
using blink::WebColor;
using blink::WebRect;
using blink::WebThemeEngine;
namespace content {
namespace {
const SkColor edgeColor = SK_ColorBLACK;
const SkColor readOnlyColor = SkColorSetRGB(0xe9, 0xc2, 0xa6);
} // namespace
SkColor bgColors(WebThemeEngine::State state) {
switch (state) {
case WebThemeEngine::StateDisabled:
return SkColorSetRGB(0xc9, 0xc9, 0xc9);
case WebThemeEngine::StateHover:
return SkColorSetRGB(0x43, 0xf9, 0xff);
case WebThemeEngine::StateNormal:
return SkColorSetRGB(0x89, 0xc4, 0xff);
case WebThemeEngine::StatePressed:
return SkColorSetRGB(0xa9, 0xff, 0x12);
case WebThemeEngine::StateFocused:
return SkColorSetRGB(0x00, 0xf3, 0xac);
case WebThemeEngine::StateReadonly:
return SkColorSetRGB(0xf3, 0xe0, 0xd0);
default:
NOTREACHED();
}
return SkColorSetRGB(0x00, 0x00, 0xff);
}
blink::WebSize MockWebThemeEngine::getSize(WebThemeEngine::Part part) {
// FIXME: We use this constant to indicate we are being asked for the size of
// a part that we don't expect to be asked about. We return a garbage value
// rather than just asserting because this code doesn't have access to either
// WTF or base to raise an assertion or do any logging :(.
const blink::WebSize invalidPartSize = blink::WebSize(100, 100);
switch (part) {
case WebThemeEngine::PartScrollbarLeftArrow:
return blink::WebSize(17, 15);
case WebThemeEngine::PartScrollbarRightArrow:
return invalidPartSize;
case WebThemeEngine::PartScrollbarUpArrow:
return blink::WebSize(15, 17);
case WebThemeEngine::PartScrollbarDownArrow:
return invalidPartSize;
case WebThemeEngine::PartScrollbarHorizontalThumb:
return blink::WebSize(15, 15);
case WebThemeEngine::PartScrollbarVerticalThumb:
return blink::WebSize(15, 15);
case WebThemeEngine::PartScrollbarHorizontalTrack:
return blink::WebSize(0, 15);
case WebThemeEngine::PartScrollbarVerticalTrack:
return blink::WebSize(15, 0);
case WebThemeEngine::PartCheckbox:
case WebThemeEngine::PartRadio:
return blink::WebSize(13, 13);
case WebThemeEngine::PartSliderThumb:
return blink::WebSize(11, 21);
case WebThemeEngine::PartInnerSpinButton:
return blink::WebSize(15, 8);
default:
return invalidPartSize;
}
}
static SkIRect webRectToSkIRect(const WebRect& webRect) {
SkIRect irect;
irect.set(webRect.x, webRect.y, webRect.x + webRect.width - 1,
webRect.y + webRect.height - 1);
return irect;
}
static SkIRect validate(const SkIRect& rect, WebThemeEngine::Part part) {
switch (part) {
case WebThemeEngine::PartCheckbox:
case WebThemeEngine::PartRadio: {
SkIRect retval = rect;
// The maximum width and height is 13.
// Center the square in the passed rectangle.
const int maxControlSize = 13;
int controlSize = std::min(rect.width(), rect.height());
controlSize = std::min(controlSize, maxControlSize);
retval.fLeft = rect.fLeft + (rect.width() / 2) - (controlSize / 2);
retval.fRight = retval.fLeft + controlSize - 1;
retval.fTop = rect.fTop + (rect.height() / 2) - (controlSize / 2);
retval.fBottom = retval.fTop + controlSize - 1;
return retval;
}
default:
return rect;
}
}
void box(SkCanvas* canvas, const SkIRect& rect, SkColor fillColor) {
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setColor(fillColor);
canvas->drawIRect(rect, paint);
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawIRect(rect, paint);
}
void line(SkCanvas* canvas, int x0, int y0, int x1, int y1, SkColor color) {
SkPaint paint;
paint.setColor(color);
canvas->drawLine(SkIntToScalar(x0), SkIntToScalar(y0), SkIntToScalar(x1),
SkIntToScalar(y1), paint);
}
void triangle(SkCanvas* canvas,
int x0,
int y0,
int x1,
int y1,
int x2,
int y2,
SkColor color) {
SkPath path;
SkPaint paint;
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
path.incReserve(4);
path.moveTo(SkIntToScalar(x0), SkIntToScalar(y0));
path.lineTo(SkIntToScalar(x1), SkIntToScalar(y1));
path.lineTo(SkIntToScalar(x2), SkIntToScalar(y2));
path.close();
canvas->drawPath(path, paint);
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawPath(path, paint);
}
void roundRect(SkCanvas* canvas, SkIRect irect, SkColor color) {
SkRect rect;
SkScalar radius = SkIntToScalar(5);
SkPaint paint;
rect.set(irect);
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawRoundRect(rect, radius, radius, paint);
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawRoundRect(rect, radius, radius, paint);
}
void oval(SkCanvas* canvas, SkIRect irect, SkColor color) {
SkRect rect;
SkPaint paint;
rect.set(irect);
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawOval(rect, paint);
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawOval(rect, paint);
}
void circle(SkCanvas* canvas, SkIRect irect, SkScalar radius, SkColor color) {
int left = irect.fLeft;
int width = irect.width();
int height = irect.height();
int top = irect.fTop;
SkScalar cy = SkIntToScalar(top + height / 2);
SkScalar cx = SkIntToScalar(left + width / 2);
SkPaint paint;
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawCircle(cx, cy, radius, paint);
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawCircle(cx, cy, radius, paint);
}
void nestedBoxes(SkCanvas* canvas,
SkIRect irect,
int indentLeft,
int indentTop,
int indentRight,
int indentBottom,
SkColor outerColor,
SkColor innerColor) {
SkIRect lirect;
box(canvas, irect, outerColor);
lirect.set(irect.fLeft + indentLeft, irect.fTop + indentTop,
irect.fRight - indentRight, irect.fBottom - indentBottom);
box(canvas, lirect, innerColor);
}
void insetBox(SkCanvas* canvas,
SkIRect irect,
int indentLeft,
int indentTop,
int indentRight,
int indentBottom,
SkColor color) {
SkIRect lirect;
lirect.set(irect.fLeft + indentLeft, irect.fTop + indentTop,
irect.fRight - indentRight, irect.fBottom - indentBottom);
box(canvas, lirect, color);
}
void markState(SkCanvas* canvas, SkIRect irect, WebThemeEngine::State state) {
int left = irect.fLeft;
int right = irect.fRight;
int top = irect.fTop;
int bottom = irect.fBottom;
// The length of a triangle side for the corner marks.
const int triangleSize = 5;
switch (state) {
case WebThemeEngine::StateDisabled:
case WebThemeEngine::StateNormal:
// Don't visually mark these states (color is enough).
break;
case WebThemeEngine::StateReadonly: {
// The horizontal lines in a read only control are spaced by this amount.
const int readOnlyLineOffset = 5;
// Drawing lines across the control.
for (int i = top + readOnlyLineOffset; i < bottom;
i += readOnlyLineOffset)
line(canvas, left + 1, i, right - 1, i, readOnlyColor);
break;
}
case WebThemeEngine::StateHover:
// Draw a triangle in the upper left corner of the control. (Win's "hot")
triangle(canvas, left, top, left + triangleSize, top, left,
top + triangleSize, edgeColor);
break;
case WebThemeEngine::StateFocused:
// Draw a triangle in the bottom right corner of the control.
triangle(canvas, right, bottom, right - triangleSize, bottom, right,
bottom - triangleSize, edgeColor);
break;
case WebThemeEngine::StatePressed:
// Draw a triangle in the bottom left corner of the control.
triangle(canvas, left, bottom, left, bottom - triangleSize,
left + triangleSize, bottom, edgeColor);
break;
default:
// FIXME: Should we do something here to indicate that we got an invalid
// state?
// Unfortunately, we can't assert because we don't have access to WTF or
// base.
break;
}
}
void MockWebThemeEngine::paint(blink::WebCanvas* canvas,
WebThemeEngine::Part part,
WebThemeEngine::State state,
const blink::WebRect& rect,
const WebThemeEngine::ExtraParams* extraParams) {
SkIRect irect = webRectToSkIRect(rect);
SkPaint paint;
// Indent amounts for the check in a checkbox or radio button.
const int checkIndent = 3;
// Indent amounts for short and long sides of the scrollbar notches.
const int notchLongOffset = 1;
const int notchShortOffset = 4;
const int noOffset = 0;
// Indent amounts for the short and long sides of a scroll thumb box.
const int thumbLongIndent = 0;
const int thumbShortIndent = 2;
// Indents for the crosshatch on a scroll grip.
const int gripLongIndent = 3;
const int gripShortIndent = 5;
// Indents for the the slider track.
const int sliderIndent = 2;
int halfHeight = irect.height() / 2;
int halfWidth = irect.width() / 2;
int quarterHeight = irect.height() / 4;
int quarterWidth = irect.width() / 4;
int left = irect.fLeft;
int right = irect.fRight;
int top = irect.fTop;
int bottom = irect.fBottom;
switch (part) {
case WebThemeEngine::PartScrollbarDownArrow:
box(canvas, irect, bgColors(state));
triangle(canvas, left + quarterWidth, top + quarterHeight,
right - quarterWidth, top + quarterHeight, left + halfWidth,
bottom - quarterHeight, edgeColor);
markState(canvas, irect, state);
break;
case WebThemeEngine::PartScrollbarLeftArrow:
box(canvas, irect, bgColors(state));
triangle(canvas, right - quarterWidth, top + quarterHeight,
right - quarterWidth, bottom - quarterHeight,
left + quarterWidth, top + halfHeight, edgeColor);
break;
case WebThemeEngine::PartScrollbarRightArrow:
box(canvas, irect, bgColors(state));
triangle(canvas, left + quarterWidth, top + quarterHeight,
right - quarterWidth, top + halfHeight, left + quarterWidth,
bottom - quarterHeight, edgeColor);
break;
case WebThemeEngine::PartScrollbarUpArrow:
box(canvas, irect, bgColors(state));
triangle(canvas, left + quarterWidth, bottom - quarterHeight,
left + halfWidth, top + quarterHeight, right - quarterWidth,
bottom - quarterHeight, edgeColor);
markState(canvas, irect, state);
break;
case WebThemeEngine::PartScrollbarHorizontalThumb: {
// Draw a narrower box on top of the outside box.
nestedBoxes(canvas, irect, thumbLongIndent, thumbShortIndent,
thumbLongIndent, thumbShortIndent, bgColors(state),
bgColors(state));
// Draw a horizontal crosshatch for the grip.
int longOffset = halfWidth - gripLongIndent;
line(canvas, left + gripLongIndent, top + halfHeight,
right - gripLongIndent, top + halfHeight, edgeColor);
line(canvas, left + longOffset, top + gripShortIndent, left + longOffset,
bottom - gripShortIndent, edgeColor);
line(canvas, right - longOffset, top + gripShortIndent,
right - longOffset, bottom - gripShortIndent, edgeColor);
markState(canvas, irect, state);
break;
}
case WebThemeEngine::PartScrollbarVerticalThumb: {
// Draw a shorter box on top of the outside box.
nestedBoxes(canvas, irect, thumbShortIndent, thumbLongIndent,
thumbShortIndent, thumbLongIndent, bgColors(state),
bgColors(state));
// Draw a vertical crosshatch for the grip.
int longOffset = halfHeight - gripLongIndent;
line(canvas, left + halfWidth, top + gripLongIndent, left + halfWidth,
bottom - gripLongIndent, edgeColor);
line(canvas, left + gripShortIndent, top + longOffset,
right - gripShortIndent, top + longOffset, edgeColor);
line(canvas, left + gripShortIndent, bottom - longOffset,
right - gripShortIndent, bottom - longOffset, edgeColor);
markState(canvas, irect, state);
break;
}
case WebThemeEngine::PartScrollbarHorizontalTrack: {
int longOffset = halfHeight - notchLongOffset;
int shortOffset = irect.width() - notchShortOffset;
box(canvas, irect, bgColors(state));
// back, notch on right
insetBox(canvas, irect, noOffset, longOffset, shortOffset, longOffset,
edgeColor);
// forward, notch on right
insetBox(canvas, irect, shortOffset, longOffset, noOffset, longOffset,
edgeColor);
markState(canvas, irect, state);
break;
}
case WebThemeEngine::PartScrollbarVerticalTrack: {
int longOffset = halfWidth - notchLongOffset;
int shortOffset = irect.height() - notchShortOffset;
box(canvas, irect, bgColors(state));
// back, notch at top
insetBox(canvas, irect, longOffset, noOffset, longOffset, shortOffset,
edgeColor);
// forward, notch at bottom
insetBox(canvas, irect, longOffset, shortOffset, longOffset, noOffset,
edgeColor);
markState(canvas, irect, state);
break;
}
case WebThemeEngine::PartScrollbarCorner: {
SkIRect cornerRect = {rect.x, rect.y, rect.x + rect.width,
rect.y + rect.height};
paint.setColor(SK_ColorWHITE);
paint.setStyle(SkPaint::kFill_Style);
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
paint.setAntiAlias(true);
canvas->drawIRect(cornerRect, paint);
break;
}
case WebThemeEngine::PartCheckbox:
if (extraParams->button.indeterminate) {
nestedBoxes(canvas, irect, checkIndent, halfHeight, checkIndent,
halfHeight, bgColors(state), edgeColor);
} else if (extraParams->button.checked) {
irect = validate(irect, part);
nestedBoxes(canvas, irect, checkIndent, checkIndent, checkIndent,
checkIndent, bgColors(state), edgeColor);
} else {
irect = validate(irect, part);
box(canvas, irect, bgColors(state));
}
break;
case WebThemeEngine::PartRadio:
irect = validate(irect, part);
halfHeight = irect.height() / 2;
if (extraParams->button.checked) {
circle(canvas, irect, SkIntToScalar(halfHeight), bgColors(state));
circle(canvas, irect, SkIntToScalar(halfHeight - checkIndent),
edgeColor);
} else {
circle(canvas, irect, SkIntToScalar(halfHeight), bgColors(state));
}
break;
case WebThemeEngine::PartButton:
roundRect(canvas, irect, bgColors(state));
markState(canvas, irect, state);
break;
case WebThemeEngine::PartTextField:
paint.setColor(extraParams->textField.backgroundColor);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawIRect(irect, paint);
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawIRect(irect, paint);
markState(canvas, irect, state);
break;
case WebThemeEngine::PartMenuList:
if (extraParams->menuList.fillContentArea) {
box(canvas, irect, extraParams->menuList.backgroundColor);
} else {
SkPaint paint;
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawIRect(irect, paint);
}
// clip the drop-down arrow to be inside the select box
if (extraParams->menuList.arrowX - 4 > irect.fLeft)
irect.fLeft = extraParams->menuList.arrowX - 4;
if (extraParams->menuList.arrowX + 12 < irect.fRight)
irect.fRight = extraParams->menuList.arrowX + 12;
irect.fTop = extraParams->menuList.arrowY -
(extraParams->menuList.arrowHeight) / 2;
irect.fBottom = extraParams->menuList.arrowY +
(extraParams->menuList.arrowHeight - 1) / 2;
halfWidth = irect.width() / 2;
quarterWidth = irect.width() / 4;
if (state == WebThemeEngine::StateFocused) // FIXME: draw differenty?
state = WebThemeEngine::StateNormal;
box(canvas, irect, bgColors(state));
triangle(canvas, irect.fLeft + quarterWidth, irect.fTop,
irect.fRight - quarterWidth, irect.fTop, irect.fLeft + halfWidth,
irect.fBottom, edgeColor);
break;
case WebThemeEngine::PartSliderTrack: {
SkIRect lirect = irect;
// Draw a narrow rect for the track plus box hatches on the ends.
if (state == WebThemeEngine::StateFocused) // FIXME: draw differently?
state = WebThemeEngine::StateNormal;
if (extraParams->slider.vertical) {
lirect.inset(halfWidth - sliderIndent, noOffset);
box(canvas, lirect, bgColors(state));
line(canvas, left, top, right, top, edgeColor);
line(canvas, left, bottom, right, bottom, edgeColor);
} else {
lirect.inset(noOffset, halfHeight - sliderIndent);
box(canvas, lirect, bgColors(state));
line(canvas, left, top, left, bottom, edgeColor);
line(canvas, right, top, right, bottom, edgeColor);
}
break;
}
case WebThemeEngine::PartSliderThumb:
if (state == WebThemeEngine::StateFocused) // FIXME: draw differently?
state = WebThemeEngine::StateNormal;
oval(canvas, irect, bgColors(state));
break;
case WebThemeEngine::PartInnerSpinButton: {
// stack half-height up and down arrows on top of each other
SkIRect lirect;
int halfHeight = rect.height / 2;
if (extraParams->innerSpin.readOnly)
state = blink::WebThemeEngine::StateDisabled;
lirect.set(rect.x, rect.y, rect.x + rect.width - 1,
rect.y + halfHeight - 1);
box(canvas, lirect, bgColors(state));
bottom = lirect.fBottom;
quarterHeight = lirect.height() / 4;
triangle(canvas, left + quarterWidth, bottom - quarterHeight,
right - quarterWidth, bottom - quarterHeight, left + halfWidth,
top + quarterHeight, edgeColor);
lirect.set(rect.x, rect.y + halfHeight, rect.x + rect.width - 1,
rect.y + 2 * halfHeight - 1);
top = lirect.fTop;
bottom = lirect.fBottom;
quarterHeight = lirect.height() / 4;
box(canvas, lirect, bgColors(state));
triangle(canvas, left + quarterWidth, top + quarterHeight,
right - quarterWidth, top + quarterHeight, left + halfWidth,
bottom - quarterHeight, edgeColor);
markState(canvas, irect, state);
break;
}
case WebThemeEngine::PartProgressBar: {
paint.setColor(bgColors(state));
paint.setStyle(SkPaint::kFill_Style);
canvas->drawIRect(irect, paint);
// Emulate clipping
SkIRect tofill = irect;
if (extraParams->progressBar.determinate) {
tofill.set(extraParams->progressBar.valueRectX,
extraParams->progressBar.valueRectY,
extraParams->progressBar.valueRectX +
extraParams->progressBar.valueRectWidth - 1,
extraParams->progressBar.valueRectY +
extraParams->progressBar.valueRectHeight);
}
if (!tofill.intersect(irect))
tofill.setEmpty();
paint.setColor(edgeColor);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawIRect(tofill, paint);
markState(canvas, irect, state);
break;
}
default:
// FIXME: Should we do something here to indicate that we got an invalid
// part?
// Unfortunately, we can't assert because we don't have access to WTF or
// base.
break;
}
}
} // namespace content
#endif // !defined(OS_MACOSX)

@ -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_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
#include "third_party/WebKit/public/platform/WebThemeEngine.h"
@ -26,4 +26,4 @@ class MockWebThemeEngine : public blink::WebThemeEngine {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_THEME_ENGINE_H_

@ -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/test_runner/mock_web_user_media_client.h"
#include "components/test_runner/mock_web_user_media_client.h"
#include "base/logging.h"
#include "base/macros.h"
#include "content/shell/renderer/test_runner/mock_constraints.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/mock_constraints.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h"
#include "third_party/WebKit/public/platform/WebMediaStream.h"

@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
#include "base/macros.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/web/WebUserMediaClient.h"
namespace content {
@ -36,4 +36,4 @@ class MockWebUserMediaClient : public blink::WebUserMediaClient {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_

@ -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/test_runner/mock_webrtc_data_channel_handler.h"
#include "components/test_runner/mock_webrtc_data_channel_handler.h"
#include "base/logging.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h"
using namespace blink;

@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelHandlerClient.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h"
@ -59,4 +59,4 @@ class MockWebRTCDataChannelHandler : public blink::WebRTCDataChannelHandler {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DATA_CHANNEL_HANDLER_H_

@ -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/test_runner/mock_webrtc_dtmf_sender_handler.h"
#include "components/test_runner/mock_webrtc_dtmf_sender_handler.h"
#include "base/logging.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
#include "third_party/WebKit/public/platform/WebRTCDTMFSenderHandlerClient.h"

@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
#include "third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h"
#include "third_party/WebKit/public/platform/WebString.h"
@ -47,4 +47,4 @@ class MockWebRTCDTMFSenderHandler : public blink::WebRTCDTMFSenderHandler {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_DTMF_SENDER_HANDLER_H_

@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/shell/renderer/test_runner/mock_webrtc_peer_connection_handler.h"
#include "components/test_runner/mock_webrtc_peer_connection_handler.h"
#include "content/shell/renderer/test_runner/mock_constraints.h"
#include "content/shell/renderer/test_runner/mock_webrtc_data_channel_handler.h"
#include "content/shell/renderer/test_runner/mock_webrtc_dtmf_sender_handler.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/mock_constraints.h"
#include "components/test_runner/mock_webrtc_data_channel_handler.h"
#include "components/test_runner/mock_webrtc_dtmf_sender_handler.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebMediaStream.h"
#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"

@ -2,13 +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_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
#ifndef COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
#define COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
#include <map>
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h"
#include "third_party/WebKit/public/platform/WebRTCSessionDescription.h"
#include "third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h"
@ -100,4 +100,4 @@ class MockWebRTCPeerConnectionHandler
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
#endif // COMPONENTS_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_

@ -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/test_runner/spell_check_client.h"
#include "components/test_runner/spell_check_client.h"
#include "content/shell/renderer/test_runner/mock_grammar_check.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "components/test_runner/mock_grammar_check.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_proxy.h"
#include "third_party/WebKit/public/web/WebTextCheckingCompletion.h"
#include "third_party/WebKit/public/web/WebTextCheckingResult.h"

@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
#ifndef COMPONENTS_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
#define COMPONENTS_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/mock_spell_check.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/mock_spell_check.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/web/WebSpellCheckClient.h"
namespace content {
@ -62,4 +62,4 @@ class SpellCheckClient : public blink::WebSpellCheckClient {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELL_CHECK_CLIENT_H_
#endif // COMPONENTS_TEST_RUNNER_SPELL_CHECK_CLIENT_H_

@ -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/test_runner/test_common.h"
#include "components/test_runner/test_common.h"
namespace content {

@ -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_TEST_RUNNER_TEST_COMMON_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_COMMON_H_
#ifndef COMPONENTS_TEST_RUNNER_TEST_COMMON_H_
#define COMPONENTS_TEST_RUNNER_TEST_COMMON_H_
#include <string>
@ -21,4 +21,4 @@ std::string NormalizeLayoutTestURL(const std::string& url);
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_COMMON_H_
#endif // COMPONENTS_TEST_RUNNER_TEST_COMMON_H_

@ -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/test_runner/test_interfaces.h"
#include "components/test_runner/test_interfaces.h"
#include <string>
@ -11,13 +11,13 @@
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "content/shell/renderer/test_runner/accessibility_controller.h"
#include "content/shell/renderer/test_runner/app_banner_client.h"
#include "content/shell/renderer/test_runner/event_sender.h"
#include "content/shell/renderer/test_runner/gamepad_controller.h"
#include "content/shell/renderer/test_runner/test_runner.h"
#include "content/shell/renderer/test_runner/text_input_controller.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "components/test_runner/accessibility_controller.h"
#include "components/test_runner/app_banner_client.h"
#include "components/test_runner/event_sender.h"
#include "components/test_runner/gamepad_controller.h"
#include "components/test_runner/test_runner.h"
#include "components/test_runner/text_input_controller.h"
#include "components/test_runner/web_test_proxy.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebCache.h"
#include "third_party/WebKit/public/web/WebKit.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_TEST_RUNNER_TEST_INTERFACES_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_INTERFACES_H_
#ifndef COMPONENTS_TEST_RUNNER_TEST_INTERFACES_H_
#define COMPONENTS_TEST_RUNNER_TEST_INTERFACES_H_
#include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/shell/renderer/test_runner/mock_web_theme_engine.h"
#include "components/test_runner/mock_web_theme_engine.h"
#include "third_party/WebKit/public/platform/WebNonCopyable.h"
namespace blink {
@ -76,4 +76,4 @@ class TestInterfaces {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_INTERFACES_H_
#endif // COMPONENTS_TEST_RUNNER_TEST_INTERFACES_H_

@ -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/test_runner/test_plugin.h"
#include "components/test_runner/test_plugin.h"
#include "base/basictypes.h"
#include "base/bind.h"
@ -10,10 +10,7 @@
#include "base/memory/shared_memory.h"
#include "base/strings/stringprintf.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/Platform.h"
#include "third_party/WebKit/public/platform/WebCompositorSupport.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
@ -25,6 +22,9 @@
#include "third_party/WebKit/public/web/WebPluginParams.h"
#include "third_party/WebKit/public/web/WebTouchPoint.h"
#include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
namespace content {

@ -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_TEST_RUNNER_TEST_PLUGIN_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_
#ifndef COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_
#define COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_
#include <string>
@ -181,4 +181,4 @@ class TestPlugin : public blink::WebPlugin, public cc::TextureLayerClient {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_PLUGIN_H_
#endif // COMPONENTS_TEST_RUNNER_TEST_PLUGIN_H_

@ -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/common/test_runner/test_preferences.h"
#include "components/test_runner/test_preferences.h"
#include "build/build_config.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_COMMON_TEST_RUNNER_TEST_PREFERENCES_H_
#define CONTENT_SHELL_COMMON_TEST_RUNNER_TEST_PREFERENCES_H_
#ifndef COMPONENTS_TEST_RUNNER_TEST_PREFERENCES_H_
#define COMPONENTS_TEST_RUNNER_TEST_PREFERENCES_H_
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
@ -54,4 +54,4 @@ struct TestPreferences {
}
#endif // CONTENT_SHELL_COMMON_TEST_RUNNER_TEST_PREFERENCES_H_
#endif // COMPONENTS_TEST_RUNNER_TEST_PREFERENCES_H_

@ -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/test_runner/test_runner.h"
#include "components/test_runner/test_runner.h"
#include <limits>
#include "base/logging.h"
#include "content/shell/common/test_runner/test_preferences.h"
#include "content/shell/renderer/test_runner/mock_credential_manager_client.h"
#include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/web_content_settings.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "components/test_runner/mock_credential_manager_client.h"
#include "components/test_runner/mock_web_speech_recognizer.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/test_preferences.h"
#include "components/test_runner/web_content_settings.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_proxy.h"
#include "gin/arguments.h"
#include "gin/array_buffer.h"
#include "gin/handle.h"
@ -970,7 +970,8 @@ void TestRunnerBindings::SetMockDeviceOrientation(gin::Arguments* args) {
has_absolute, absolute);
}
void TestRunnerBindings::SetMockScreenOrientation(const std::string& orientation) {
void TestRunnerBindings::SetMockScreenOrientation(
const std::string& orientation) {
if (!runner_)
return;

@ -0,0 +1,196 @@
# 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.
{
'targets': [
{
# GN version: //components/test_runner:test_runner
'target_name': 'test_runner',
'type': 'static_library',
'variables': {
'chromium_code': 1,
},
'dependencies': [
'resources',
'../../base/base.gyp:base',
'../../base/base.gyp:base_static',
'../../cc/cc.gyp:cc',
'../../gin/gin.gyp:gin',
'../../skia/skia.gyp:skia',
'../../third_party/WebKit/public/blink.gyp:blink',
'../../ui/events/events.gyp:events_base',
'../../ui/gfx/gfx.gyp:gfx',
'../../ui/gfx/gfx.gyp:gfx_geometry',
'../../v8/tools/gyp/v8.gyp:v8',
],
'include_dirs': [
'..',
],
# Note: sources list duplicated in GN build.
'sources': [
'accessibility_controller.cc',
'accessibility_controller.h',
'app_banner_client.cc',
'app_banner_client.h',
'event_sender.cc',
'event_sender.h',
'gamepad_controller.cc',
'gamepad_controller.h',
'mock_color_chooser.cc',
'mock_color_chooser.h',
'mock_constraints.cc',
'mock_constraints.h',
'mock_credential_manager_client.cc',
'mock_credential_manager_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_audio_device.cc',
'mock_web_audio_device.h',
'mock_web_media_stream_center.cc',
'mock_web_media_stream_center.h',
'mock_web_midi_accessor.cc',
'mock_web_midi_accessor.h',
'mock_web_speech_recognizer.cc',
'mock_web_speech_recognizer.h',
'mock_web_theme_engine.cc',
'mock_web_theme_engine.h',
'mock_web_user_media_client.cc',
'mock_web_user_media_client.h',
'mock_webrtc_data_channel_handler.cc',
'mock_webrtc_data_channel_handler.h',
'mock_webrtc_dtmf_sender_handler.cc',
'mock_webrtc_dtmf_sender_handler.h',
'mock_webrtc_peer_connection_handler.cc',
'mock_webrtc_peer_connection_handler.h',
'spell_check_client.cc',
'spell_check_client.h',
'test_common.cc',
'test_common.h',
'test_interfaces.cc',
'test_interfaces.h',
'test_plugin.cc',
'test_plugin.h',
'test_runner.cc',
'test_runner.h',
'test_preferences.cc',
'test_preferences.h',
'text_input_controller.cc',
'text_input_controller.h',
'web_ax_object_proxy.cc',
'web_ax_object_proxy.h',
'web_content_settings.cc',
'web_content_settings.h',
'web_frame_test_proxy.h',
'web_task.cc',
'web_task.h',
'web_test_delegate.h',
'web_test_interfaces.cc',
'web_test_interfaces.h',
'web_test_proxy.cc',
'web_test_proxy.h',
'web_test_runner.h',
],
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
},
},
'conditions': [
['OS=="win" and win_use_allocator_shim==1', {
'dependencies': [
'../../base/allocator/allocator.gyp:allocator',
],
}],
['OS=="win"', {
'configurations': {
'Debug_Base': {
'msvs_settings': {
'VCLinkerTool': {
'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
},
},
},
},
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],
}], # OS=="win"
],
},
{
# GN version: //components/test_runner:resources
'target_name': 'resources',
'type': 'none',
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': ['resources/fonts/AHEM____.TTF'],
}],
}],
['OS=="mac"', {
'all_dependent_settings': {
'mac_bundle_resources': [
'resources/fonts/AHEM____.TTF',
'resources/fonts/ChromiumAATTest.ttf',
'<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
'<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
],
},
}],
['use_x11 == 1', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'resources/fonts/AHEM____.TTF',
'resources/fonts/fonts.conf',
'../../third_party/gardiner_mod/GardinerModBug.ttf',
'../../third_party/gardiner_mod/GardinerModCat.ttf',
]
}],
}],
['OS=="android"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'resources/fonts/AHEM____.TTF',
'resources/fonts/android_main_fonts.xml',
'resources/fonts/android_fallback_fonts.xml',
]
}],
}],
],
},
],
'conditions': [
['OS=="mac" or OS=="win"', {
'targets': [
{
# GN version: //components/test_runner:layout_test_helper
'target_name': 'layout_test_helper',
'type': 'executable',
'variables': {
'chromium_code': 1,
},
'sources': [
'helper/layout_test_helper_mac.mm',
'helper/layout_test_helper_win.cc',
],
'conditions': [
['OS=="mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
],
},
}],
],
},
],
}], # OS=="mac" or OS=="win"
]
}

@ -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_TEST_RUNNER_TEST_RUNNER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
#ifndef COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_
#define COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_
#include <deque>
#include <set>
@ -12,8 +12,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "content/shell/renderer/test_runner/web_test_runner.h"
#include "components/test_runner/web_task.h"
#include "components/test_runner/web_test_runner.h"
#include "v8/include/v8.h"
class GURL;
@ -824,4 +824,4 @@ class TestRunner : public WebTestRunner,
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
#endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_

@ -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/test_runner/text_input_controller.h"
#include "components/test_runner/text_input_controller.h"
#include "gin/arguments.h"
#include "gin/handle.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_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
#ifndef COMPONENTS_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
#define COMPONENTS_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
#include <string>
#include <vector>
@ -53,4 +53,4 @@ class TextInputController : public base::SupportsWeakPtr<TextInputController> {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_
#endif // COMPONENTS_TEST_RUNNER_TEXT_INPUT_CONTROLLER_H_

@ -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/test_runner/web_ax_object_proxy.h"
#include "components/test_runner/web_ax_object_proxy.h"
#include "base/strings/stringprintf.h"
#include "gin/handle.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_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
#define COMPONENTS_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
#include <string>
@ -191,4 +191,4 @@ class WebAXObjectProxyList : public WebAXObjectProxy::Factory {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_AX_OBJECT_PROXY_H_

@ -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/test_runner/web_content_settings.h"
#include "components/test_runner/web_content_settings.h"
#include "content/shell/renderer/test_runner/test_common.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "components/test_runner/test_common.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebCString.h"
#include "third_party/WebKit/public/platform/WebURL.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_TEST_RUNNER_WEB_CONTENT_SETTINGS_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_CONTENT_SETTINGS_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_CONTENT_SETTINGS_H_
#define COMPONENTS_TEST_RUNNER_WEB_CONTENT_SETTINGS_H_
#include "base/macros.h"
#include "third_party/WebKit/public/web/WebContentSettingsClient.h"
@ -64,4 +64,4 @@ class WebContentSettings : public blink::WebContentSettingsClient {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_CONTENT_SETTINGS_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_CONTENT_SETTINGS_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_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
#define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
#include "base/basictypes.h"
#include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/test_runner.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "components/test_runner/mock_screen_orientation_client.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/test_runner.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_proxy.h"
#include "third_party/WebKit/public/platform/WebString.h"
namespace content {
@ -289,4 +289,4 @@ class WebFrameTestProxy : public Base {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_

@ -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/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include <algorithm>

@ -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_TEST_RUNNER_WEB_TASK_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TASK_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_TASK_H_
#define COMPONENTS_TEST_RUNNER_WEB_TASK_H_
#include <vector>
@ -74,4 +74,4 @@ class WebMethodTask : public WebTask {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TASK_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_TASK_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_TEST_RUNNER_WEB_TEST_DELEGATE_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_DELEGATE_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_
#define COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_H_
#include <string>
#include <vector>
@ -261,4 +261,4 @@ class WebTestDelegate {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_DELEGATE_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_TEST_DELEGATE_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.
#include "content/shell/renderer/test_runner/web_test_interfaces.h"
#include "components/test_runner/web_test_interfaces.h"
#include "content/shell/renderer/test_runner/app_banner_client.h"
#include "content/shell/renderer/test_runner/mock_web_audio_device.h"
#include "content/shell/renderer/test_runner/mock_web_media_stream_center.h"
#include "content/shell/renderer/test_runner/mock_web_midi_accessor.h"
#include "content/shell/renderer/test_runner/mock_webrtc_peer_connection_handler.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/test_runner.h"
#include "components/test_runner/app_banner_client.h"
#include "components/test_runner/mock_web_audio_device.h"
#include "components/test_runner/mock_web_media_stream_center.h"
#include "components/test_runner/mock_web_midi_accessor.h"
#include "components/test_runner/mock_webrtc_peer_connection_handler.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/test_runner.h"
using namespace blink;

@ -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_TEST_RUNNER_WEB_TEST_INTERFACES_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_INTERFACES_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_
#define COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_
#include "base/memory/scoped_ptr.h"
@ -67,4 +67,4 @@ class WebTestInterfaces {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_INTERFACES_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_TEST_INTERFACES_H_

@ -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/test_runner/web_test_proxy.h"
#include "components/test_runner/web_test_proxy.h"
#include <cctype>
@ -13,20 +13,20 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "content/shell/renderer/test_runner/accessibility_controller.h"
#include "content/shell/renderer/test_runner/event_sender.h"
#include "content/shell/renderer/test_runner/mock_color_chooser.h"
#include "content/shell/renderer/test_runner/mock_credential_manager_client.h"
#include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
#include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
#include "content/shell/renderer/test_runner/mock_web_user_media_client.h"
#include "content/shell/renderer/test_runner/spell_check_client.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/test_plugin.h"
#include "content/shell/renderer/test_runner/test_runner.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "content/shell/renderer/test_runner/web_test_interfaces.h"
#include "content/shell/renderer/test_runner/web_test_runner.h"
#include "components/test_runner/accessibility_controller.h"
#include "components/test_runner/event_sender.h"
#include "components/test_runner/mock_color_chooser.h"
#include "components/test_runner/mock_credential_manager_client.h"
#include "components/test_runner/mock_screen_orientation_client.h"
#include "components/test_runner/mock_web_speech_recognizer.h"
#include "components/test_runner/mock_web_user_media_client.h"
#include "components/test_runner/spell_check_client.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/test_plugin.h"
#include "components/test_runner/test_runner.h"
#include "components/test_runner/web_test_delegate.h"
#include "components/test_runner/web_test_interfaces.h"
#include "components/test_runner/web_test_runner.h"
// FIXME: Including platform_canvas.h here is a layering violation.
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/Platform.h"
@ -638,8 +638,9 @@ void WebTestProxyBase::CapturePixelsAsync(
}
}
void WebTestProxyBase::DidCapturePixelsAsync(const base::Callback<void(const SkBitmap&)>& callback,
const SkBitmap& bitmap) {
void WebTestProxyBase::DidCapturePixelsAsync(
const base::Callback<void(const SkBitmap&)>& callback,
const SkBitmap& bitmap) {
SkCanvas canvas(bitmap);
DrawSelectionRect(&canvas);
if (!callback.is_null())

@ -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_TEST_RUNNER_WEB_TEST_PROXY_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
#define COMPONENTS_TEST_RUNNER_WEB_TEST_PROXY_H_
#include <deque>
#include <map>
@ -12,7 +12,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "components/test_runner/web_task.h"
#include "third_party/WebKit/public/platform/WebImage.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
@ -290,6 +290,12 @@ class WebTestProxyBase {
// override RenderViewImpl's getter and call a getter from WebTestProxyBase
// instead. In addition, WebTestProxyBase will have a public setter that
// could be called from the TestRunner.
#if defined(OS_WIN)
// WebTestProxy is a diamond-shaped hierarchy, with WebWidgetClient at the root.
// VS warns when we inherit the WebWidgetClient method implementations from
// RenderWidget. It's safe to ignore that warning.
#pragma warning(disable: 4250)
#endif
template <class Base, typename T>
class WebTestProxy : public Base, public WebTestProxyBase {
public:
@ -377,8 +383,8 @@ class WebTestProxy : public Base, public WebTestProxyBase {
base::string16 wrapped_main_text = main_message;
base::string16 wrapped_sub_text = sub_message;
Base::SetValidationMessageDirection(
&wrapped_main_text, main_message_hint, &wrapped_sub_text, sub_message_hint);
Base::SetValidationMessageDirection(&wrapped_main_text, main_message_hint,
&wrapped_sub_text, sub_message_hint);
WebTestProxyBase::ShowValidationMessage(
wrapped_main_text, wrapped_sub_text);
@ -398,4 +404,4 @@ class WebTestProxy : public Base, public WebTestProxyBase {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_PROXY_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_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_TEST_RUNNER_WEB_TEST_RUNNER_H_
#define CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_RUNNER_H_
#ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_
#define COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_
#include <vector>
@ -39,4 +39,4 @@ class WebTestRunner {
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_WEB_TEST_RUNNER_H_
#endif // COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_

@ -51,6 +51,7 @@
'../components/components.gyp:devtools_http_handler',
'../components/components.gyp:web_cache_renderer',
'../components/components.gyp:plugins_renderer',
'../components/test_runner/test_runner.gyp:test_runner',
'../device/bluetooth/bluetooth.gyp:device_bluetooth',
'../device/bluetooth/bluetooth.gyp:device_bluetooth_mocks',
'../gin/gin.gyp:gin',
@ -205,8 +206,6 @@
'shell/common/shell_switches.h',
'shell/common/shell_test_configuration.cc',
'shell/common/shell_test_configuration.h',
'shell/common/test_runner/test_preferences.cc',
'shell/common/test_runner/test_preferences.h',
'shell/common/v8_breakpad_support_win.cc',
'shell/common/v8_breakpad_support_win.h',
'shell/renderer/ipc_echo.cc',
@ -235,69 +234,6 @@
'shell/renderer/shell_content_renderer_client.h',
'shell/renderer/shell_render_view_observer.cc',
'shell/renderer/shell_render_view_observer.h',
'shell/renderer/test_runner/accessibility_controller.cc',
'shell/renderer/test_runner/accessibility_controller.h',
'shell/renderer/test_runner/app_banner_client.cc',
'shell/renderer/test_runner/app_banner_client.h',
'shell/renderer/test_runner/event_sender.cc',
'shell/renderer/test_runner/event_sender.h',
'shell/renderer/test_runner/gamepad_controller.cc',
'shell/renderer/test_runner/gamepad_controller.h',
'shell/renderer/test_runner/mock_color_chooser.cc',
'shell/renderer/test_runner/mock_color_chooser.h',
'shell/renderer/test_runner/mock_constraints.cc',
'shell/renderer/test_runner/mock_constraints.h',
'shell/renderer/test_runner/mock_credential_manager_client.cc',
'shell/renderer/test_runner/mock_credential_manager_client.h',
'shell/renderer/test_runner/mock_grammar_check.cc',
'shell/renderer/test_runner/mock_grammar_check.h',
'shell/renderer/test_runner/mock_screen_orientation_client.cc',
'shell/renderer/test_runner/mock_screen_orientation_client.h',
'shell/renderer/test_runner/mock_spell_check.cc',
'shell/renderer/test_runner/mock_spell_check.h',
'shell/renderer/test_runner/mock_web_audio_device.cc',
'shell/renderer/test_runner/mock_web_audio_device.h',
'shell/renderer/test_runner/mock_web_media_stream_center.cc',
'shell/renderer/test_runner/mock_web_media_stream_center.h',
'shell/renderer/test_runner/mock_web_midi_accessor.cc',
'shell/renderer/test_runner/mock_web_midi_accessor.h',
'shell/renderer/test_runner/mock_web_speech_recognizer.cc',
'shell/renderer/test_runner/mock_web_speech_recognizer.h',
'shell/renderer/test_runner/mock_web_theme_engine.cc',
'shell/renderer/test_runner/mock_web_theme_engine.h',
'shell/renderer/test_runner/mock_web_user_media_client.cc',
'shell/renderer/test_runner/mock_web_user_media_client.h',
'shell/renderer/test_runner/mock_webrtc_data_channel_handler.cc',
'shell/renderer/test_runner/mock_webrtc_data_channel_handler.h',
'shell/renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc',
'shell/renderer/test_runner/mock_webrtc_dtmf_sender_handler.h',
'shell/renderer/test_runner/mock_webrtc_peer_connection_handler.cc',
'shell/renderer/test_runner/mock_webrtc_peer_connection_handler.h',
'shell/renderer/test_runner/spell_check_client.cc',
'shell/renderer/test_runner/spell_check_client.h',
'shell/renderer/test_runner/test_common.cc',
'shell/renderer/test_runner/test_common.h',
'shell/renderer/test_runner/test_interfaces.cc',
'shell/renderer/test_runner/test_interfaces.h',
'shell/renderer/test_runner/test_plugin.cc',
'shell/renderer/test_runner/test_plugin.h',
'shell/renderer/test_runner/test_runner.cc',
'shell/renderer/test_runner/test_runner.h',
'shell/renderer/test_runner/text_input_controller.cc',
'shell/renderer/test_runner/text_input_controller.h',
'shell/renderer/test_runner/web_ax_object_proxy.cc',
'shell/renderer/test_runner/web_ax_object_proxy.h',
'shell/renderer/test_runner/web_content_settings.cc',
'shell/renderer/test_runner/web_content_settings.h',
'shell/renderer/test_runner/web_frame_test_proxy.h',
'shell/renderer/test_runner/web_task.cc',
'shell/renderer/test_runner/web_task.h',
'shell/renderer/test_runner/web_test_delegate.h',
'shell/renderer/test_runner/web_test_interfaces.cc',
'shell/renderer/test_runner/web_test_interfaces.h',
'shell/renderer/test_runner/web_test_proxy.cc',
'shell/renderer/test_runner/web_test_proxy.h',
'shell/renderer/test_runner/web_test_runner.h',
],
'msvs_settings': {
'VCLinkerTool': {
@ -423,6 +359,9 @@
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content',
},
'dependencies': [
'../components/test_runner/test_runner.gyp:resources',
],
'actions': [
{
'action_name': 'generate_content_shell_resources',
@ -441,45 +380,6 @@
],
},
],
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': ['shell/renderer/test_runner/resources/fonts/AHEM____.TTF'],
}],
}],
['OS=="mac"', {
'all_dependent_settings': {
'mac_bundle_resources': [
'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
'<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
'<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
],
},
}],
['use_x11 == 1', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
'shell/renderer/test_runner/resources/fonts/fonts.conf',
'../third_party/gardiner_mod/GardinerModBug.ttf',
'../third_party/gardiner_mod/GardinerModCat.ttf',
]
}],
}],
['OS=="android"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
'shell/renderer/test_runner/resources/fonts/android_main_fonts.xml',
'shell/renderer/test_runner/resources/fonts/android_fallback_fonts.xml',
]
}],
}],
],
},
{
# We build a minimal set of resources so WebKit in content_shell has
@ -808,28 +708,6 @@
}
],
'conditions': [
['OS=="mac" or OS=="win"', {
'targets': [
{
# GN version: //content/shell:layout_test_helper
'target_name': 'layout_test_helper',
'type': 'executable',
'sources': [
'shell/renderer/test_runner/helper/layout_test_helper_mac.mm',
'shell/renderer/test_runner/helper/layout_test_helper_win.cc',
],
'conditions': [
['OS=="mac"', {
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
],
},
}],
],
},
],
}], # OS=="mac" or OS=="win"
['OS=="mac"', {
'targets': [
{

@ -765,6 +765,7 @@
'dependencies': [
'content.gyp:content_renderer',
'test_support_content',
'../components/test_runner/test_runner.gyp:test_runner',
'../skia/skia.gyp:skia',
'../ui/accessibility/accessibility.gyp:ax_gen',
'../ui/base/ime/ui_base_ime.gyp:ui_base_ime',

@ -485,7 +485,7 @@ WebMouseWheelEvent* BuildMouseWheelEvent(const InputEventData& event) {
#endif
// Convert a character string to a Windows virtual key code. Adapted from
// src/content/shell/renderer/test_runner/event_sender.cc. This
// src/components/test_runner/event_sender.cc. This
// is used by CreateSimulatedWebInputEvents to convert keyboard events.
void GetKeyCode(const std::string& char_text,
WebUChar* code,
@ -632,7 +632,7 @@ WebInputEvent* CreateWebInputEvent(const InputEventData& event) {
}
// Generate a coherent sequence of input events to simulate a user event.
// From src/content/shell/renderer/test_runner/event_sender.cc.
// From src/components/test_runner/event_sender.cc.
std::vector<linked_ptr<WebInputEvent> > CreateSimulatedWebInputEvents(
const ppapi::InputEventData& event,
int plugin_x,

@ -144,8 +144,6 @@ static_library("content_shell_lib") {
"common/shell_switches.h",
"common/shell_test_configuration.cc",
"common/shell_test_configuration.h",
"common/test_runner/test_preferences.cc",
"common/test_runner/test_preferences.h",
"renderer/ipc_echo.cc",
"renderer/ipc_echo.h",
"renderer/layout_test/blink_test_helpers.cc",
@ -172,69 +170,6 @@ static_library("content_shell_lib") {
"renderer/shell_content_renderer_client.h",
"renderer/shell_render_view_observer.cc",
"renderer/shell_render_view_observer.h",
"renderer/test_runner/accessibility_controller.cc",
"renderer/test_runner/accessibility_controller.h",
"renderer/test_runner/app_banner_client.cc",
"renderer/test_runner/app_banner_client.h",
"renderer/test_runner/event_sender.cc",
"renderer/test_runner/event_sender.h",
"renderer/test_runner/gamepad_controller.cc",
"renderer/test_runner/gamepad_controller.h",
"renderer/test_runner/mock_color_chooser.cc",
"renderer/test_runner/mock_color_chooser.h",
"renderer/test_runner/mock_constraints.cc",
"renderer/test_runner/mock_constraints.h",
"renderer/test_runner/mock_credential_manager_client.cc",
"renderer/test_runner/mock_credential_manager_client.h",
"renderer/test_runner/mock_grammar_check.cc",
"renderer/test_runner/mock_grammar_check.h",
"renderer/test_runner/mock_screen_orientation_client.cc",
"renderer/test_runner/mock_screen_orientation_client.h",
"renderer/test_runner/mock_spell_check.cc",
"renderer/test_runner/mock_spell_check.h",
"renderer/test_runner/mock_web_audio_device.cc",
"renderer/test_runner/mock_web_audio_device.h",
"renderer/test_runner/mock_web_media_stream_center.cc",
"renderer/test_runner/mock_web_media_stream_center.h",
"renderer/test_runner/mock_web_midi_accessor.cc",
"renderer/test_runner/mock_web_midi_accessor.h",
"renderer/test_runner/mock_web_speech_recognizer.cc",
"renderer/test_runner/mock_web_speech_recognizer.h",
"renderer/test_runner/mock_web_theme_engine.cc",
"renderer/test_runner/mock_web_theme_engine.h",
"renderer/test_runner/mock_web_user_media_client.cc",
"renderer/test_runner/mock_web_user_media_client.h",
"renderer/test_runner/mock_webrtc_data_channel_handler.cc",
"renderer/test_runner/mock_webrtc_data_channel_handler.h",
"renderer/test_runner/mock_webrtc_dtmf_sender_handler.cc",
"renderer/test_runner/mock_webrtc_dtmf_sender_handler.h",
"renderer/test_runner/mock_webrtc_peer_connection_handler.cc",
"renderer/test_runner/mock_webrtc_peer_connection_handler.h",
"renderer/test_runner/spell_check_client.cc",
"renderer/test_runner/spell_check_client.h",
"renderer/test_runner/test_common.cc",
"renderer/test_runner/test_common.h",
"renderer/test_runner/test_interfaces.cc",
"renderer/test_runner/test_interfaces.h",
"renderer/test_runner/test_plugin.cc",
"renderer/test_runner/test_plugin.h",
"renderer/test_runner/test_runner.cc",
"renderer/test_runner/test_runner.h",
"renderer/test_runner/text_input_controller.cc",
"renderer/test_runner/text_input_controller.h",
"renderer/test_runner/web_ax_object_proxy.cc",
"renderer/test_runner/web_ax_object_proxy.h",
"renderer/test_runner/web_content_settings.cc",
"renderer/test_runner/web_content_settings.h",
"renderer/test_runner/web_frame_test_proxy.h",
"renderer/test_runner/web_task.cc",
"renderer/test_runner/web_task.h",
"renderer/test_runner/web_test_delegate.h",
"renderer/test_runner/web_test_interfaces.cc",
"renderer/test_runner/web_test_interfaces.h",
"renderer/test_runner/web_test_proxy.cc",
"renderer/test_runner/web_test_proxy.h",
"renderer/test_runner/web_test_runner.h",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
@ -262,6 +197,7 @@ static_library("content_shell_lib") {
"//components/devtools_discovery",
"//components/devtools_http_handler",
"//components/plugins/renderer",
"//components/test_runner:test_runner",
"//components/web_cache/renderer",
"//content:resources",
"//content/app/resources",
@ -406,70 +342,13 @@ copy("copy_shell_resources") {
]
}
# Font copies.
if (!is_mac) {
copy("copy_ahem") {
visibility = [ ":*" ]
sources = [
"renderer/test_runner/resources/fonts/AHEM____.TTF",
]
outputs = [
"$root_out_dir/AHEM____.TTF",
]
}
}
if (use_x11) {
copy("copy_x11_fonts") {
visibility = [ ":*" ]
sources = [
"//third_party/gardiner_mod/GardinerModBug.ttf",
"//third_party/gardiner_mod/GardinerModCat.ttf",
"renderer/test_runner/resources/fonts/fonts.conf",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}
if (is_android) {
copy("copy_android_fonts") {
visibility = [ ":*" ]
sources = [
"renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
"renderer/test_runner/resources/fonts/android_main_fonts.xml",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
}
}
group("resources") {
public_deps = [
":copy_shell_resources",
]
deps = []
if (is_mac) {
# TODO(GYP) Mac bundle resources.
#'all_dependent_settings': {
# 'mac_bundle_resources': [
# 'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
# 'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
# '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
# '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
# ],
#},
} else {
deps += [ ":copy_ahem" ]
}
if (use_x11) {
deps += [ ":copy_x11_fonts" ]
}
if (is_android) {
deps += [ ":copy_android_fonts" ]
}
deps = [
"//components/test_runner:resources",
]
}
repack("pak") {
@ -556,20 +435,6 @@ if (!is_android && !is_mac) {
}
}
if (is_mac || is_win) {
# GYP version: content/content_shell_and_tests.gyp:layout_test_helper
executable("layout_test_helper") {
sources = [
"renderer/test_runner/helper/layout_test_helper_mac.mm",
"renderer/test_runner/helper/layout_test_helper_win.cc",
]
if (is_mac) {
libs = [ "AppKit.framework" ]
}
}
}
if (is_win) {
# GYP version: content/content_shell_and_tests.gyp:content_shell_crash_service
executable("crash_service") {

@ -1,3 +1,4 @@
include_rules = [
"+components/test_runner",
"+gin/public",
]

@ -1,4 +0,0 @@
include_rules = [
"-content",
"+content/shell/common/test_runner",
]

@ -2,5 +2,6 @@ include_rules = [
"+gin",
"+components/web_cache/renderer",
"+components/plugins/renderer",
"+components/test_runner",
"+media",
]

@ -9,10 +9,10 @@
#include "base/path_service.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "components/test_runner/test_preferences.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/web_preferences.h"
#include "content/shell/common/shell_switches.h"
#include "content/shell/common/test_runner/test_preferences.h"
namespace content {

@ -21,6 +21,14 @@
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "components/test_runner/app_banner_client.h"
#include "components/test_runner/gamepad_controller.h"
#include "components/test_runner/mock_screen_orientation_client.h"
#include "components/test_runner/test_interfaces.h"
#include "components/test_runner/web_task.h"
#include "components/test_runner/web_test_interfaces.h"
#include "components/test_runner/web_test_proxy.h"
#include "components/test_runner/web_test_runner.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
@ -37,14 +45,6 @@
#include "content/shell/renderer/layout_test/layout_test_render_process_observer.h"
#include "content/shell/renderer/layout_test/leak_detector.h"
#include "content/shell/renderer/layout_test/test_plugin_placeholder.h"
#include "content/shell/renderer/test_runner/app_banner_client.h"
#include "content/shell/renderer/test_runner/gamepad_controller.h"
#include "content/shell/renderer/test_runner/mock_screen_orientation_client.h"
#include "content/shell/renderer/test_runner/test_interfaces.h"
#include "content/shell/renderer/test_runner/web_task.h"
#include "content/shell/renderer/test_runner/web_test_interfaces.h"
#include "content/shell/renderer/test_runner/web_test_proxy.h"
#include "content/shell/renderer/test_runner/web_test_runner.h"
#include "net/base/filename_util.h"
#include "net/base/net_errors.h"
#include "skia/ext/platform_canvas.h"

@ -9,12 +9,12 @@
#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "components/test_runner/test_preferences.h"
#include "components/test_runner/web_test_delegate.h"
#include "content/public/common/page_state.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/public/renderer/render_view_observer_tracker.h"
#include "content/shell/common/shell_test_configuration.h"
#include "content/shell/common/test_runner/test_preferences.h"
#include "content/shell/renderer/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
#include "v8/include/v8.h"

Some files were not shown because too many files have changed in this diff Show More