OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/common/shell_switches.h" | 5 #include "content/shell/common/layout_test/layout_test_switches.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 | 9 |
10 namespace switches { | 10 namespace switches { |
11 | 11 |
12 // Allow access to external pages during layout tests. | 12 // Allow access to external pages during layout tests. |
13 const char kAllowExternalPages[] = "allow-external-pages"; | 13 const char kAllowExternalPages[] = "allow-external-pages"; |
14 | 14 |
15 // Check whether all system dependencies for running layout tests are met. | 15 // Check whether all system dependencies for running layout tests are met. |
16 const char kCheckLayoutTestSysDeps[] = "check-layout-test-sys-deps"; | 16 const char kCheckLayoutTestSysDeps[] = "check-layout-test-sys-deps"; |
17 | 17 |
18 // Tells Content Shell that it's running as a content_browsertest. | |
19 const char kContentBrowserTest[] = "browser-test"; | |
20 | |
21 // Makes Content Shell use the given path for its data directory. | |
22 const char kContentShellDataPath[] = "data-path"; | |
23 | |
24 // The directory breakpad should store minidumps in. | |
25 const char kCrashDumpsDir[] = "crash-dumps-dir"; | |
26 | |
27 // When specified to "enable-leak-detection" command-line option, | 18 // When specified to "enable-leak-detection" command-line option, |
28 // causes the leak detector to cause immediate crash when found leak. | 19 // causes the leak detector to cause immediate crash when found leak. |
29 const char kCrashOnFailure[] = "crash-on-failure"; | 20 const char kCrashOnFailure[] = "crash-on-failure"; |
30 | 21 |
31 // Enable accelerated 2D canvas. | 22 // Enable accelerated 2D canvas. |
32 const char kEnableAccelerated2DCanvas[] = "enable-accelerated-2d-canvas"; | 23 const char kEnableAccelerated2DCanvas[] = "enable-accelerated-2d-canvas"; |
33 | 24 |
34 // Enable font antialiasing for pixel tests. | 25 // Enable font antialiasing for pixel tests. |
35 const char kEnableFontAntialiasing[] = "enable-font-antialiasing"; | 26 const char kEnableFontAntialiasing[] = "enable-font-antialiasing"; |
36 | 27 |
37 // Always use the complex text path for layout tests. | 28 // Always use the complex text path for layout tests. |
38 const char kAlwaysUseComplexText[] = "always-use-complex-text"; | 29 const char kAlwaysUseComplexText[] = "always-use-complex-text"; |
39 | 30 |
40 // Enables the leak detection of loading webpages. This allows us to check | 31 // Enables the leak detection of loading webpages. This allows us to check |
41 // whether or not reloading a webpage releases web-related objects correctly. | 32 // whether or not reloading a webpage releases web-related objects correctly. |
42 const char kEnableLeakDetection[] = "enable-leak-detection"; | 33 const char kEnableLeakDetection[] = "enable-leak-detection"; |
43 | 34 |
44 // Encode binary layout test results (images, audio) using base64. | 35 // Encode binary layout test results (images, audio) using base64. |
45 const char kEncodeBinary[] = "encode-binary"; | 36 const char kEncodeBinary[] = "encode-binary"; |
46 | 37 |
47 // Exposes the window.internals object to JavaScript for interactive development | 38 // Exposes the window.internals object to JavaScript for interactive development |
48 // and debugging of layout tests that rely on it. | 39 // and debugging of layout tests that rely on it. |
49 const char kExposeInternalsForTesting[] = "expose-internals-for-testing"; | 40 const char kExposeInternalsForTesting[] = "expose-internals-for-testing"; |
50 | 41 |
51 // Enable site isolation (--site-per-process style isolation) for a subset of | |
52 // sites. The argument is a wildcard pattern which will be matched against the | |
53 // site URL to determine which sites to isolate. This can be used to isolate | |
54 // just one top-level domain, or just one scheme. Example usages: | |
55 // --isolate-sites-for-testing=*.com | |
56 // --isolate-sites-for-testing=https://* | |
57 const char kIsolateSitesForTesting[] = "isolate-sites-for-testing"; | |
58 | |
59 // Registers additional font files on Windows (for fonts outside the usual | |
60 // %WINDIR%\Fonts location). Multiple files can be used by separating them | |
61 // with a semicolon (;). | |
62 const char kRegisterFontFiles[] = "register-font-files"; | |
63 | |
64 // Request the render trees of pages to be dumped as text once they have | 42 // Request the render trees of pages to be dumped as text once they have |
65 // finished loading. | 43 // finished loading. |
66 const char kRunLayoutTest[] = "run-layout-test"; | 44 const char kRunLayoutTest[] = "run-layout-test"; |
67 | 45 |
68 // This makes us disable some web-platform runtime features so that we test | 46 // This makes us disable some web-platform runtime features so that we test |
69 // content_shell as if it was a stable release. It is only followed when | 47 // content_shell as if it was a stable release. It is only followed when |
70 // kRunLayoutTest is set. For the features' level, see | 48 // kRunLayoutTest is set. For the features' level, see |
71 // http://dev.chromium.org/blink/runtime-enabled-features. | 49 // http://dev.chromium.org/blink/runtime-enabled-features. |
72 const char kStableReleaseMode[] = "stable-release-mode"; | 50 const char kStableReleaseMode[] = "stable-release-mode"; |
73 | 51 |
74 // Size for the content_shell's host window (i.e. "800x600"). | |
75 const char kContentShellHostWindowSize[] = "content-shell-host-window-size"; | |
76 | |
77 std::vector<std::string> GetSideloadFontFiles() { | |
78 std::vector<std::string> files; | |
79 const base::CommandLine& command_line = | |
80 *base::CommandLine::ForCurrentProcess(); | |
81 if (command_line.HasSwitch(switches::kRegisterFontFiles)) { | |
82 files = base::SplitString( | |
83 command_line.GetSwitchValueASCII(switches::kRegisterFontFiles), | |
84 ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | |
85 } | |
86 return files; | |
87 } | |
88 | |
89 } // namespace switches | 52 } // namespace switches |
OLD | NEW |