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

Unified Diff: components/exo/shell_surface_unittest.cc

Issue 2640123004: Initial support for native accessibility in ARC (Closed)
Patch Set: Experimental changes Created 3 years, 10 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
Index: components/exo/shell_surface_unittest.cc
diff --git a/components/exo/shell_surface_unittest.cc b/components/exo/shell_surface_unittest.cc
index 135395cc051e063517c46f47f707c4d7683e5d1d..ca7ae49894d1564097f68fcf0e7ad4e8ea67c98e 100644
--- a/components/exo/shell_surface_unittest.cc
+++ b/components/exo/shell_surface_unittest.cc
@@ -19,6 +19,8 @@
#include "components/exo/test/exo_test_base.h"
#include "components/exo/test/exo_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/accessibility/ax_enums.h"
+#include "ui/accessibility/ax_node_data.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/aura/window_targeter.h"
@@ -829,5 +831,30 @@ TEST_F(ShellSurfaceTest, SpokenFeedbackFullscreenBackground) {
EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds());
}
+TEST_F(ShellSurfaceTest, AccessibilityNodeData) {
+ gfx::Size buffer_size(256, 256);
+ Buffer buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size));
+ Surface surface;
+ ShellSurface shell_surface(&surface, nullptr, gfx::Rect(640, 480), true,
+ false, ash::kShellWindowId_DefaultContainer);
+
+ surface.Attach(&buffer);
+
+ ui::AXNodeData data;
+ surface.UpdateAXTreeID(1);
+ shell_surface.GetAccessibleNodeData(&data);
+ ASSERT_EQ(1, data.GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID));
+
+ ui::AXNodeData data2;
+ surface.UpdateAXTreeID(2);
+ shell_surface.GetAccessibleNodeData(&data2);
+ ASSERT_EQ(2, data2.GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID));
+
+ ui::AXNodeData data3;
+ surface.UpdateAXTreeID(0);
+ shell_surface.GetAccessibleNodeData(&data3);
+ ASSERT_EQ(0, data3.GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID));
+}
+
} // namespace
} // namespace exo

Powered by Google App Engine
This is Rietveld 408576698