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 "base/memory/ptr_util.h" | 5 #include "base/memory/ptr_util.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "components/ui_devtools/views/ui_devtools_css_agent.h" | 7 #include "components/ui_devtools/views/ui_devtools_css_agent.h" |
8 #include "components/ui_devtools/views/ui_devtools_dom_agent.h" | 8 #include "components/ui_devtools/views/ui_devtools_dom_agent.h" |
9 #include "components/ui_devtools/views/ui_element.h" | 9 #include "components/ui_devtools/views/ui_element.h" |
10 #include "components/ui_devtools/views/view_element.h" | 10 #include "components/ui_devtools/views/view_element.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 window->SetBounds(gfx::Rect()); | 215 window->SetBounds(gfx::Rect()); |
216 parent->AddChild(window.get()); | 216 parent->AddChild(window.get()); |
217 window->Show(); | 217 window->Show(); |
218 return window; | 218 return window; |
219 } | 219 } |
220 | 220 |
221 void SetUp() override { | 221 void SetUp() override { |
222 fake_frontend_channel_ = base::MakeUnique<FakeFrontendChannel>(); | 222 fake_frontend_channel_ = base::MakeUnique<FakeFrontendChannel>(); |
223 uber_dispatcher_ = | 223 uber_dispatcher_ = |
224 base::MakeUnique<UberDispatcher>(fake_frontend_channel_.get()); | 224 base::MakeUnique<UberDispatcher>(fake_frontend_channel_.get()); |
225 dom_agent_ = base::MakeUnique<ui_devtools::UIDevToolsDOMAgent>(); | 225 dom_agent_ = base::MakeUnique<ui_devtools::UIDevToolsDOMAgent>(nullptr); |
226 dom_agent_->Init(uber_dispatcher_.get()); | 226 dom_agent_->Init(uber_dispatcher_.get()); |
227 css_agent_ = | 227 css_agent_ = |
228 base::MakeUnique<ui_devtools::UIDevToolsCSSAgent>(dom_agent_.get()); | 228 base::MakeUnique<ui_devtools::UIDevToolsCSSAgent>(dom_agent_.get()); |
229 css_agent_->Init(uber_dispatcher_.get()); | 229 css_agent_->Init(uber_dispatcher_.get()); |
230 css_agent_->enable(); | 230 css_agent_->enable(); |
231 | 231 |
232 // We need to create |dom_agent| first to observe creation of | 232 // We need to create |dom_agent| first to observe creation of |
233 // WindowTreeHosts in ViewTestBase::SetUp(). | 233 // WindowTreeHosts in ViewTestBase::SetUp(). |
234 views::ViewsTestBase::SetUp(); | 234 views::ViewsTestBase::SetUp(); |
235 | 235 |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 SetStyleTexts(root_view_node, "\nheight: 73;\n ", true); | 872 SetStyleTexts(root_view_node, "\nheight: 73;\n ", true); |
873 EXPECT_EQ(gfx::Rect(25, 35, 45, 73), root_view->bounds()); | 873 EXPECT_EQ(gfx::Rect(25, 35, 45, 73), root_view->bounds()); |
874 | 874 |
875 SetStyleTexts(root_view_node, "\nx: 10; y: 23; width: 52;\nvisibility: 1;\n", | 875 SetStyleTexts(root_view_node, "\nx: 10; y: 23; width: 52;\nvisibility: 1;\n", |
876 true); | 876 true); |
877 EXPECT_EQ(gfx::Rect(10, 23, 52, 73), root_view->bounds()); | 877 EXPECT_EQ(gfx::Rect(10, 23, 52, 73), root_view->bounds()); |
878 EXPECT_TRUE(root_view->visible()); | 878 EXPECT_TRUE(root_view->visible()); |
879 } | 879 } |
880 | 880 |
881 } // namespace ui_devtools | 881 } // namespace ui_devtools |
OLD | NEW |