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/renderer/test_runner/test_interfaces.h" | 5 #include "content/shell/renderer/test_runner/test_interfaces.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 test_runner_->setShouldDumpFrameLoadCallbacks(true); | 111 test_runner_->setShouldDumpFrameLoadCallbacks(true); |
112 if (spec.find("/dumpAsText/") != std::string::npos) { | 112 if (spec.find("/dumpAsText/") != std::string::npos) { |
113 test_runner_->setShouldDumpAsText(true); | 113 test_runner_->setShouldDumpAsText(true); |
114 test_runner_->setShouldGeneratePixelResults(false); | 114 test_runner_->setShouldGeneratePixelResults(false); |
115 } | 115 } |
116 if (spec.find("/inspector/") != std::string::npos || | 116 if (spec.find("/inspector/") != std::string::npos || |
117 spec.find("/inspector-enabled/") != std::string::npos) | 117 spec.find("/inspector-enabled/") != std::string::npos) |
118 test_runner_->ClearDevToolsLocalStorage(); | 118 test_runner_->ClearDevToolsLocalStorage(); |
119 if (spec.find("/inspector/") != std::string::npos) { | 119 if (spec.find("/inspector/") != std::string::npos) { |
120 // Subfolder name determines default panel to open. | 120 // Subfolder name determines default panel to open. |
121 std::string settings = ""; | |
122 std::string test_path = spec.substr(spec.find("/inspector/") + 11); | 121 std::string test_path = spec.substr(spec.find("/inspector/") + 11); |
123 size_t slash_index = test_path.find("/"); | 122 test_runner_->ShowDevTools(spec.c_str(), std::string()); |
dgozman
2015/04/13 13:37:48
Either pass |test_path.c_str()| or remove |test_pa
pfeldman
2015/04/13 16:08:10
Done.
| |
124 std::string test_path_setting = base::StringPrintf( | |
125 "\"testPath\":\"\\\"%s\\\"\"", spec.c_str()); | |
126 | |
127 // TODO(pfeldman): remove once migrated to testPath. | |
128 std::string last_active_panel; | |
129 if (slash_index != std::string::npos) { | |
130 last_active_panel = base::StringPrintf( | |
131 ",\"lastActivePanel\":\"\\\"%s\\\"\"", | |
132 test_path.substr(0, slash_index).c_str()); | |
133 } | |
134 | |
135 test_runner_->ShowDevTools(base::StringPrintf("{%s%s}", | |
136 test_path_setting.c_str(), last_active_panel.c_str()), std::string()); | |
137 } | 123 } |
138 if (spec.find("/viewsource/") != std::string::npos) { | 124 if (spec.find("/viewsource/") != std::string::npos) { |
139 test_runner_->setShouldEnableViewSource(true); | 125 test_runner_->setShouldEnableViewSource(true); |
140 test_runner_->setShouldGeneratePixelResults(false); | 126 test_runner_->setShouldGeneratePixelResults(false); |
141 test_runner_->setShouldDumpAsMarkup(true); | 127 test_runner_->setShouldDumpAsMarkup(true); |
142 } | 128 } |
143 } | 129 } |
144 | 130 |
145 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) { | 131 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) { |
146 window_list_.push_back(proxy); | 132 window_list_.push_back(proxy); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 | 168 |
183 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { | 169 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { |
184 if (!test_runner_->UseMockTheme()) | 170 if (!test_runner_->UseMockTheme()) |
185 return 0; | 171 return 0; |
186 if (!theme_engine_.get()) | 172 if (!theme_engine_.get()) |
187 theme_engine_.reset(new MockWebThemeEngine()); | 173 theme_engine_.reset(new MockWebThemeEngine()); |
188 return theme_engine_.get(); | 174 return theme_engine_.get(); |
189 } | 175 } |
190 | 176 |
191 } // namespace content | 177 } // namespace content |
OLD | NEW |