summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorpaulmeyer <paulmeyer@chromium.org>2015-02-04 14:43:29 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-04 22:44:23 +0000
commit7066b52aa7103b402dea27c64ec17d45c373a838 (patch)
tree21cbbe3954d88395255a5bb47a727b767571933e /content
parent44036d053dc7731deb8fdf5d20603bbb8b1c19a5 (diff)
downloadchromium_src-7066b52aa7103b402dea27c64ec17d45c373a838.zip
chromium_src-7066b52aa7103b402dea27c64ec17d45c373a838.tar.gz
chromium_src-7066b52aa7103b402dea27c64ec17d45c373a838.tar.bz2
Chromium-side patch to rename "--dump-render-tree" to "--run-layout-test".
At this point, "--run-layout-test" is the flag that is actually functional, and using "--dump-render-tree" simply causes the "--run-layout-test" to be appended to the command line. A subsequent Blink patch will change the scripts in Blink to use "--run-layout-test" instead of "--dump-render-tree". BUG=453252 Review URL: https://codereview.chromium.org/899103002 Cr-Commit-Position: refs/heads/master@{#314664}
Diffstat (limited to 'content')
-rw-r--r--content/public/android/java/src/org/chromium/content/common/ContentSwitches.java4
-rw-r--r--content/public/test/content_browser_test.cc4
-rw-r--r--content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java2
-rw-r--r--content/shell/app/shell_main_delegate.cc14
-rw-r--r--content/shell/app/shell_main_delegate_mac.mm2
-rw-r--r--content/shell/browser/shell.cc16
-rw-r--r--content/shell/browser/shell_content_browser_client.cc10
-rw-r--r--content/shell/browser/shell_web_contents_view_delegate_mac.mm2
-rw-r--r--content/shell/browser/shell_web_contents_view_delegate_win.cc2
-rw-r--r--content/shell/common/shell_content_client.cc4
-rw-r--r--content/shell/common/shell_switches.cc10
-rw-r--r--content/shell/common/shell_switches.h1
-rwxr-xr-xcontent/shell/tools/breakpad_integration_test.py2
13 files changed, 43 insertions, 30 deletions
diff --git a/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java b/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java
index b73d479..444282e 100644
--- a/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java
+++ b/content/public/android/java/src/org/chromium/content/common/ContentSwitches.java
@@ -54,8 +54,8 @@ public abstract class ContentSwitches {
// Native switch - chrome_switches::kEnableInstantExtendedAPI
public static final String ENABLE_INSTANT_EXTENDED_API = "enable-instant-extended-api";
- // Native switch - shell_switches::kDumpRenderTree
- public static final String DUMP_RENDER_TREE = "dump-render-tree";
+ // Native switch - shell_switches::kRunLayoutTest
+ public static final String RUN_LAYOUT_TEST = "run-layout-test";
// Native switch - chrome_switches::kDisablePopupBlocking
public static final String DISABLE_POPUP_BLOCKING = "disable-popup-blocking";
diff --git a/content/public/test/content_browser_test.cc b/content/public/test/content_browser_test.cc
index 0408c8a..a6802124 100644
--- a/content/public/test/content_browser_test.cc
+++ b/content/public/test/content_browser_test.cc
@@ -74,7 +74,7 @@ void ContentBrowserTest::SetUp() {
// setting a global that may be used after ContentBrowserTest is
// destroyed.
ContentRendererClient* old_client =
- command_line->HasSwitch(switches::kDumpRenderTree)
+ command_line->HasSwitch(switches::kRunLayoutTest)
? SetRendererClientForTesting(new LayoutTestContentRendererClient)
: SetRendererClientForTesting(new ShellContentRendererClient);
// No-one should have set this value before we did.
@@ -117,7 +117,7 @@ void ContentBrowserTest::TearDown() {
void ContentBrowserTest::RunTestOnMainThreadLoop() {
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)) {
+ switches::kRunLayoutTest)) {
CHECK_EQ(Shell::windows().size(), 1u);
shell_ = Shell::windows()[0];
}
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
index ee048ba..eed8c87 100644
--- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java
@@ -79,7 +79,7 @@ public class ContentShellActivity extends Activity {
mShellManager.setStartupUrl(Shell.sanitizeUrl(startupUrl));
}
- if (CommandLine.getInstance().hasSwitch(ContentSwitches.DUMP_RENDER_TREE)) {
+ if (CommandLine.getInstance().hasSwitch(ContentSwitches.RUN_LAYOUT_TEST)) {
try {
BrowserStartupController.get(this).startBrowserProcessesSync(false);
} catch (ProcessInitException e) {
diff --git a/content/shell/app/shell_main_delegate.cc b/content/shell/app/shell_main_delegate.cc
index de0b758..5c10679 100644
--- a/content/shell/app/shell_main_delegate.cc
+++ b/content/shell/app/shell_main_delegate.cc
@@ -141,7 +141,13 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
}
}
- if (command_line.HasSwitch(switches::kDumpRenderTree)) {
+ // "dump-render-tree" has been renamed to "run-layout-test", but the old
+ // flag name is still used in some places, so this check will remain until
+ // it is phased out entirely.
+ if (command_line.HasSwitch(switches::kDumpRenderTree))
+ command_line.AppendSwitch(switches::kRunLayoutTest);
+
+ if (command_line.HasSwitch(switches::kRunLayoutTest)) {
EnableBrowserLayoutTestMode();
command_line.AppendSwitch(switches::kProcessPerTab);
@@ -262,7 +268,7 @@ int ShellMainDelegate::RunProcess(
browser_runner_.reset(BrowserMainRunner::Create());
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
- return command_line.HasSwitch(switches::kDumpRenderTree) ||
+ return command_line.HasSwitch(switches::kRunLayoutTest) ||
command_line.HasSwitch(switches::kCheckLayoutTestSysDeps)
? LayoutTestBrowserMain(main_function_params, browser_runner_)
: ShellBrowserMain(main_function_params, browser_runner_);
@@ -318,7 +324,7 @@ void ShellMainDelegate::InitializeResourceBundle() {
ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
browser_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)
+ switches::kRunLayoutTest)
? new LayoutTestContentBrowserClient
: new ShellContentBrowserClient);
@@ -327,7 +333,7 @@ ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() {
renderer_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)
+ switches::kRunLayoutTest)
? new LayoutTestContentRendererClient
: new ShellContentRendererClient);
diff --git a/content/shell/app/shell_main_delegate_mac.mm b/content/shell/app/shell_main_delegate_mac.mm
index 319171f..bba20a1 100644
--- a/content/shell/app/shell_main_delegate_mac.mm
+++ b/content/shell/app/shell_main_delegate_mac.mm
@@ -29,7 +29,7 @@ void EnsureCorrectResolutionSettings() {
initWithContentsOfFile:base::mac::FilePathToNSString(info_plist)]);
bool running_layout_tests = base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree);
+ switches::kRunLayoutTest);
bool not_high_resolution_capable =
[info_dict objectForKey:kHighResolutionCapable] &&
[[info_dict objectForKey:kHighResolutionCapable] isEqualToNumber:@(NO)];
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index 546e5e3..bdd44fd 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -86,7 +86,7 @@ Shell::Shell(WebContents* web_contents)
headless_(false) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
- if (command_line.HasSwitch(switches::kDumpRenderTree))
+ if (command_line.HasSwitch(switches::kRunLayoutTest))
headless_ = true;
windows_.push_back(this);
@@ -127,7 +127,7 @@ Shell* Shell::CreateShell(WebContents* web_contents,
shell->PlatformResizeSubViews();
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)) {
+ switches::kRunLayoutTest)) {
web_contents->GetMutableRendererPrefs()->use_custom_colors = false;
web_contents->GetRenderViewHost()->SyncRendererPrefs();
}
@@ -218,7 +218,7 @@ void Shell::AddNewContents(WebContents* source,
bool* was_blocked) {
CreateShell(new_contents, AdjustWindowSize(initial_rect.size()));
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
+ switches::kRunLayoutTest))
NotifyDoneForwarder::CreateForWebContents(new_contents);
}
@@ -317,7 +317,7 @@ void Shell::ToggleFullscreenModeForTab(WebContents* web_contents,
PlatformToggleFullscreenModeForTab(web_contents, enter_fullscreen);
#endif
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
+ switches::kRunLayoutTest))
return;
if (is_fullscreen_ != enter_fullscreen) {
is_fullscreen_ = enter_fullscreen;
@@ -360,7 +360,7 @@ JavaScriptDialogManager* Shell::GetJavaScriptDialogManager(
if (!dialog_manager_) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
- dialog_manager_.reset(command_line.HasSwitch(switches::kDumpRenderTree)
+ dialog_manager_.reset(command_line.HasSwitch(switches::kRunLayoutTest)
? new LayoutTestJavaScriptDialogManager
: new ShellJavaScriptDialogManager);
}
@@ -373,12 +373,12 @@ bool Shell::AddMessageToConsole(WebContents* source,
int32 line_no,
const base::string16& source_id) {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree);
+ switches::kRunLayoutTest);
}
void Shell::RendererUnresponsive(WebContents* source) {
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
+ switches::kRunLayoutTest))
return;
WebKitTestController::Get()->RendererUnresponsive();
}
@@ -393,7 +393,7 @@ void Shell::DeactivateContents(WebContents* contents) {
void Shell::WorkerCrashed(WebContents* source) {
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
+ switches::kRunLayoutTest))
return;
WebKitTestController::Get()->WorkerCrashed();
}
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index fce6407..64c36a4 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -138,7 +138,7 @@ ShellContentBrowserClient::~ShellContentBrowserClient() {
BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts(
const MainFunctionParams& parameters) {
shell_browser_main_parts_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)
+ switches::kRunLayoutTest)
? new LayoutTestBrowserMainParts(parameters)
: new ShellBrowserMainParts(parameters);
return shell_browser_main_parts_;
@@ -202,8 +202,8 @@ void ShellContentBrowserClient::AppendExtraCommandLineSwitches(
base::CommandLine* command_line,
int child_process_id) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
- command_line->AppendSwitch(switches::kDumpRenderTree);
+ switches::kRunLayoutTest))
+ command_line->AppendSwitch(switches::kRunLayoutTest);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableFontAntialiasing))
command_line->AppendSwitch(switches::kEnableFontAntialiasing);
@@ -248,7 +248,7 @@ void ShellContentBrowserClient::OverrideWebkitPrefs(
const GURL& url,
WebPreferences* prefs) {
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
+ switches::kRunLayoutTest))
return;
WebKitTestController::Get()->OverrideWebkitPrefs(prefs);
}
@@ -256,7 +256,7 @@ void ShellContentBrowserClient::OverrideWebkitPrefs(
void ShellContentBrowserClient::ResourceDispatcherHostCreated() {
resource_dispatcher_host_delegate_.reset(
base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)
+ switches::kRunLayoutTest)
? new LayoutTestResourceDispatcherHostDelegate
: new ShellResourceDispatcherHostDelegate);
ResourceDispatcherHost::Get()->SetDelegate(
diff --git a/content/shell/browser/shell_web_contents_view_delegate_mac.mm b/content/shell/browser/shell_web_contents_view_delegate_mac.mm
index 78ffc27..5d8ecdd 100644
--- a/content/shell/browser/shell_web_contents_view_delegate_mac.mm
+++ b/content/shell/browser/shell_web_contents_view_delegate_mac.mm
@@ -96,7 +96,7 @@ void ShellWebContentsViewDelegate::ShowContextMenu(
RenderFrameHost* render_frame_host,
const ContextMenuParams& params) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
+ switches::kRunLayoutTest))
return;
params_ = params;
diff --git a/content/shell/browser/shell_web_contents_view_delegate_win.cc b/content/shell/browser/shell_web_contents_view_delegate_win.cc
index 672791b..757cb40 100644
--- a/content/shell/browser/shell_web_contents_view_delegate_win.cc
+++ b/content/shell/browser/shell_web_contents_view_delegate_win.cc
@@ -73,7 +73,7 @@ void ShellWebContentsViewDelegate::ShowContextMenu(
RenderFrameHost* render_frame_host,
const ContextMenuParams& params) {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree))
+ switches::kRunLayoutTest))
return;
params_ = params;
diff --git a/content/shell/common/shell_content_client.cc b/content/shell/common/shell_content_client.cc
index db521d4..f9d4591 100644
--- a/content/shell/common/shell_content_client.cc
+++ b/content/shell/common/shell_content_client.cc
@@ -35,7 +35,7 @@ std::string ShellContentClient::GetUserAgent() const {
base::string16 ShellContentClient::GetLocalizedString(int message_id) const {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)) {
+ switches::kRunLayoutTest)) {
switch (message_id) {
case IDS_FORM_OTHER_DATE_LABEL:
return base::ASCIIToUTF16("<<OtherDateLabel>>");
@@ -62,7 +62,7 @@ base::StringPiece ShellContentClient::GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDumpRenderTree)) {
+ switches::kRunLayoutTest)) {
switch (resource_id) {
case IDR_BROKENIMAGE:
#if defined(OS_MACOSX)
diff --git a/content/shell/common/shell_switches.cc b/content/shell/common/shell_switches.cc
index 6a7a48b..d2f0a29 100644
--- a/content/shell/common/shell_switches.cc
+++ b/content/shell/common/shell_switches.cc
@@ -25,7 +25,9 @@ const char kCrashDumpsDir[] = "crash-dumps-dir";
// causes the leak detector to cause immediate crash when found leak.
const char kCrashOnFailure[] = "crash-on-failure";
-// Request pages to be dumped as text once they finished loading.
+// Request the render trees of pages to be dumped as text once they have
+// finished loading. Note that this switch has been deprecated, and the
+// identically functioning |kRunLayoutTest| switch should be used instead.
const char kDumpRenderTree[] = "dump-render-tree";
// Expose window.ipcTester object for testing
@@ -53,9 +55,13 @@ const char kExposeInternalsForTesting[] = "expose-internals-for-testing";
// with a semicolon (;).
const char kRegisterFontFiles[] = "register-font-files";
+// Request the render trees of pages to be dumped as text once they have
+// finished loading.
+const char kRunLayoutTest[] = "run-layout-test";
+
// This makes us disable some web-platform runtime features so that we test
// content_shell as if it was a stable release. It is only followed when
-// kDumpRenderTree is set. For the features' level, see
+// kRunLayoutTest is set. For the features' level, see
// http://dev.chromium.org/blink/runtime-enabled-features.
const char kStableReleaseMode[] = "stable-release-mode";
diff --git a/content/shell/common/shell_switches.h b/content/shell/common/shell_switches.h
index 48dccbb..8ebbc98 100644
--- a/content/shell/common/shell_switches.h
+++ b/content/shell/common/shell_switches.h
@@ -23,6 +23,7 @@ extern const char kEnableLeakDetection[];
extern const char kEncodeBinary[];
extern const char kExposeInternalsForTesting[];
extern const char kRegisterFontFiles[];
+extern const char kRunLayoutTest[];
extern const char kStableReleaseMode[];
extern const char kContentShellHostWindowSize[];
diff --git a/content/shell/tools/breakpad_integration_test.py b/content/shell/tools/breakpad_integration_test.py
index cfb0312..1e5d4ba 100755
--- a/content/shell/tools/breakpad_integration_test.py
+++ b/content/shell/tools/breakpad_integration_test.py
@@ -75,7 +75,7 @@ def main():
print "# Run content_shell and make it crash."
cmd = [options.binary,
- '--dump-render-tree',
+ '--run-layout-test',
'chrome://crash',
'--enable-crash-reporter',
'--crash-dumps-dir=%s' % crash_dir]