OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/layout_test/layout_test_devtools_frontend.h" | 5 #include "content/shell/browser/layout_test/layout_test_devtools_frontend.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
47 // On Mac, the executable is in | 47 // On Mac, the executable is in |
48 // out/Release/Content Shell.app/Contents/MacOS/Content Shell. | 48 // out/Release/Content Shell.app/Contents/MacOS/Content Shell. |
49 // We need to go up 3 directories to get to out/Release. | 49 // We need to go up 3 directories to get to out/Release. |
50 dir_exe = dir_exe.AppendASCII("../../.."); | 50 dir_exe = dir_exe.AppendASCII("../../.."); |
51 #endif | 51 #endif |
52 base::FilePath dev_tools_path = | 52 base::FilePath dev_tools_path = |
53 dir_exe.AppendASCII("resources/inspector/inspector.html"); | 53 dir_exe.AppendASCII("resources/inspector/inspector.html"); |
54 | 54 |
55 GURL result = net::FilePathToFileURL(dev_tools_path); | 55 GURL result = net::FilePathToFileURL(dev_tools_path); |
56 if (!settings.empty()) | 56 if (!settings.empty()) { |
57 result = GURL(base::StringPrintf("%s?settings=%s&experiments=true", | 57 std::string queryParams = |
58 result.spec().c_str(), | 58 base::StringPrintf("%s?settings=%s&experiments=true", |
59 settings.c_str())); | 59 result.spec().c_str(), settings.c_str()); |
60 #if defined(DEBUG_DEVTOOLS) | |
61 queryParams += "&debugFrontend=true"; | |
dgozman
2016/01/27 02:39:14
Should we append debugFrontend and experiments eve
kozy
2016/01/27 18:54:55
Done.
| |
62 #endif // defined(DEBUG_DEVTOOLS) | |
63 | |
64 result = GURL(queryParams); | |
65 } | |
60 return result; | 66 return result; |
61 } | 67 } |
62 | 68 |
63 void LayoutTestDevToolsFrontend::ReuseFrontend(const std::string& settings, | 69 void LayoutTestDevToolsFrontend::ReuseFrontend(const std::string& settings, |
64 const std::string frontend_url) { | 70 const std::string frontend_url) { |
65 DisconnectFromTarget(); | 71 DisconnectFromTarget(); |
66 preferences()->Clear(); | 72 preferences()->Clear(); |
67 frontend_shell()->LoadURL(GetDevToolsPathAsURL(settings, frontend_url)); | 73 frontend_shell()->LoadURL(GetDevToolsPathAsURL(settings, frontend_url)); |
68 } | 74 } |
69 | 75 |
(...skipping 10 matching lines...) Expand all Loading... | |
80 DevToolsAgentHost* agent_host, bool replaced) { | 86 DevToolsAgentHost* agent_host, bool replaced) { |
81 // Do not close the front-end shell. | 87 // Do not close the front-end shell. |
82 } | 88 } |
83 | 89 |
84 void LayoutTestDevToolsFrontend::RenderProcessGone( | 90 void LayoutTestDevToolsFrontend::RenderProcessGone( |
85 base::TerminationStatus status) { | 91 base::TerminationStatus status) { |
86 BlinkTestController::Get()->DevToolsProcessCrashed(); | 92 BlinkTestController::Get()->DevToolsProcessCrashed(); |
87 } | 93 } |
88 | 94 |
89 } // namespace content | 95 } // namespace content |
OLD | NEW |