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

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

Issue 2742623002: DevTools: improve test infrastructure w/ devtools driving the test (Closed)
Patch Set: fixup Created 3 years, 9 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/test_runner/test_interfaces.h" 5 #include "content/shell/test_runner/test_interfaces.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 test_runner_->setShouldGeneratePixelResults(false); 97 test_runner_->setShouldGeneratePixelResults(false);
98 } 98 }
99 if (spec.find("/inspector/") != std::string::npos || 99 if (spec.find("/inspector/") != std::string::npos ||
100 spec.find("/inspector-enabled/") != std::string::npos) { 100 spec.find("/inspector-enabled/") != std::string::npos) {
101 test_runner_->ClearDevToolsLocalStorage(); 101 test_runner_->ClearDevToolsLocalStorage();
102 test_runner_->SetV8CacheDisabled(true); 102 test_runner_->SetV8CacheDisabled(true);
103 } else { 103 } else {
104 test_runner_->SetV8CacheDisabled(false); 104 test_runner_->SetV8CacheDisabled(false);
105 } 105 }
106 if (spec.find("/inspector/") != std::string::npos && 106 if (spec.find("/inspector/") != std::string::npos &&
107 spec.find("integration_test_runner.html") == std::string::npos &&
107 spec.find("unit_test_runner.html") == std::string::npos) { 108 spec.find("unit_test_runner.html") == std::string::npos) {
108 // Subfolder name determines default panel to open. 109 // Subfolder name determines default panel to open.
109 std::string test_path = spec.substr(spec.find("/inspector/") + 11); 110 std::string test_path = spec.substr(spec.find("/inspector/") + 11);
110 base::DictionaryValue settings; 111 base::DictionaryValue settings;
111 settings.SetString("testPath", base::GetQuotedJSONString(spec)); 112 settings.SetString("testPath", base::GetQuotedJSONString(spec));
112 std::string settings_string; 113 std::string settings_string;
113 base::JSONWriter::Write(settings, &settings_string); 114 base::JSONWriter::Write(settings, &settings_string);
114 test_runner_->ShowDevTools(settings_string, std::string()); 115 test_runner_->ShowDevTools(settings_string, std::string());
115 } 116 }
116 if (spec.find("/viewsource/") != std::string::npos) { 117 if (spec.find("/viewsource/") != std::string::npos) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 156
156 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { 157 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() {
157 if (!test_runner_->UseMockTheme()) 158 if (!test_runner_->UseMockTheme())
158 return 0; 159 return 0;
159 if (!theme_engine_.get()) 160 if (!theme_engine_.get())
160 theme_engine_.reset(new MockWebThemeEngine()); 161 theme_engine_.reset(new MockWebThemeEngine());
161 return theme_engine_.get(); 162 return theme_engine_.get();
162 } 163 }
163 164
164 } // namespace test_runner 165 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698