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/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 if (spec.find("/inspector/") != std::string::npos || | 113 if (spec.find("/inspector/") != std::string::npos || |
114 spec.find("/inspector-enabled/") != std::string::npos) | 114 spec.find("/inspector-enabled/") != std::string::npos) |
115 test_runner_->ClearDevToolsLocalStorage(); | 115 test_runner_->ClearDevToolsLocalStorage(); |
116 if (spec.find("/inspector/") != std::string::npos) { | 116 if (spec.find("/inspector/") != std::string::npos) { |
117 // Subfolder name determines default panel to open. | 117 // Subfolder name determines default panel to open. |
118 std::string test_path = spec.substr(spec.find("/inspector/") + 11); | 118 std::string test_path = spec.substr(spec.find("/inspector/") + 11); |
119 base::DictionaryValue settings; | 119 base::DictionaryValue settings; |
120 settings.SetString("testPath", base::GetQuotedJSONString(spec)); | 120 settings.SetString("testPath", base::GetQuotedJSONString(spec)); |
121 std::string settings_string; | 121 std::string settings_string; |
122 base::JSONWriter::Write(&settings, &settings_string); | 122 base::JSONWriter::Write(settings, &settings_string); |
123 test_runner_->ShowDevTools(settings_string, std::string()); | 123 test_runner_->ShowDevTools(settings_string, std::string()); |
124 } | 124 } |
125 if (spec.find("/viewsource/") != std::string::npos) { | 125 if (spec.find("/viewsource/") != std::string::npos) { |
126 test_runner_->setShouldEnableViewSource(true); | 126 test_runner_->setShouldEnableViewSource(true); |
127 test_runner_->setShouldGeneratePixelResults(false); | 127 test_runner_->setShouldGeneratePixelResults(false); |
128 test_runner_->setShouldDumpAsMarkup(true); | 128 test_runner_->setShouldDumpAsMarkup(true); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) { | 132 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { | 170 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { |
171 if (!test_runner_->UseMockTheme()) | 171 if (!test_runner_->UseMockTheme()) |
172 return 0; | 172 return 0; |
173 if (!theme_engine_.get()) | 173 if (!theme_engine_.get()) |
174 theme_engine_.reset(new MockWebThemeEngine()); | 174 theme_engine_.reset(new MockWebThemeEngine()); |
175 return theme_engine_.get(); | 175 return theme_engine_.get(); |
176 } | 176 } |
177 | 177 |
178 } // namespace content | 178 } // namespace content |
OLD | NEW |