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

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

Issue 583113002: Abstract class WebTestDelegate to chromium c++ style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test_runner Created 6 years, 3 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/logging.h" 10 #include "base/logging.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 std::string spec = GURL(test_url).spec(); 105 std::string spec = GURL(test_url).spec();
106 test_runner_->setShouldGeneratePixelResults(generate_pixels); 106 test_runner_->setShouldGeneratePixelResults(generate_pixels);
107 if (spec.find("loading/") != std::string::npos) 107 if (spec.find("loading/") != std::string::npos)
108 test_runner_->setShouldDumpFrameLoadCallbacks(true); 108 test_runner_->setShouldDumpFrameLoadCallbacks(true);
109 if (spec.find("/dumpAsText/") != std::string::npos) { 109 if (spec.find("/dumpAsText/") != std::string::npos) {
110 test_runner_->setShouldDumpAsText(true); 110 test_runner_->setShouldDumpAsText(true);
111 test_runner_->setShouldGeneratePixelResults(false); 111 test_runner_->setShouldGeneratePixelResults(false);
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 settings = ""; 118 std::string settings = "";
119 std::string test_path = spec.substr(spec.find("/inspector/") + 11); 119 std::string test_path = spec.substr(spec.find("/inspector/") + 11);
120 size_t slash_index = test_path.find("/"); 120 size_t slash_index = test_path.find("/");
121 if (slash_index != std::string::npos) { 121 if (slash_index != std::string::npos) {
122 settings = base::StringPrintf("{\"lastActivePanel\":\"\\\"%s\\\"\"}", 122 settings = base::StringPrintf("{\"lastActivePanel\":\"\\\"%s\\\"\"}",
123 test_path.substr(0, slash_index).c_str()); 123 test_path.substr(0, slash_index).c_str());
124 } 124 }
125 test_runner_->showDevTools(settings, std::string()); 125 test_runner_->ShowDevTools(settings, std::string());
126 } 126 }
127 if (spec.find("/viewsource/") != std::string::npos) { 127 if (spec.find("/viewsource/") != std::string::npos) {
128 test_runner_->setShouldEnableViewSource(true); 128 test_runner_->setShouldEnableViewSource(true);
129 test_runner_->setShouldGeneratePixelResults(false); 129 test_runner_->setShouldGeneratePixelResults(false);
130 test_runner_->setShouldDumpAsMarkup(true); 130 test_runner_->setShouldDumpAsMarkup(true);
131 } 131 }
132 } 132 }
133 133
134 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) { 134 void TestInterfaces::WindowOpened(WebTestProxyBase* proxy) {
135 window_list_.push_back(proxy); 135 window_list_.push_back(proxy);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (!theme_engine_.get()) 176 if (!theme_engine_.get())
177 theme_engine_.reset(new MockWebThemeEngineMac()); 177 theme_engine_.reset(new MockWebThemeEngineMac());
178 #else 178 #else
179 if (!theme_engine_.get()) 179 if (!theme_engine_.get())
180 theme_engine_.reset(new MockWebThemeEngine()); 180 theme_engine_.reset(new MockWebThemeEngine());
181 #endif 181 #endif
182 return theme_engine_.get(); 182 return theme_engine_.get();
183 } 183 }
184 184
185 } // namespace content 185 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/spell_check_client.cc ('k') | content/shell/renderer/test_runner/test_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698