| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/html_viewer/web_test_delegate_impl.h" | 5 #include "components/html_viewer/web_test_delegate_impl.h" |
| 6 | 6 |
| 7 #include <iostream> |
| 8 |
| 7 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 8 #include "cc/layers/texture_layer.h" | 10 #include "cc/layers/texture_layer.h" |
| 9 #include "components/test_runner/web_task.h" | 11 #include "components/test_runner/web_task.h" |
| 10 #include "components/test_runner/web_test_interfaces.h" | 12 #include "components/test_runner/web_test_interfaces.h" |
| 11 #include "components/test_runner/web_test_proxy.h" | 13 #include "components/test_runner/web_test_proxy.h" |
| 12 #include "third_party/WebKit/public/platform/Platform.h" | 14 #include "third_party/WebKit/public/platform/Platform.h" |
| 13 #include "third_party/WebKit/public/platform/WebString.h" | 15 #include "third_party/WebKit/public/platform/WebString.h" |
| 14 #include "third_party/WebKit/public/platform/WebThread.h" | 16 #include "third_party/WebKit/public/platform/WebThread.h" |
| 15 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 17 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
| 16 #include "third_party/WebKit/public/platform/WebURL.h" | 18 #include "third_party/WebKit/public/platform/WebURL.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void WebTestDelegateImpl::ResetScreenOrientation() { | 79 void WebTestDelegateImpl::ResetScreenOrientation() { |
| 78 NOTIMPLEMENTED(); | 80 NOTIMPLEMENTED(); |
| 79 } | 81 } |
| 80 | 82 |
| 81 void WebTestDelegateImpl::DidChangeBatteryStatus( | 83 void WebTestDelegateImpl::DidChangeBatteryStatus( |
| 82 const blink::WebBatteryStatus& status) { | 84 const blink::WebBatteryStatus& status) { |
| 83 NOTIMPLEMENTED(); | 85 NOTIMPLEMENTED(); |
| 84 } | 86 } |
| 85 | 87 |
| 86 void WebTestDelegateImpl::PrintMessage(const std::string& message) { | 88 void WebTestDelegateImpl::PrintMessage(const std::string& message) { |
| 87 fprintf(stderr, "%s", message.c_str()); | 89 std::cout << message; |
| 88 } | 90 } |
| 89 | 91 |
| 90 void WebTestDelegateImpl::PostTask(test_runner::WebTask* task) { | 92 void WebTestDelegateImpl::PostTask(test_runner::WebTask* task) { |
| 91 blink::Platform::current()->currentThread()->postTask( | 93 blink::Platform::current()->currentThread()->postTask( |
| 92 blink::WebTraceLocation(__FUNCTION__, __FILE__), | 94 blink::WebTraceLocation(__FUNCTION__, __FILE__), |
| 93 new InvokeTaskHelper(make_scoped_ptr(task))); | 95 new InvokeTaskHelper(make_scoped_ptr(task))); |
| 94 } | 96 } |
| 95 | 97 |
| 96 void WebTestDelegateImpl::PostDelayedTask(test_runner::WebTask* task, | 98 void WebTestDelegateImpl::PostDelayedTask(test_runner::WebTask* task, |
| 97 long long ms) { | 99 long long ms) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 const std::string& resource) { | 222 const std::string& resource) { |
| 221 NOTIMPLEMENTED(); | 223 NOTIMPLEMENTED(); |
| 222 return std::string(); | 224 return std::string(); |
| 223 } | 225 } |
| 224 | 226 |
| 225 void WebTestDelegateImpl::SetLocale(const std::string& locale) { | 227 void WebTestDelegateImpl::SetLocale(const std::string& locale) { |
| 226 NOTIMPLEMENTED(); | 228 NOTIMPLEMENTED(); |
| 227 } | 229 } |
| 228 | 230 |
| 229 void WebTestDelegateImpl::TestFinished() { | 231 void WebTestDelegateImpl::TestFinished() { |
| 232 std::cout << "Content-Type: text/plain\n"; |
| 233 std::cout << (proxy_ ? proxy_->CaptureTree(false, false) : dump_tree_); |
| 234 std::cout << "#EOF\n"; |
| 235 |
| 230 test_interfaces_->SetTestIsRunning(false); | 236 test_interfaces_->SetTestIsRunning(false); |
| 231 fprintf(stderr, "%s", proxy_ ? proxy_->CaptureTree(false, false).c_str() | |
| 232 : dump_tree_.c_str()); | |
| 233 } | 237 } |
| 234 | 238 |
| 235 void WebTestDelegateImpl::CloseRemainingWindows() { | 239 void WebTestDelegateImpl::CloseRemainingWindows() { |
| 236 NOTIMPLEMENTED(); | 240 NOTIMPLEMENTED(); |
| 237 } | 241 } |
| 238 | 242 |
| 239 void WebTestDelegateImpl::DeleteAllCookies() { | 243 void WebTestDelegateImpl::DeleteAllCookies() { |
| 240 NOTIMPLEMENTED(); | 244 NOTIMPLEMENTED(); |
| 241 } | 245 } |
| 242 | 246 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 330 } |
| 327 | 331 |
| 328 void WebTestDelegateImpl::OnWebTestProxyBaseDestroy( | 332 void WebTestDelegateImpl::OnWebTestProxyBaseDestroy( |
| 329 test_runner::WebTestProxyBase* base) { | 333 test_runner::WebTestProxyBase* base) { |
| 330 DCHECK_EQ(proxy_, base); | 334 DCHECK_EQ(proxy_, base); |
| 331 dump_tree_ = proxy_->CaptureTree(false, false); | 335 dump_tree_ = proxy_->CaptureTree(false, false); |
| 332 proxy_ = nullptr; | 336 proxy_ = nullptr; |
| 333 } | 337 } |
| 334 | 338 |
| 335 } // namespace html_viewer | 339 } // namespace html_viewer |
| OLD | NEW |