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 "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "cc/layers/texture_layer.h" | 8 #include "cc/layers/texture_layer.h" |
9 #include "components/test_runner/web_task.h" | 9 #include "components/test_runner/web_task.h" |
10 #include "components/test_runner/web_test_interfaces.h" | 10 #include "components/test_runner/web_test_interfaces.h" |
11 #include "components/test_runner/web_test_proxy.h" | 11 #include "components/test_runner/web_test_proxy.h" |
12 #include "third_party/WebKit/public/platform/Platform.h" | 12 #include "third_party/WebKit/public/platform/Platform.h" |
13 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
| 14 #include "third_party/WebKit/public/platform/WebTaskRunner.h" |
14 #include "third_party/WebKit/public/platform/WebThread.h" | 15 #include "third_party/WebKit/public/platform/WebThread.h" |
15 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 16 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
16 #include "third_party/WebKit/public/platform/WebURL.h" | 17 #include "third_party/WebKit/public/platform/WebURL.h" |
17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
18 | 19 |
19 namespace html_viewer { | 20 namespace html_viewer { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 class InvokeTaskHelper : public blink::WebThread::Task { | 24 class InvokeTaskHelper : public blink::WebTaskRunner::Task { |
24 public: | 25 public: |
25 InvokeTaskHelper(scoped_ptr<test_runner::WebTask> task) | 26 InvokeTaskHelper(scoped_ptr<test_runner::WebTask> task) |
26 : task_(task.Pass()) {} | 27 : task_(task.Pass()) {} |
27 | 28 |
28 // WebThread::Task implementation: | 29 // WebThread::Task implementation: |
29 void run() override { task_->run(); } | 30 void run() override { task_->run(); } |
30 | 31 |
31 private: | 32 private: |
32 scoped_ptr<test_runner::WebTask> task_; | 33 scoped_ptr<test_runner::WebTask> task_; |
33 }; | 34 }; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void WebTestDelegateImpl::DidChangeBatteryStatus( | 82 void WebTestDelegateImpl::DidChangeBatteryStatus( |
82 const blink::WebBatteryStatus& status) { | 83 const blink::WebBatteryStatus& status) { |
83 NOTIMPLEMENTED(); | 84 NOTIMPLEMENTED(); |
84 } | 85 } |
85 | 86 |
86 void WebTestDelegateImpl::PrintMessage(const std::string& message) { | 87 void WebTestDelegateImpl::PrintMessage(const std::string& message) { |
87 fprintf(stderr, "%s", message.c_str()); | 88 fprintf(stderr, "%s", message.c_str()); |
88 } | 89 } |
89 | 90 |
90 void WebTestDelegateImpl::PostTask(test_runner::WebTask* task) { | 91 void WebTestDelegateImpl::PostTask(test_runner::WebTask* task) { |
91 blink::Platform::current()->currentThread()->postTask( | 92 blink::Platform::current()->currentThread()->taskRunner()->postTask( |
92 blink::WebTraceLocation(__FUNCTION__, __FILE__), | 93 blink::WebTraceLocation(__FUNCTION__, __FILE__), |
93 new InvokeTaskHelper(make_scoped_ptr(task))); | 94 new InvokeTaskHelper(make_scoped_ptr(task))); |
94 } | 95 } |
95 | 96 |
96 void WebTestDelegateImpl::PostDelayedTask(test_runner::WebTask* task, | 97 void WebTestDelegateImpl::PostDelayedTask(test_runner::WebTask* task, |
97 long long ms) { | 98 long long ms) { |
98 blink::Platform::current()->currentThread()->postDelayedTask( | 99 blink::Platform::current()->currentThread()->taskRunner()->postDelayedTask( |
99 blink::WebTraceLocation(__FUNCTION__, __FILE__), | 100 blink::WebTraceLocation(__FUNCTION__, __FILE__), |
100 new InvokeTaskHelper(make_scoped_ptr(task)), ms); | 101 new InvokeTaskHelper(make_scoped_ptr(task)), ms); |
101 } | 102 } |
102 | 103 |
103 blink::WebString WebTestDelegateImpl::RegisterIsolatedFileSystem( | 104 blink::WebString WebTestDelegateImpl::RegisterIsolatedFileSystem( |
104 const blink::WebVector<blink::WebString>& absolute_filenames) { | 105 const blink::WebVector<blink::WebString>& absolute_filenames) { |
105 NOTIMPLEMENTED(); | 106 NOTIMPLEMENTED(); |
106 return blink::WebString(); | 107 return blink::WebString(); |
107 } | 108 } |
108 | 109 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 } | 327 } |
327 | 328 |
328 void WebTestDelegateImpl::OnWebTestProxyBaseDestroy( | 329 void WebTestDelegateImpl::OnWebTestProxyBaseDestroy( |
329 test_runner::WebTestProxyBase* base) { | 330 test_runner::WebTestProxyBase* base) { |
330 DCHECK_EQ(proxy_, base); | 331 DCHECK_EQ(proxy_, base); |
331 dump_tree_ = proxy_->CaptureTree(false, false); | 332 dump_tree_ = proxy_->CaptureTree(false, false); |
332 proxy_ = nullptr; | 333 proxy_ = nullptr; |
333 } | 334 } |
334 | 335 |
335 } // namespace html_viewer | 336 } // namespace html_viewer |
OLD | NEW |