Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2636)

Unified Diff: ash/devtools/ash_devtools_unittest.cc

Issue 2902063004: View shows wrong bound when it is highlighted. (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/devtools/view_element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/devtools/ash_devtools_unittest.cc
diff --git a/ash/devtools/ash_devtools_unittest.cc b/ash/devtools/ash_devtools_unittest.cc
index a1ecc40126c8b139172f36b413355bd1f2e49b9a..89ca50fc2326b23aa5f1654ba46b4a3f7c4656d1 100644
--- a/ash/devtools/ash_devtools_unittest.cc
+++ b/ash/devtools/ash_devtools_unittest.cc
@@ -5,6 +5,8 @@
#include "ash/devtools/ash_devtools_css_agent.h"
#include "ash/devtools/ash_devtools_dom_agent.h"
#include "ash/devtools/ui_element.h"
+#include "ash/devtools/view_element.h"
+#include "ash/devtools/widget_element.h"
#include "ash/devtools/window_element.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
@@ -635,17 +637,36 @@ TEST_F(AshDevToolsTest, WindowWidgetViewHighlight) {
HighlightNode(window_node->getNodeId());
ExpectHighlighted(window->GetBoundsInScreen(), 0);
+ devtools::UIElement* element =
+ dom_agent()->GetElementFromNodeId(window_node->getNodeId());
+ ASSERT_EQ(devtools::UIElementType::WINDOW, element->type());
+ EXPECT_EQ(element->GetNodeWindowAndBounds().first, window.get());
+ EXPECT_EQ(element->GetNodeWindowAndBounds().second,
+ window->GetBoundsInScreen());
HideHighlight(0);
HighlightNode(widget_node->getNodeId());
ExpectHighlighted(widget->GetWindowBoundsInScreen(), 0);
+ element = dom_agent()->GetElementFromNodeId(widget_node->getNodeId());
+ ASSERT_EQ(devtools::UIElementType::WIDGET, element->type());
+ EXPECT_EQ(element->GetNodeWindowAndBounds().first, widget->GetNativeWindow());
+ EXPECT_EQ(element->GetNodeWindowAndBounds().second,
+ widget->GetWindowBoundsInScreen());
+
HideHighlight(0);
HighlightNode(root_view_node->getNodeId());
ExpectHighlighted(root_view->GetBoundsInScreen(), 0);
+ element = dom_agent()->GetElementFromNodeId(root_view_node->getNodeId());
+ ASSERT_EQ(devtools::UIElementType::VIEW, element->type());
+ EXPECT_EQ(element->GetNodeWindowAndBounds().first,
+ root_view->GetWidget()->GetNativeWindow());
+ EXPECT_EQ(element->GetNodeWindowAndBounds().second,
+ root_view->GetBoundsInScreen());
+
HideHighlight(0);
// Highlight non-existent node
« no previous file with comments | « no previous file | ash/devtools/view_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698