Commit 4964f415 authored by danakj's avatar danakj Committed by Commit Bot

Stop using renderer/web_test/ from browser/web_test/.

This moves helper code that the browser uses over to the browser/
directory and removes the DEPS rules that were left to support this
violation.

R=avi@chromium.org

Bug: 866140
Change-Id: Ib49c7e5e6f64f34db87a73ef5368384ee73e1c19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2133876Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755921}
parent 07ee6a41
...@@ -13,8 +13,6 @@ include_rules = [ ...@@ -13,8 +13,6 @@ include_rules = [
# the ShellMainDelegate should inject it as appropriate. # the ShellMainDelegate should inject it as appropriate.
"+content/shell/browser/web_test", "+content/shell/browser/web_test",
"+content/shell/common/web_test/web_test_switches.h", "+content/shell/common/web_test/web_test_switches.h",
"+content/shell/renderer/web_test",
"+content/shell/test_runner/web_test_delegate.h",
] ]
specific_include_rules = { specific_include_rules = {
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
#include "content/shell/browser/web_test/web_test_first_device_bluetooth_chooser.h" #include "content/shell/browser/web_test/web_test_first_device_bluetooth_chooser.h"
#include "content/shell/common/web_test/web_test_string_util.h" #include "content/shell/common/web_test/web_test_string_util.h"
#include "content/shell/common/web_test/web_test_switches.h" #include "content/shell/common/web_test/web_test_switches.h"
#include "content/shell/renderer/web_test/blink_test_helpers.h"
#include "content/test/storage_partition_test_helpers.h" #include "content/test/storage_partition_test_helpers.h"
#include "mojo/public/cpp/bindings/sync_call_restrictions.h" #include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "services/network/public/cpp/features.h" #include "services/network/public/cpp/features.h"
...@@ -218,6 +217,64 @@ void DrawSelectionRect(const SkBitmap& bitmap, const blink::WebRect& wr) { ...@@ -218,6 +217,64 @@ void DrawSelectionRect(const SkBitmap& bitmap, const blink::WebRect& wr) {
canvas.drawIRect(rect, flags); canvas.drawIRect(rect, flags);
} }
// Applies settings that differ between web tests and regular mode. Some
// of the defaults are controlled via command line flags which are
// automatically set for web tests.
void ApplyWebTestDefaultPreferences(WebPreferences* prefs) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
prefs->allow_universal_access_from_file_urls = false;
prefs->dom_paste_enabled = true;
prefs->javascript_can_access_clipboard = true;
prefs->xslt_enabled = true;
prefs->application_cache_enabled = true;
prefs->tabs_to_links = false;
prefs->hyperlink_auditing_enabled = false;
prefs->allow_running_insecure_content = false;
prefs->disable_reading_from_canvas = false;
prefs->strict_mixed_content_checking = false;
prefs->strict_powerful_feature_restrictions = false;
prefs->webgl_errors_to_console_enabled = false;
prefs->enable_scroll_animator =
!command_line.HasSwitch(switches::kDisableSmoothScrolling);
prefs->minimum_logical_font_size = 9;
prefs->accelerated_2d_canvas_enabled =
command_line.HasSwitch(switches::kEnableAccelerated2DCanvas);
prefs->smart_insert_delete_enabled = true;
prefs->viewport_enabled = command_line.HasSwitch(switches::kEnableViewport);
prefs->default_minimum_page_scale_factor = 1.f;
prefs->default_maximum_page_scale_factor = 4.f;
prefs->presentation_receiver =
command_line.HasSwitch(switches::kForcePresentationReceiverForTesting);
prefs->translate_service_available = true;
#if defined(OS_MACOSX)
prefs->editing_behavior = EDITING_BEHAVIOR_MAC;
#else
prefs->editing_behavior = EDITING_BEHAVIOR_WIN;
#endif
#if defined(OS_MACOSX)
prefs->cursive_font_family_map[kCommonScript] =
base::ASCIIToUTF16("Apple Chancery");
prefs->fantasy_font_family_map[kCommonScript] = base::ASCIIToUTF16("Papyrus");
prefs->serif_font_family_map[kCommonScript] = base::ASCIIToUTF16("Times");
prefs->standard_font_family_map[kCommonScript] = base::ASCIIToUTF16("Times");
#else
prefs->cursive_font_family_map[kCommonScript] =
base::ASCIIToUTF16("Comic Sans MS");
prefs->fantasy_font_family_map[kCommonScript] = base::ASCIIToUTF16("Impact");
prefs->serif_font_family_map[kCommonScript] =
base::ASCIIToUTF16("times new roman");
prefs->standard_font_family_map[kCommonScript] =
base::ASCIIToUTF16("times new roman");
#endif
prefs->fixed_font_family_map[kCommonScript] = base::ASCIIToUTF16("Courier");
prefs->sans_serif_font_family_map[kCommonScript] =
base::ASCIIToUTF16("Helvetica");
}
} // namespace } // namespace
// BlinkTestResultPrinter ---------------------------------------------------- // BlinkTestResultPrinter ----------------------------------------------------
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "content/shell/browser/web_test/web_test_browser_main_platform_support.h" #include "content/shell/browser/web_test/web_test_browser_main_platform_support.h"
#include "content/shell/common/shell_switches.h" #include "content/shell/common/shell_switches.h"
#include "content/shell/common/web_test/web_test_switches.h" #include "content/shell/common/web_test/web_test_switches.h"
#include "content/shell/renderer/web_test/blink_test_helpers.h"
#include "gpu/config/gpu_switches.h" #include "gpu/config/gpu_switches.h"
#include "media/base/media_switches.h" #include "media/base/media_switches.h"
#include "net/base/filename_util.h" #include "net/base/filename_util.h"
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include "content/shell/common/blink_test.mojom.h" #include "content/shell/common/blink_test.mojom.h"
#include "content/shell/common/web_test/web_test_bluetooth_fake_adapter_setter.mojom.h" #include "content/shell/common/web_test/web_test_bluetooth_fake_adapter_setter.mojom.h"
#include "content/shell/common/web_test/web_test_switches.h" #include "content/shell/common/web_test/web_test_switches.h"
#include "content/shell/renderer/web_test/blink_test_helpers.h"
#include "content/test/data/mojo_web_test_helper_test.mojom.h" #include "content/test/data/mojo_web_test_helper_test.mojom.h"
#include "content/test/mock_badge_service.h" #include "content/test/mock_badge_service.h"
#include "content/test/mock_clipboard_host.h" #include "content/test/mock_clipboard_host.h"
......
...@@ -94,61 +94,7 @@ void ExportWebTestSpecificPreferences(const test_runner::TestPreferences& from, ...@@ -94,61 +94,7 @@ void ExportWebTestSpecificPreferences(const test_runner::TestPreferences& from,
to->spatial_navigation_enabled = from.spatial_navigation_enabled; to->spatial_navigation_enabled = from.spatial_navigation_enabled;
} }
// Applies settings that differ between web tests and regular mode. Some static base::FilePath GetBuildDirectory() {
// of the defaults are controlled via command line flags which are
// automatically set for web tests.
void ApplyWebTestDefaultPreferences(WebPreferences* prefs) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
prefs->allow_universal_access_from_file_urls = false;
prefs->dom_paste_enabled = true;
prefs->javascript_can_access_clipboard = true;
prefs->xslt_enabled = true;
#if defined(OS_MACOSX)
prefs->editing_behavior = EDITING_BEHAVIOR_MAC;
#else
prefs->editing_behavior = EDITING_BEHAVIOR_WIN;
#endif
prefs->application_cache_enabled = true;
prefs->tabs_to_links = false;
prefs->hyperlink_auditing_enabled = false;
prefs->allow_running_insecure_content = false;
prefs->disable_reading_from_canvas = false;
prefs->strict_mixed_content_checking = false;
prefs->strict_powerful_feature_restrictions = false;
prefs->webgl_errors_to_console_enabled = false;
prefs->enable_scroll_animator =
!command_line.HasSwitch(switches::kDisableSmoothScrolling);
base::string16 serif;
#if defined(OS_MACOSX)
prefs->cursive_font_family_map[kCommonScript] =
base::ASCIIToUTF16("Apple Chancery");
prefs->fantasy_font_family_map[kCommonScript] = base::ASCIIToUTF16("Papyrus");
serif = base::ASCIIToUTF16("Times");
#else
prefs->cursive_font_family_map[kCommonScript] =
base::ASCIIToUTF16("Comic Sans MS");
prefs->fantasy_font_family_map[kCommonScript] = base::ASCIIToUTF16("Impact");
serif = base::ASCIIToUTF16("times new roman");
#endif
prefs->serif_font_family_map[kCommonScript] = serif;
prefs->standard_font_family_map[kCommonScript] = serif;
prefs->fixed_font_family_map[kCommonScript] = base::ASCIIToUTF16("Courier");
prefs->sans_serif_font_family_map[kCommonScript] =
base::ASCIIToUTF16("Helvetica");
prefs->minimum_logical_font_size = 9;
prefs->accelerated_2d_canvas_enabled =
command_line.HasSwitch(switches::kEnableAccelerated2DCanvas);
prefs->smart_insert_delete_enabled = true;
prefs->viewport_enabled = command_line.HasSwitch(switches::kEnableViewport);
prefs->default_minimum_page_scale_factor = 1.f;
prefs->default_maximum_page_scale_factor = 4.f;
prefs->presentation_receiver =
command_line.HasSwitch(switches::kForcePresentationReceiverForTesting);
prefs->translate_service_available = true;
}
base::FilePath GetBuildDirectory() {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
if (base::mac::AmIBundled()) { if (base::mac::AmIBundled()) {
// If this is a bundled Content Shell.app, go up one from the outer bundle // If this is a bundled Content Shell.app, go up one from the outer bundle
......
...@@ -7,10 +7,6 @@ ...@@ -7,10 +7,6 @@
#include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/platform/web_url.h"
namespace base {
class FilePath;
}
namespace test_runner { namespace test_runner {
struct TestPreferences; struct TestPreferences;
} }
...@@ -24,12 +20,6 @@ struct WebPreferences; ...@@ -24,12 +20,6 @@ struct WebPreferences;
void ExportWebTestSpecificPreferences(const test_runner::TestPreferences& from, void ExportWebTestSpecificPreferences(const test_runner::TestPreferences& from,
WebPreferences* to); WebPreferences* to);
// Applies settings that differ between web tests and regular mode.
void ApplyWebTestDefaultPreferences(WebPreferences* prefs);
// The build directory of the Blink checkout.
base::FilePath GetBuildDirectory();
// Replaces file:///tmp/web_tests/ with the actual path to the // Replaces file:///tmp/web_tests/ with the actual path to the
// web_tests directory, or rewrite URLs generated from absolute // web_tests directory, or rewrite URLs generated from absolute
// path links in web-platform-tests. // path links in web-platform-tests.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment