| 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 "components/test_runner/test_interfaces.h" | 5 #include "components/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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 test_runner_->setShouldGeneratePixelResults(generate_pixels); | 89 test_runner_->setShouldGeneratePixelResults(generate_pixels); |
| 90 if (spec.find("loading/") != std::string::npos) | 90 if (spec.find("loading/") != std::string::npos) |
| 91 test_runner_->setShouldDumpFrameLoadCallbacks(true); | 91 test_runner_->setShouldDumpFrameLoadCallbacks(true); |
| 92 if (spec.find("/dumpAsText/") != std::string::npos) { | 92 if (spec.find("/dumpAsText/") != std::string::npos) { |
| 93 test_runner_->setShouldDumpAsText(true); | 93 test_runner_->setShouldDumpAsText(true); |
| 94 test_runner_->setShouldGeneratePixelResults(false); | 94 test_runner_->setShouldGeneratePixelResults(false); |
| 95 } | 95 } |
| 96 if (spec.find("/inspector/") != std::string::npos || | 96 if (spec.find("/inspector/") != std::string::npos || |
| 97 spec.find("/inspector-enabled/") != std::string::npos) | 97 spec.find("/inspector-enabled/") != std::string::npos) |
| 98 test_runner_->ClearDevToolsLocalStorage(); | 98 test_runner_->ClearDevToolsLocalStorage(); |
| 99 if (spec.find("/inspector/") != std::string::npos) { | 99 if (spec.find("/inspector/") != std::string::npos && |
| 100 spec.find("unit_test_runner.html") == std::string::npos) { |
| 100 // Subfolder name determines default panel to open. | 101 // Subfolder name determines default panel to open. |
| 101 std::string test_path = spec.substr(spec.find("/inspector/") + 11); | 102 std::string test_path = spec.substr(spec.find("/inspector/") + 11); |
| 102 base::DictionaryValue settings; | 103 base::DictionaryValue settings; |
| 103 settings.SetString("testPath", base::GetQuotedJSONString(spec)); | 104 settings.SetString("testPath", base::GetQuotedJSONString(spec)); |
| 104 std::string settings_string; | 105 std::string settings_string; |
| 105 base::JSONWriter::Write(settings, &settings_string); | 106 base::JSONWriter::Write(settings, &settings_string); |
| 106 test_runner_->ShowDevTools(settings_string, std::string()); | 107 test_runner_->ShowDevTools(settings_string, std::string()); |
| 107 } | 108 } |
| 108 if (spec.find("/viewsource/") != std::string::npos) { | 109 if (spec.find("/viewsource/") != std::string::npos) { |
| 109 test_runner_->setShouldEnableViewSource(true); | 110 test_runner_->setShouldEnableViewSource(true); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 148 |
| 148 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { | 149 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { |
| 149 if (!test_runner_->UseMockTheme()) | 150 if (!test_runner_->UseMockTheme()) |
| 150 return 0; | 151 return 0; |
| 151 if (!theme_engine_.get()) | 152 if (!theme_engine_.get()) |
| 152 theme_engine_.reset(new MockWebThemeEngine()); | 153 theme_engine_.reset(new MockWebThemeEngine()); |
| 153 return theme_engine_.get(); | 154 return theme_engine_.get(); |
| 154 } | 155 } |
| 155 | 156 |
| 156 } // namespace test_runner | 157 } // namespace test_runner |
| OLD | NEW |