| 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/html_viewer/ax_provider_impl.h" | 5 #include "components/html_viewer/ax_provider_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "components/html_viewer/blink_platform_impl.h" | 9 #include "components/html_viewer/blink_platform_impl.h" |
| 10 #include "components/scheduler/renderer/renderer_scheduler.h" | 10 #include "components/scheduler/renderer/renderer_scheduler.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 class TestWebViewClient : public WebViewClient { | 41 class TestWebViewClient : public WebViewClient { |
| 42 public: | 42 public: |
| 43 bool allowsBrokenNullLayerTreeView() const override { return true; } | 43 bool allowsBrokenNullLayerTreeView() const override { return true; } |
| 44 virtual ~TestWebViewClient() {} | 44 virtual ~TestWebViewClient() {} |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 class AxProviderImplTest : public testing::Test { | 47 class AxProviderImplTest : public testing::Test { |
| 48 public: | 48 public: |
| 49 AxProviderImplTest() | 49 AxProviderImplTest() |
| 50 : renderer_scheduler_(scheduler::RendererScheduler::Create()) { | 50 : message_loop_(new base::MessageLoopForUI()), |
| 51 renderer_scheduler_(scheduler::RendererScheduler::Create()) { |
| 51 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 52 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
| 52 gin::V8Initializer::LoadV8Snapshot(); | 53 gin::V8Initializer::LoadV8Snapshot(); |
| 53 #endif | 54 #endif |
| 54 blink::initialize( | 55 blink::initialize( |
| 55 new html_viewer::BlinkPlatformImpl(nullptr, renderer_scheduler_.get())); | 56 new html_viewer::BlinkPlatformImpl(nullptr, renderer_scheduler_.get())); |
| 56 } | 57 } |
| 57 | 58 |
| 58 ~AxProviderImplTest() override { blink::shutdown(); } | 59 ~AxProviderImplTest() override { |
| 60 renderer_scheduler_->Shutdown(); |
| 61 message_loop_.reset(); |
| 62 blink::shutdown(); |
| 63 } |
| 59 | 64 |
| 60 private: | 65 private: |
| 61 base::MessageLoopForUI message_loop; | 66 scoped_ptr<base::MessageLoopForUI> message_loop_; |
| 62 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler_; | 67 scoped_ptr<scheduler::RendererScheduler> renderer_scheduler_; |
| 63 }; | 68 }; |
| 64 | 69 |
| 65 struct NodeCatcher { | 70 struct NodeCatcher { |
| 66 void OnNodes(Array<AxNodePtr> nodes) { this->nodes = nodes.Pass(); } | 71 void OnNodes(Array<AxNodePtr> nodes) { this->nodes = nodes.Pass(); } |
| 67 Array<AxNodePtr> nodes; | 72 Array<AxNodePtr> nodes; |
| 68 }; | 73 }; |
| 69 | 74 |
| 70 AxNodePtr CreateNode(int id, | 75 AxNodePtr CreateNode(int id, |
| 71 int parent_id, | 76 int parent_id, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 "", | 188 "", |
| 184 "")); | 189 "")); |
| 185 } | 190 } |
| 186 } | 191 } |
| 187 | 192 |
| 188 // TODO(aa): Test bounds. | 193 // TODO(aa): Test bounds. |
| 189 // TODO(aa): Test sibling ordering of foo/bar/baz. | 194 // TODO(aa): Test sibling ordering of foo/bar/baz. |
| 190 | 195 |
| 191 view->close(); | 196 view->close(); |
| 192 } | 197 } |
| OLD | NEW |