diff options
author | dcheng <dcheng@chromium.org> | 2015-02-04 20:44:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-05 04:44:59 +0000 |
commit | 4d353255acdd6735c78ef15960203553f68ce26b (patch) | |
tree | 4ecb5221afe177b2d36b3eff0210117dcddbb0fa | |
parent | 0b0860a692e9d327f4f76949d096a7f2b1687c7c (diff) | |
download | chromium_src-4d353255acdd6735c78ef15960203553f68ce26b.zip chromium_src-4d353255acdd6735c78ef15960203553f68ce26b.tar.gz chromium_src-4d353255acdd6735c78ef15960203553f68ce26b.tar.bz2 |
Revert of Chromium-side patch to rename "--dump-render-tree" to "--run-layout-test". (patchset #1 id:1 of https://codereview.chromium.org/899103002/)
Reason for revert:
Speculatively reverting to try to fix broken Mac 10.8 retina and Nexus 4 layout tests.
Original issue's description:
> 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
>
> Committed: https://crrev.com/7066b52aa7103b402dea27c64ec17d45c373a838
> Cr-Commit-Position: refs/heads/master@{#314664}
TBR=avi@chromium.org,paulmeyer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=453252
Review URL: https://codereview.chromium.org/896403002
Cr-Commit-Position: refs/heads/master@{#314756}
13 files changed, 30 insertions, 43 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 444282e..b73d479 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::kRunLayoutTest - public static final String RUN_LAYOUT_TEST = "run-layout-test"; + // Native switch - shell_switches::kDumpRenderTree + public static final String DUMP_RENDER_TREE = "dump-render-tree"; // 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 a6802124..0408c8a 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::kRunLayoutTest) + command_line->HasSwitch(switches::kDumpRenderTree) ? 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::kRunLayoutTest)) { + switches::kDumpRenderTree)) { 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 eed8c87..ee048ba 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.RUN_LAYOUT_TEST)) { + if (CommandLine.getInstance().hasSwitch(ContentSwitches.DUMP_RENDER_TREE)) { 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 5c10679..de0b758 100644 --- a/content/shell/app/shell_main_delegate.cc +++ b/content/shell/app/shell_main_delegate.cc @@ -141,13 +141,7 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { } } - // "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)) { + if (command_line.HasSwitch(switches::kDumpRenderTree)) { EnableBrowserLayoutTestMode(); command_line.AppendSwitch(switches::kProcessPerTab); @@ -268,7 +262,7 @@ int ShellMainDelegate::RunProcess( browser_runner_.reset(BrowserMainRunner::Create()); base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); - return command_line.HasSwitch(switches::kRunLayoutTest) || + return command_line.HasSwitch(switches::kDumpRenderTree) || command_line.HasSwitch(switches::kCheckLayoutTestSysDeps) ? LayoutTestBrowserMain(main_function_params, browser_runner_) : ShellBrowserMain(main_function_params, browser_runner_); @@ -324,7 +318,7 @@ void ShellMainDelegate::InitializeResourceBundle() { ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { browser_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest) + switches::kDumpRenderTree) ? new LayoutTestContentBrowserClient : new ShellContentBrowserClient); @@ -333,7 +327,7 @@ ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { renderer_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest) + switches::kDumpRenderTree) ? 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 bba20a1..319171f 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::kRunLayoutTest); + switches::kDumpRenderTree); 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 bdd44fd..546e5e3 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::kRunLayoutTest)) + if (command_line.HasSwitch(switches::kDumpRenderTree)) headless_ = true; windows_.push_back(this); @@ -127,7 +127,7 @@ Shell* Shell::CreateShell(WebContents* web_contents, shell->PlatformResizeSubViews(); if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest)) { + switches::kDumpRenderTree)) { 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::kRunLayoutTest)) + switches::kDumpRenderTree)) 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::kRunLayoutTest)) + switches::kDumpRenderTree)) 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::kRunLayoutTest) + dialog_manager_.reset(command_line.HasSwitch(switches::kDumpRenderTree) ? 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::kRunLayoutTest); + switches::kDumpRenderTree); } void Shell::RendererUnresponsive(WebContents* source) { if (!base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest)) + switches::kDumpRenderTree)) return; WebKitTestController::Get()->RendererUnresponsive(); } @@ -393,7 +393,7 @@ void Shell::DeactivateContents(WebContents* contents) { void Shell::WorkerCrashed(WebContents* source) { if (!base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest)) + switches::kDumpRenderTree)) 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 89572d5..9b8a2f4 100644 --- a/content/shell/browser/shell_content_browser_client.cc +++ b/content/shell/browser/shell_content_browser_client.cc @@ -139,7 +139,7 @@ ShellContentBrowserClient::~ShellContentBrowserClient() { BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( const MainFunctionParams& parameters) { shell_browser_main_parts_ = base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest) + switches::kDumpRenderTree) ? new LayoutTestBrowserMainParts(parameters) : new ShellBrowserMainParts(parameters); return shell_browser_main_parts_; @@ -203,8 +203,8 @@ void ShellContentBrowserClient::AppendExtraCommandLineSwitches( base::CommandLine* command_line, int child_process_id) { if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest)) - command_line->AppendSwitch(switches::kRunLayoutTest); + switches::kDumpRenderTree)) + command_line->AppendSwitch(switches::kDumpRenderTree); if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableFontAntialiasing)) command_line->AppendSwitch(switches::kEnableFontAntialiasing); @@ -249,7 +249,7 @@ void ShellContentBrowserClient::OverrideWebkitPrefs( const GURL& url, WebPreferences* prefs) { if (!base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest)) + switches::kDumpRenderTree)) return; WebKitTestController::Get()->OverrideWebkitPrefs(prefs); } @@ -257,7 +257,7 @@ void ShellContentBrowserClient::OverrideWebkitPrefs( void ShellContentBrowserClient::ResourceDispatcherHostCreated() { resource_dispatcher_host_delegate_.reset( base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kRunLayoutTest) + switches::kDumpRenderTree) ? 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 5d8ecdd..78ffc27 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::kRunLayoutTest)) + switches::kDumpRenderTree)) 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 757cb40..672791b 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::kRunLayoutTest)) + switches::kDumpRenderTree)) return; params_ = params; diff --git a/content/shell/common/shell_content_client.cc b/content/shell/common/shell_content_client.cc index f9d4591..db521d4 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::kRunLayoutTest)) { + switches::kDumpRenderTree)) { 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::kRunLayoutTest)) { + switches::kDumpRenderTree)) { 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 d2f0a29..6a7a48b 100644 --- a/content/shell/common/shell_switches.cc +++ b/content/shell/common/shell_switches.cc @@ -25,9 +25,7 @@ const char kCrashDumpsDir[] = "crash-dumps-dir"; // causes the leak detector to cause immediate crash when found leak. const char kCrashOnFailure[] = "crash-on-failure"; -// 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. +// Request pages to be dumped as text once they finished loading. const char kDumpRenderTree[] = "dump-render-tree"; // Expose window.ipcTester object for testing @@ -55,13 +53,9 @@ 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 -// kRunLayoutTest is set. For the features' level, see +// kDumpRenderTree 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 8ebbc98..48dccbb 100644 --- a/content/shell/common/shell_switches.h +++ b/content/shell/common/shell_switches.h @@ -23,7 +23,6 @@ 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 1e5d4ba..cfb0312 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, - '--run-layout-test', + '--dump-render-tree', 'chrome://crash', '--enable-crash-reporter', '--crash-dumps-dir=%s' % crash_dir] |