1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/shell/common/shell_switches.h"
7 #include "base/command_line.h"
8 #include "base/strings/string_split.h"
12 // Allow access to external pages during layout tests.
13 const char kAllowExternalPages
[] = "allow-external-pages";
15 // Check whether all system dependencies for running layout tests are met.
16 const char kCheckLayoutTestSysDeps
[] = "check-layout-test-sys-deps";
18 // Tells Content Shell that it's running as a content_browsertest.
19 const char kContentBrowserTest
[] = "browser-test";
21 // Makes Content Shell use the given path for its data directory.
22 const char kContentShellDataPath
[] = "data-path";
24 // The directory breakpad should store minidumps in.
25 const char kCrashDumpsDir
[] = "crash-dumps-dir";
27 // When specified to "enable-leak-detection" command-line option,
28 // causes the leak detector to cause immediate crash when found leak.
29 const char kCrashOnFailure
[] = "crash-on-failure";
31 // Request the render trees of pages to be dumped as text once they have
32 // finished loading. Note that this switch has been deprecated, and the
33 // identically functioning |kRunLayoutTest| switch should be used instead.
34 const char kDumpRenderTree
[] = "dump-render-tree";
36 // When dump-render-tree is enabled, this causes the line box tree for
37 // each LayoutBlockFlow to be dumped as well.
38 const char kDumpLineBoxTrees
[] = "dump-line-box-trees";
40 // Expose window.ipcTester object for testing
41 const char kExposeIpcEcho
[] = "expose-ipc-echo";
43 // Enable accelerated 2D canvas.
44 const char kEnableAccelerated2DCanvas
[] = "enable-accelerated-2d-canvas";
46 // Enable font antialiasing for pixel tests.
47 const char kEnableFontAntialiasing
[] = "enable-font-antialiasing";
49 // Enables the leak detection of loading webpages. This allows us to check
50 // whether or not reloading a webpage releases web-related objects correctly.
51 const char kEnableLeakDetection
[] = "enable-leak-detection";
53 // Encode binary layout test results (images, audio) using base64.
54 const char kEncodeBinary
[] = "encode-binary";
56 // Exposes the window.internals object to JavaScript for interactive development
57 // and debugging of layout tests that rely on it.
58 const char kExposeInternalsForTesting
[] = "expose-internals-for-testing";
60 // Registers additional font files on Windows (for fonts outside the usual
61 // %WINDIR%\Fonts location). Multiple files can be used by separating them
62 // with a semicolon (;).
63 const char kRegisterFontFiles
[] = "register-font-files";
65 // Request the render trees of pages to be dumped as text once they have
67 const char kRunLayoutTest
[] = "run-layout-test";
69 // This makes us disable some web-platform runtime features so that we test
70 // content_shell as if it was a stable release. It is only followed when
71 // kRunLayoutTest is set. For the features' level, see
72 // http://dev.chromium.org/blink/runtime-enabled-features.
73 const char kStableReleaseMode
[] = "stable-release-mode";
75 // Size for the content_shell's host window (i.e. "800x600").
76 const char kContentShellHostWindowSize
[] = "content-shell-host-window-size";
78 std::vector
<std::string
> GetSideloadFontFiles() {
79 std::vector
<std::string
> files
;
80 const base::CommandLine
& command_line
=
81 *base::CommandLine::ForCurrentProcess();
82 if (command_line
.HasSwitch(switches::kRegisterFontFiles
)) {
83 files
= base::SplitString(
84 command_line
.GetSwitchValueASCII(switches::kRegisterFontFiles
),
85 ";", base::TRIM_WHITESPACE
, base::SPLIT_WANT_ALL
);
90 } // namespace switches