| 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_css_agent.h" | 5 #include "ash/common/devtools/ash_devtools_css_agent.h" |
| 6 #include "ash/common/devtools/ash_devtools_dom_agent.h" | 6 #include "ash/common/devtools/ash_devtools_dom_agent.h" |
| 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" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 target_node_children->get(target_node_children->length() - 1); | 393 target_node_children->get(target_node_children->length() - 1); |
| 394 DOM::Node* child_node = parent_node->getChildren(nullptr)->get(0); | 394 DOM::Node* child_node = parent_node->getChildren(nullptr)->get(0); |
| 395 | 395 |
| 396 Compare(target_window, target_node); | 396 Compare(target_window, target_node); |
| 397 Compare(child_window, child_node); | 397 Compare(child_window, child_node); |
| 398 target_window->AddChild(child_window); | 398 target_window->AddChild(child_window); |
| 399 ExpectChildNodeRemoved(parent_node->getNodeId(), child_node->getNodeId()); | 399 ExpectChildNodeRemoved(parent_node->getNodeId(), child_node->getNodeId()); |
| 400 ExpectChildNodeInserted(target_node->getNodeId(), sibling_node->getNodeId()); | 400 ExpectChildNodeInserted(target_node->getNodeId(), sibling_node->getNodeId()); |
| 401 } | 401 } |
| 402 | 402 |
| 403 #if defined(OS_WIN) | 403 TEST_F(AshDevToolsTest, WindowReorganizedChildNodeRemovedAndInserted) { |
| 404 #define MAYBE_WindowReorganizedChildNodeRemovedAndInserted \ | |
| 405 DISABLED_WindowReorganizedChildNodeRemovedAndInserted | |
| 406 #else | |
| 407 #define MAYBE_WindowReorganizedChildNodeRemovedAndInserted \ | |
| 408 WindowReorganizedChildNodeRemovedAndInserted | |
| 409 #endif // defined(OS_WIN) | |
| 410 TEST_F(AshDevToolsTest, MAYBE_WindowReorganizedChildNodeRemovedAndInserted) { | |
| 411 WmWindow* root_window = WmShell::Get()->GetPrimaryRootWindow(); | 404 WmWindow* root_window = WmShell::Get()->GetPrimaryRootWindow(); |
| 412 WmWindow* target_window = root_window->GetChildren()[1]; | 405 WmWindow* target_window = root_window->GetChildren()[1]; |
| 413 WmWindow* parent_window = root_window->GetChildren()[0]; | 406 WmWindow* parent_window = root_window->GetChildren()[0]; |
| 414 std::unique_ptr<WindowOwner> child_owner(CreateChildWindow(parent_window)); | 407 std::unique_ptr<WindowOwner> child_owner(CreateChildWindow(parent_window)); |
| 415 WmWindow* child_window = child_owner->window(); | 408 WmWindow* child_window = child_owner->window(); |
| 416 | 409 |
| 417 // Initialize DOMAgent | 410 // Initialize DOMAgent |
| 418 std::unique_ptr<ui::devtools::protocol::DOM::Node> root; | 411 std::unique_ptr<ui::devtools::protocol::DOM::Node> root; |
| 419 dom_agent()->getDocument(&root); | 412 dom_agent()->getDocument(&root); |
| 420 DOM::Node* root_node = root->getChildren(nullptr)->get(0); | 413 DOM::Node* root_node = root->getChildren(nullptr)->get(0); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 EXPECT_EQ(gfx::Rect(25, 35, 45, 20), root_view->bounds()); // Not changed | 756 EXPECT_EQ(gfx::Rect(25, 35, 45, 20), root_view->bounds()); // Not changed |
| 764 | 757 |
| 765 SetStyleTexts(root_view_node, "\nheight: 73;\n ", true); | 758 SetStyleTexts(root_view_node, "\nheight: 73;\n ", true); |
| 766 EXPECT_EQ(gfx::Rect(25, 35, 45, 73), root_view->bounds()); | 759 EXPECT_EQ(gfx::Rect(25, 35, 45, 73), root_view->bounds()); |
| 767 | 760 |
| 768 SetStyleTexts(root_view_node, "\nx: 10; y: 23; width: 52;\n ", true); | 761 SetStyleTexts(root_view_node, "\nx: 10; y: 23; width: 52;\n ", true); |
| 769 EXPECT_EQ(gfx::Rect(10, 23, 52, 73), root_view->bounds()); | 762 EXPECT_EQ(gfx::Rect(10, 23, 52, 73), root_view->bounds()); |
| 770 } | 763 } |
| 771 | 764 |
| 772 } // namespace ash | 765 } // namespace ash |
| OLD | NEW |