summaryrefslogtreecommitdiffstats
path: root/content/shell/common
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 21:35:01 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 21:35:01 +0000
commit1f70cfa4d7521254f316ac0a64c8a7b5d0940257 (patch)
tree8fabadee31e4c6a2d7e857cbbc1945f1dcc70061 /content/shell/common
parenta7666d85850ff87482cd73de4aa5f26886c0f214 (diff)
downloadchromium_src-1f70cfa4d7521254f316ac0a64c8a7b5d0940257.zip
chromium_src-1f70cfa4d7521254f316ac0a64c8a7b5d0940257.tar.gz
chromium_src-1f70cfa4d7521254f316ac0a64c8a7b5d0940257.tar.bz2
Update content/shell/common/test_runner to chromium coding style
BUG=331299 TBR=maruel@chromium.org R=marja@chromium.org Review URL: https://codereview.chromium.org/225543003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/common')
-rw-r--r--content/shell/common/test_runner/WebPreferences.cpp55
-rw-r--r--content/shell/common/test_runner/WebPreferences.h53
-rw-r--r--content/shell/common/test_runner/test_preferences.cc54
-rw-r--r--content/shell/common/test_runner/test_preferences.h53
-rw-r--r--content/shell/common/webkit_test_helpers.cc53
-rw-r--r--content/shell/common/webkit_test_helpers.h8
6 files changed, 137 insertions, 139 deletions
diff --git a/content/shell/common/test_runner/WebPreferences.cpp b/content/shell/common/test_runner/WebPreferences.cpp
deleted file mode 100644
index d512e79..0000000
--- a/content/shell/common/test_runner/WebPreferences.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/shell/common/test_runner/WebPreferences.h"
-
-using namespace blink;
-
-namespace WebTestRunner {
-
-WebPreferences::WebPreferences()
-{
- reset();
-}
-
-void WebPreferences::reset()
-{
- defaultFontSize = 16;
- minimumFontSize = 0;
- DOMPasteAllowed = true;
- XSSAuditorEnabled = false;
- allowDisplayOfInsecureContent = true;
- allowFileAccessFromFileURLs = true;
- allowRunningOfInsecureContent = true;
- defaultTextEncodingName = WebString::fromUTF8("ISO-8859-1");
- experimentalWebGLEnabled = false;
- experimentalCSSRegionsEnabled = true;
- experimentalCSSGridLayoutEnabled = true;
- javaEnabled = false;
- javaScriptCanAccessClipboard = true;
- javaScriptCanOpenWindowsAutomatically = true;
- supportsMultipleWindows = true;
- javaScriptEnabled = true;
- loadsImagesAutomatically = true;
- offlineWebApplicationCacheEnabled = true;
- pluginsEnabled = true;
- caretBrowsingEnabled = false;
-
- // Allow those layout tests running as local files, i.e. under
- // LayoutTests/http/tests/local, to access http server.
- allowUniversalAccessFromFileURLs = true;
-
-#ifdef __APPLE__
- editingBehavior = WebSettings::EditingBehaviorMac;
-#else
- editingBehavior = WebSettings::EditingBehaviorWin;
-#endif
-
- tabsToLinks = false;
- hyperlinkAuditingEnabled = false;
- shouldRespectImageOrientation = false;
- asynchronousSpellCheckingEnabled = false;
-}
-
-}
diff --git a/content/shell/common/test_runner/WebPreferences.h b/content/shell/common/test_runner/WebPreferences.h
deleted file mode 100644
index f706087..0000000
--- a/content/shell/common/test_runner/WebPreferences.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_SHELL_COMMON_TEST_RUNNER_WEBPREFERENCES_H_
-#define CONTENT_SHELL_COMMON_TEST_RUNNER_WEBPREFERENCES_H_
-
-#include "third_party/WebKit/public/platform/WebString.h"
-#include "third_party/WebKit/public/platform/WebURL.h"
-#include "third_party/WebKit/public/web/WebSettings.h"
-
-namespace blink {
-class WebView;
-}
-
-namespace WebTestRunner {
-
-struct WebPreferences {
- int defaultFontSize;
- int minimumFontSize;
- bool DOMPasteAllowed;
- bool XSSAuditorEnabled;
- bool allowDisplayOfInsecureContent;
- bool allowFileAccessFromFileURLs;
- bool allowRunningOfInsecureContent;
- bool authorAndUserStylesEnabled;
- blink::WebString defaultTextEncodingName;
- bool experimentalWebGLEnabled;
- bool experimentalCSSRegionsEnabled;
- bool experimentalCSSGridLayoutEnabled;
- bool javaEnabled;
- bool javaScriptCanAccessClipboard;
- bool javaScriptCanOpenWindowsAutomatically;
- bool supportsMultipleWindows;
- bool javaScriptEnabled;
- bool loadsImagesAutomatically;
- bool offlineWebApplicationCacheEnabled;
- bool pluginsEnabled;
- bool allowUniversalAccessFromFileURLs;
- blink::WebSettings::EditingBehavior editingBehavior;
- bool tabsToLinks;
- bool hyperlinkAuditingEnabled;
- bool caretBrowsingEnabled;
- bool shouldRespectImageOrientation;
- bool asynchronousSpellCheckingEnabled;
-
- WebPreferences();
- void reset();
-};
-
-}
-
-#endif // CONTENT_SHELL_COMMON_TEST_RUNNER_WEBPREFERENCES_H_
diff --git a/content/shell/common/test_runner/test_preferences.cc b/content/shell/common/test_runner/test_preferences.cc
new file mode 100644
index 0000000..137c5bd
--- /dev/null
+++ b/content/shell/common/test_runner/test_preferences.cc
@@ -0,0 +1,54 @@
+// 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 "content/shell/common/test_runner/test_preferences.h"
+
+#include "build/build_config.h"
+
+using blink::WebSettings;
+using blink::WebString;
+
+namespace content {
+
+TestPreferences::TestPreferences() { Reset(); }
+
+void TestPreferences::Reset() {
+ default_font_size = 16;
+ minimum_font_size = 0;
+ dom_paste_allowed = true;
+ xss_auditor_enabled = false;
+ allow_display_of_insecure_content = true;
+ allow_file_access_from_file_urls = true;
+ allow_running_of_insecure_content = true;
+ default_text_encoding_name = WebString::fromUTF8("ISO-8859-1");
+ experimental_webgl_enabled = false;
+ experimental_css_regions_enabled = true;
+ experimental_css_grid_layout_enabled = true;
+ java_enabled = false;
+ java_script_can_access_clipboard = true;
+ java_script_can_open_windows_automatically = true;
+ supports_multiple_windows = true;
+ java_script_enabled = true;
+ loads_images_automatically = true;
+ offline_web_application_cache_enabled = true;
+ plugins_enabled = true;
+ caret_browsing_enabled = false;
+
+ // Allow those layout tests running as local files, i.e. under
+ // LayoutTests/http/tests/local, to access http server.
+ allow_universal_access_from_file_urls = true;
+
+#if defined(OS_MACOSX)
+ editing_behavior = WebSettings::EditingBehaviorMac;
+#else
+ editing_behavior = WebSettings::EditingBehaviorWin;
+#endif
+
+ tabs_to_links = false;
+ hyperlink_auditing_enabled = false;
+ should_respect_image_orientation = false;
+ asynchronous_spell_checking_enabled = false;
+}
+
+} // namespace content
diff --git a/content/shell/common/test_runner/test_preferences.h b/content/shell/common/test_runner/test_preferences.h
new file mode 100644
index 0000000..b2ca05a
--- /dev/null
+++ b/content/shell/common/test_runner/test_preferences.h
@@ -0,0 +1,53 @@
+// 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.
+
+#ifndef CONTENT_SHELL_COMMON_TEST_RUNNER_TEST_PREFERENCES_H_
+#define CONTENT_SHELL_COMMON_TEST_RUNNER_TEST_PREFERENCES_H_
+
+#include "third_party/WebKit/public/platform/WebString.h"
+#include "third_party/WebKit/public/platform/WebURL.h"
+#include "third_party/WebKit/public/web/WebSettings.h"
+
+namespace blink {
+class WebView;
+}
+
+namespace content {
+
+struct TestPreferences {
+ int default_font_size;
+ int minimum_font_size;
+ bool dom_paste_allowed;
+ bool xss_auditor_enabled;
+ bool allow_display_of_insecure_content;
+ bool allow_file_access_from_file_urls;
+ bool allow_running_of_insecure_content;
+ bool author_and_user_styles_enabled;
+ blink::WebString default_text_encoding_name;
+ bool experimental_webgl_enabled;
+ bool experimental_css_regions_enabled;
+ bool experimental_css_grid_layout_enabled;
+ bool java_enabled;
+ bool java_script_can_access_clipboard;
+ bool java_script_can_open_windows_automatically;
+ bool supports_multiple_windows;
+ bool java_script_enabled;
+ bool loads_images_automatically;
+ bool offline_web_application_cache_enabled;
+ bool plugins_enabled;
+ bool allow_universal_access_from_file_urls;
+ blink::WebSettings::EditingBehavior editing_behavior;
+ bool tabs_to_links;
+ bool hyperlink_auditing_enabled;
+ bool caret_browsing_enabled;
+ bool should_respect_image_orientation;
+ bool asynchronous_spell_checking_enabled;
+
+ TestPreferences();
+ void Reset();
+};
+
+}
+
+#endif // CONTENT_SHELL_COMMON_TEST_RUNNER_TEST_PREFERENCES_H_
diff --git a/content/shell/common/webkit_test_helpers.cc b/content/shell/common/webkit_test_helpers.cc
index f7c2ca3..d2c1ea1 100644
--- a/content/shell/common/webkit_test_helpers.cc
+++ b/content/shell/common/webkit_test_helpers.cc
@@ -10,43 +10,44 @@
#include "base/strings/utf_string_conversions.h"
#include "content/public/common/content_switches.h"
#include "content/shell/common/shell_switches.h"
-#include "content/shell/common/test_runner/WebPreferences.h"
+#include "content/shell/common/test_runner/test_preferences.h"
#include "webkit/common/webpreferences.h"
namespace content {
void ExportLayoutTestSpecificPreferences(
- const WebTestRunner::WebPreferences& from,
+ const TestPreferences& from,
WebPreferences* to) {
to->allow_universal_access_from_file_urls =
- from.allowUniversalAccessFromFileURLs;
- to->dom_paste_enabled = from.DOMPasteAllowed;
- to->javascript_can_access_clipboard = from.javaScriptCanAccessClipboard;
- to->xss_auditor_enabled = from.XSSAuditorEnabled;
+ from.allow_universal_access_from_file_urls;
+ to->dom_paste_enabled = from.dom_paste_allowed;
+ to->javascript_can_access_clipboard = from.java_script_can_access_clipboard;
+ to->xss_auditor_enabled = from.xss_auditor_enabled;
to->editing_behavior = static_cast<webkit_glue::EditingBehavior>(
- from.editingBehavior);
- to->default_font_size = from.defaultFontSize;
- to->minimum_font_size = from.minimumFontSize;
- to->default_encoding = from.defaultTextEncodingName.utf8().data();
- to->javascript_enabled = from.javaScriptEnabled;
- to->supports_multiple_windows = from.supportsMultipleWindows;
- to->loads_images_automatically = from.loadsImagesAutomatically;
- to->plugins_enabled = from.pluginsEnabled;
- to->java_enabled = from.javaEnabled;
- to->application_cache_enabled = from.offlineWebApplicationCacheEnabled;
- to->tabs_to_links = from.tabsToLinks;
- to->experimental_webgl_enabled = from.experimentalWebGLEnabled;
+ from.editing_behavior);
+ to->default_font_size = from.default_font_size;
+ to->minimum_font_size = from.minimum_font_size;
+ to->default_encoding = from.default_text_encoding_name.utf8().data();
+ to->javascript_enabled = from.java_script_enabled;
+ to->supports_multiple_windows = from.supports_multiple_windows;
+ to->loads_images_automatically = from.loads_images_automatically;
+ to->plugins_enabled = from.plugins_enabled;
+ to->java_enabled = from.java_enabled;
+ to->application_cache_enabled = from.offline_web_application_cache_enabled;
+ to->tabs_to_links = from.tabs_to_links;
+ to->experimental_webgl_enabled = from.experimental_webgl_enabled;
// experimentalCSSRegionsEnabled is deprecated and ignored.
- to->hyperlink_auditing_enabled = from.hyperlinkAuditingEnabled;
- to->caret_browsing_enabled = from.caretBrowsingEnabled;
- to->allow_displaying_insecure_content = from.allowDisplayOfInsecureContent;
- to->allow_running_insecure_content = from.allowRunningOfInsecureContent;
- to->should_respect_image_orientation = from.shouldRespectImageOrientation;
+ to->hyperlink_auditing_enabled = from.hyperlink_auditing_enabled;
+ to->caret_browsing_enabled = from.caret_browsing_enabled;
+ to->allow_displaying_insecure_content =
+ from.allow_display_of_insecure_content;
+ to->allow_running_insecure_content = from.allow_running_of_insecure_content;
+ to->should_respect_image_orientation = from.should_respect_image_orientation;
to->asynchronous_spell_checking_enabled =
- from.asynchronousSpellCheckingEnabled;
- to->allow_file_access_from_file_urls = from.allowFileAccessFromFileURLs;
+ from.asynchronous_spell_checking_enabled;
+ to->allow_file_access_from_file_urls = from.allow_file_access_from_file_urls;
to->javascript_can_open_windows_automatically =
- from.javaScriptCanOpenWindowsAutomatically;
+ from.java_script_can_open_windows_automatically;
}
// Applies settings that differ between layout tests and regular mode. Some
diff --git a/content/shell/common/webkit_test_helpers.h b/content/shell/common/webkit_test_helpers.h
index 60cdce6..0d4593f 100644
--- a/content/shell/common/webkit_test_helpers.h
+++ b/content/shell/common/webkit_test_helpers.h
@@ -7,10 +7,6 @@
struct WebPreferences;
-namespace WebTestRunner {
-struct WebPreferences;
-}
-
namespace base {
class FilePath;
}
@@ -19,12 +15,14 @@ struct WebPreferences;
namespace content {
+struct TestPreferences;
+
// The TestRunner library keeps its settings in a WebTestRunner::WebPreferenes
// object. The content_shell, however, uses WebPreferences. This
// method exports the settings from the WebTestRunner library which are relevant
// for layout tests.
void ExportLayoutTestSpecificPreferences(
- const WebTestRunner::WebPreferences& from, WebPreferences* to);
+ const TestPreferences& from, WebPreferences* to);
// Applies settings that differ between layout tests and regular mode.
void ApplyLayoutTestDefaultPreferences(WebPreferences* prefs);