| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/common/devtools/ash_devtools_dom_agent.h" | 5 #include "ash/common/devtools/ash_devtools_dom_agent.h" |
| 6 | 6 |
| 7 #include "ash/common/test/ash_test.h" | 7 #include "ash/common/test/ash_test.h" |
| 8 #include "ash/common/wm_lookup.h" | 8 #include "ash/common/wm_lookup.h" |
| 9 #include "ash/common/wm_root_window_controller.h" | 9 #include "ash/common/wm_root_window_controller.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| 11 #include "ash/common/wm_window.h" | 11 #include "ash/common/wm_window.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "ui/views/widget/native_widget_private.h" | 14 #include "ui/views/widget/native_widget_private.h" |
| 14 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 namespace { | 18 namespace { |
| 18 using namespace ui::devtools::protocol; | 19 using namespace ui::devtools::protocol; |
| 19 const int kDefaultChildNodeCount = -1; | 20 const int kDefaultChildNodeCount = -1; |
| 20 | 21 |
| 21 class TestView : public views::View { | 22 class TestView : public views::View { |
| 22 public: | 23 public: |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 widget, kShellWindowId_DefaultContainer, ¶ms); | 134 widget, kShellWindowId_DefaultContainer, ¶ms); |
| 134 widget->Init(params); | 135 widget->Init(params); |
| 135 return widget->native_widget_private(); | 136 return widget->native_widget_private(); |
| 136 } | 137 } |
| 137 | 138 |
| 138 void SetUp() override { | 139 void SetUp() override { |
| 139 AshTest::SetUp(); | 140 AshTest::SetUp(); |
| 140 fake_frontend_channel_ = base::MakeUnique<FakeFrontendChannel>(); | 141 fake_frontend_channel_ = base::MakeUnique<FakeFrontendChannel>(); |
| 141 uber_dispatcher_ = | 142 uber_dispatcher_ = |
| 142 base::MakeUnique<UberDispatcher>(fake_frontend_channel_.get()); | 143 base::MakeUnique<UberDispatcher>(fake_frontend_channel_.get()); |
| 143 dom_agent_ = | 144 dom_agent_ = base::MakeUnique<devtools::AshDevToolsDOMAgent>( |
| 144 base::MakeUnique<devtools::AshDevToolsDOMAgent>(WmShell::Get()); | 145 WmShell::Get(), base::ThreadTaskRunnerHandle::Get()); |
| 145 dom_agent_->Init(uber_dispatcher_.get()); | 146 dom_agent_->Init(uber_dispatcher_.get()); |
| 146 } | 147 } |
| 147 | 148 |
| 148 void TearDown() override { | 149 void TearDown() override { |
| 149 dom_agent_.reset(); | 150 dom_agent_.reset(); |
| 150 uber_dispatcher_.reset(); | 151 uber_dispatcher_.reset(); |
| 151 fake_frontend_channel_.reset(); | 152 fake_frontend_channel_.reset(); |
| 152 AshTest::TearDown(); | 153 AshTest::TearDown(); |
| 153 } | 154 } |
| 154 | 155 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 Compare(target_view, target_view_node); | 469 Compare(target_view, target_view_node); |
| 469 Compare(child_view, child_view_node); | 470 Compare(child_view, child_view_node); |
| 470 parent_view->RemoveChildView(child_view); | 471 parent_view->RemoveChildView(child_view); |
| 471 target_view->AddChildView(child_view); | 472 target_view->AddChildView(child_view); |
| 472 ExpectChildNodeRemoved(parent_view_node->getNodeId(), | 473 ExpectChildNodeRemoved(parent_view_node->getNodeId(), |
| 473 child_view_node->getNodeId()); | 474 child_view_node->getNodeId()); |
| 474 ExpectChildNodeInserted(target_view_node->getNodeId(), 0); | 475 ExpectChildNodeInserted(target_view_node->getNodeId(), 0); |
| 475 } | 476 } |
| 476 | 477 |
| 477 } // namespace ash | 478 } // namespace ash |
| OLD | NEW |