Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: content/shell/renderer/test_runner/test_interfaces.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix platform specific stuff Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 if (spec.find("/inspector/") != std::string::npos || 118 if (spec.find("/inspector/") != std::string::npos ||
119 spec.find("/inspector-enabled/") != std::string::npos) 119 spec.find("/inspector-enabled/") != std::string::npos)
120 test_runner_->ClearDevToolsLocalStorage(); 120 test_runner_->ClearDevToolsLocalStorage();
121 if (spec.find("/inspector/") != std::string::npos) { 121 if (spec.find("/inspector/") != std::string::npos) {
122 // Subfolder name determines default panel to open. 122 // Subfolder name determines default panel to open.
123 std::string test_path = spec.substr(spec.find("/inspector/") + 11); 123 std::string test_path = spec.substr(spec.find("/inspector/") + 11);
124 base::DictionaryValue settings; 124 base::DictionaryValue settings;
125 settings.SetString("testPath", base::GetQuotedJSONString(spec)); 125 settings.SetString("testPath", base::GetQuotedJSONString(spec));
126 std::string settings_string; 126 std::string settings_string;
127 base::JSONWriter::Write(&settings, &settings_string); 127 base::JSONWriter::Write(settings, &settings_string);
128 test_runner_->ShowDevTools(settings_string, std::string()); 128 test_runner_->ShowDevTools(settings_string, std::string());
129 } 129 }
130 if (spec.find("/viewsource/") != std::string::npos) { 130 if (spec.find("/viewsource/") != std::string::npos) {
131 test_runner_->setShouldEnableViewSource(true); 131 test_runner_->setShouldEnableViewSource(true);
132 test_runner_->setShouldGeneratePixelResults(false); 132 test_runner_->setShouldGeneratePixelResults(false);
133 test_runner_->setShouldDumpAsMarkup(true); 133 test_runner_->setShouldDumpAsMarkup(true);
134 } 134 }
135 } 135 }
136 136
137 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) { 137 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { 175 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() {
176 if (!test_runner_->UseMockTheme()) 176 if (!test_runner_->UseMockTheme())
177 return 0; 177 return 0;
178 if (!theme_engine_.get()) 178 if (!theme_engine_.get())
179 theme_engine_.reset(new MockWebThemeEngine()); 179 theme_engine_.reset(new MockWebThemeEngine());
180 return theme_engine_.get(); 180 return theme_engine_.get();
181 } 181 }
182 182
183 } // namespace content 183 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698