| 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/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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 base::JSONWriter::Write(settings, &settings_string); | 113 base::JSONWriter::Write(settings, &settings_string); |
| 114 test_runner_->ShowDevTools(settings_string, std::string()); | 114 test_runner_->ShowDevTools(settings_string, std::string()); |
| 115 } | 115 } |
| 116 if (spec.find("/viewsource/") != std::string::npos) { | 116 if (spec.find("/viewsource/") != std::string::npos) { |
| 117 test_runner_->setShouldEnableViewSource(true); | 117 test_runner_->setShouldEnableViewSource(true); |
| 118 test_runner_->setShouldGeneratePixelResults(false); | 118 test_runner_->setShouldGeneratePixelResults(false); |
| 119 test_runner_->setShouldDumpAsMarkup(true); | 119 test_runner_->setShouldDumpAsMarkup(true); |
| 120 } | 120 } |
| 121 if (spec.find("/external/wpt/") != std::string::npos || | 121 if (spec.find("/external/wpt/") != std::string::npos || |
| 122 spec.find("/external/csswg-test/") != std::string::npos || | 122 spec.find("/external/csswg-test/") != std::string::npos || |
| 123 spec.find("://web-platform.test") != std::string::npos) | 123 spec.find("://web-platform.test") != std::string::npos || |
| 124 spec.find("/harness-tests/wpt/") != std::string::npos) |
| 124 test_runner_->set_is_web_platform_tests_mode(); | 125 test_runner_->set_is_web_platform_tests_mode(); |
| 125 } | 126 } |
| 126 | 127 |
| 127 void TestInterfaces::WindowOpened(WebViewTestProxyBase* proxy) { | 128 void TestInterfaces::WindowOpened(WebViewTestProxyBase* proxy) { |
| 128 window_list_.push_back(proxy); | 129 window_list_.push_back(proxy); |
| 129 } | 130 } |
| 130 | 131 |
| 131 void TestInterfaces::WindowClosed(WebViewTestProxyBase* proxy) { | 132 void TestInterfaces::WindowClosed(WebViewTestProxyBase* proxy) { |
| 132 std::vector<WebViewTestProxyBase*>::iterator pos = | 133 std::vector<WebViewTestProxyBase*>::iterator pos = |
| 133 std::find(window_list_.begin(), window_list_.end(), proxy); | 134 std::find(window_list_.begin(), window_list_.end(), proxy); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 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 |
| OLD | NEW |