| Index: content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| diff --git a/content/browser/accessibility/browser_accessibility_win_unittest.cc b/content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| index 53d00765556fc8e3be1870757989b12e02e0b135..314d296cf0d077ca46f7e5c45f28c3c29dc495d7 100644
|
| --- a/content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| +++ b/content/browser/accessibility/browser_accessibility_win_unittest.cc
|
| @@ -110,31 +110,31 @@ void BrowserAccessibilityTest::SetUp() {
|
| // Test that BrowserAccessibilityManager correctly releases the tree of
|
| // BrowserAccessibility instances upon delete.
|
| TEST_F(BrowserAccessibilityTest, TestNoLeaks) {
|
| - // Create AccessibilityNodeData objects for a simple document tree,
|
| + // Create ui::AXNodeData objects for a simple document tree,
|
| // representing the accessibility information used to initialize
|
| // BrowserAccessibilityManager.
|
| - AccessibilityNodeData button;
|
| + ui::AXNodeData button;
|
| button.id = 2;
|
| button.SetName("Button");
|
| - button.role = blink::WebAXRoleButton;
|
| + button.role = ui::AX_ROLE_BUTTON;
|
| button.state = 0;
|
|
|
| - AccessibilityNodeData checkbox;
|
| + ui::AXNodeData checkbox;
|
| checkbox.id = 3;
|
| checkbox.SetName("Checkbox");
|
| - checkbox.role = blink::WebAXRoleCheckBox;
|
| + checkbox.role = ui::AX_ROLE_CHECK_BOX;
|
| checkbox.state = 0;
|
|
|
| - AccessibilityNodeData root;
|
| + ui::AXNodeData root;
|
| root.id = 1;
|
| root.SetName("Document");
|
| - root.role = blink::WebAXRoleRootWebArea;
|
| + root.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| root.state = 0;
|
| root.child_ids.push_back(2);
|
| root.child_ids.push_back(3);
|
|
|
| // Construct a BrowserAccessibilityManager with this
|
| - // AccessibilityNodeData tree and a factory for an instance-counting
|
| + // ui::AXNodeData tree and a factory for an instance-counting
|
| // BrowserAccessibility, and ensure that exactly 3 instances were
|
| // created. Note that the manager takes ownership of the factory.
|
| CountedBrowserAccessibility::reset();
|
| @@ -179,24 +179,24 @@ TEST_F(BrowserAccessibilityTest, TestNoLeaks) {
|
| }
|
|
|
| TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
|
| - // Create AccessibilityNodeData objects for a simple document tree,
|
| + // Create ui::AXNodeData objects for a simple document tree,
|
| // representing the accessibility information used to initialize
|
| // BrowserAccessibilityManager.
|
| - AccessibilityNodeData text;
|
| + ui::AXNodeData text;
|
| text.id = 2;
|
| - text.role = blink::WebAXRoleStaticText;
|
| + text.role = ui::AX_ROLE_STATIC_TEXT;
|
| text.SetName("old text");
|
| text.state = 0;
|
|
|
| - AccessibilityNodeData root;
|
| + ui::AXNodeData root;
|
| root.id = 1;
|
| root.SetName("Document");
|
| - root.role = blink::WebAXRoleRootWebArea;
|
| + root.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| root.state = 0;
|
| root.child_ids.push_back(2);
|
|
|
| // Construct a BrowserAccessibilityManager with this
|
| - // AccessibilityNodeData tree and a factory for an instance-counting
|
| + // ui::AXNodeData tree and a factory for an instance-counting
|
| // BrowserAccessibility.
|
| CountedBrowserAccessibility::reset();
|
| scoped_ptr<BrowserAccessibilityManager> manager(
|
| @@ -227,13 +227,13 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
|
| text_accessible.Release();
|
|
|
| // Notify the BrowserAccessibilityManager that the text child has changed.
|
| - AccessibilityNodeData text2;
|
| + ui::AXNodeData text2;
|
| text2.id = 2;
|
| - text2.role = blink::WebAXRoleStaticText;
|
| + text2.role = ui::AX_ROLE_STATIC_TEXT;
|
| text2.SetName("new text");
|
| text2.SetName("old text");
|
| AccessibilityHostMsg_EventParams param;
|
| - param.event_type = blink::WebAXEventChildrenChanged;
|
| + param.event_type = ui::AX_EVENT_CHILDREN_CHANGED;
|
| param.nodes.push_back(text2);
|
| param.id = text2.id;
|
| std::vector<AccessibilityHostMsg_EventParams> events;
|
| @@ -263,35 +263,35 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChange) {
|
| }
|
|
|
| TEST_F(BrowserAccessibilityTest, TestChildrenChangeNoLeaks) {
|
| - // Create AccessibilityNodeData objects for a simple document tree,
|
| + // Create ui::AXNodeData objects for a simple document tree,
|
| // representing the accessibility information used to initialize
|
| // BrowserAccessibilityManager.
|
| - AccessibilityNodeData div;
|
| + ui::AXNodeData div;
|
| div.id = 2;
|
| - div.role = blink::WebAXRoleGroup;
|
| + div.role = ui::AX_ROLE_GROUP;
|
| div.state = 0;
|
|
|
| - AccessibilityNodeData text3;
|
| + ui::AXNodeData text3;
|
| text3.id = 3;
|
| - text3.role = blink::WebAXRoleStaticText;
|
| + text3.role = ui::AX_ROLE_STATIC_TEXT;
|
| text3.state = 0;
|
|
|
| - AccessibilityNodeData text4;
|
| + ui::AXNodeData text4;
|
| text4.id = 4;
|
| - text4.role = blink::WebAXRoleStaticText;
|
| + text4.role = ui::AX_ROLE_STATIC_TEXT;
|
| text4.state = 0;
|
|
|
| div.child_ids.push_back(3);
|
| div.child_ids.push_back(4);
|
|
|
| - AccessibilityNodeData root;
|
| + ui::AXNodeData root;
|
| root.id = 1;
|
| - root.role = blink::WebAXRoleRootWebArea;
|
| + root.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| root.state = 0;
|
| root.child_ids.push_back(2);
|
|
|
| // Construct a BrowserAccessibilityManager with this
|
| - // AccessibilityNodeData tree and a factory for an instance-counting
|
| + // ui::AXNodeData tree and a factory for an instance-counting
|
| // BrowserAccessibility and ensure that exactly 4 instances were
|
| // created. Note that the manager takes ownership of the factory.
|
| CountedBrowserAccessibility::reset();
|
| @@ -305,7 +305,7 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChangeNoLeaks) {
|
| // were removed and ensure that only one BrowserAccessibility instance exists.
|
| root.child_ids.clear();
|
| AccessibilityHostMsg_EventParams param;
|
| - param.event_type = blink::WebAXEventChildrenChanged;
|
| + param.event_type = ui::AX_EVENT_CHILDREN_CHANGED;
|
| param.nodes.push_back(root);
|
| param.id = root.id;
|
| std::vector<AccessibilityHostMsg_EventParams> events;
|
| @@ -322,19 +322,19 @@ TEST_F(BrowserAccessibilityTest, TestChildrenChangeNoLeaks) {
|
| TEST_F(BrowserAccessibilityTest, TestTextBoundaries) {
|
| std::string text1_value = "One two three.\nFour five six.";
|
|
|
| - AccessibilityNodeData text1;
|
| + ui::AXNodeData text1;
|
| text1.id = 11;
|
| - text1.role = blink::WebAXRoleTextField;
|
| + text1.role = ui::AX_ROLE_TEXT_FIELD;
|
| text1.state = 0;
|
| - text1.AddStringAttribute(AccessibilityNodeData::ATTR_VALUE, text1_value);
|
| + text1.AddStringAttribute(ui::AX_ATTR_VALUE, text1_value);
|
| std::vector<int32> line_breaks;
|
| line_breaks.push_back(15);
|
| text1.AddIntListAttribute(
|
| - AccessibilityNodeData::ATTR_LINE_BREAKS, line_breaks);
|
| + ui::AX_ATTR_LINE_BREAKS, line_breaks);
|
|
|
| - AccessibilityNodeData root;
|
| + ui::AXNodeData root;
|
| root.id = 1;
|
| - root.role = blink::WebAXRoleRootWebArea;
|
| + root.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| root.state = 0;
|
| root.child_ids.push_back(11);
|
|
|
| @@ -419,22 +419,22 @@ TEST_F(BrowserAccessibilityTest, TestSimpleHypertext) {
|
| const std::string text1_name = "One two three.";
|
| const std::string text2_name = " Four five six.";
|
|
|
| - AccessibilityNodeData text1;
|
| + ui::AXNodeData text1;
|
| text1.id = 11;
|
| - text1.role = blink::WebAXRoleStaticText;
|
| - text1.state = 1 << blink::WebAXStateReadonly;
|
| + text1.role = ui::AX_ROLE_STATIC_TEXT;
|
| + text1.state = 1 << ui::AX_STATE_READONLY;
|
| text1.SetName(text1_name);
|
|
|
| - AccessibilityNodeData text2;
|
| + ui::AXNodeData text2;
|
| text2.id = 12;
|
| - text2.role = blink::WebAXRoleStaticText;
|
| - text2.state = 1 << blink::WebAXStateReadonly;
|
| + text2.role = ui::AX_ROLE_STATIC_TEXT;
|
| + text2.state = 1 << ui::AX_STATE_READONLY;
|
| text2.SetName(text2_name);
|
|
|
| - AccessibilityNodeData root;
|
| + ui::AXNodeData root;
|
| root.id = 1;
|
| - root.role = blink::WebAXRoleRootWebArea;
|
| - root.state = 1 << blink::WebAXStateReadonly;
|
| + root.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| + root.state = 1 << ui::AX_STATE_READONLY;
|
| root.child_ids.push_back(11);
|
| root.child_ids.push_back(12);
|
|
|
| @@ -487,42 +487,42 @@ TEST_F(BrowserAccessibilityTest, TestComplexHypertext) {
|
| const std::string button1_text_name = "red";
|
| const std::string link1_text_name = "blue";
|
|
|
| - AccessibilityNodeData text1;
|
| + ui::AXNodeData text1;
|
| text1.id = 11;
|
| - text1.role = blink::WebAXRoleStaticText;
|
| - text1.state = 1 << blink::WebAXStateReadonly;
|
| + text1.role = ui::AX_ROLE_STATIC_TEXT;
|
| + text1.state = 1 << ui::AX_STATE_READONLY;
|
| text1.SetName(text1_name);
|
|
|
| - AccessibilityNodeData text2;
|
| + ui::AXNodeData text2;
|
| text2.id = 12;
|
| - text2.role = blink::WebAXRoleStaticText;
|
| - text2.state = 1 << blink::WebAXStateReadonly;
|
| + text2.role = ui::AX_ROLE_STATIC_TEXT;
|
| + text2.state = 1 << ui::AX_STATE_READONLY;
|
| text2.SetName(text2_name);
|
|
|
| - AccessibilityNodeData button1, button1_text;
|
| + ui::AXNodeData button1, button1_text;
|
| button1.id = 13;
|
| button1_text.id = 15;
|
| button1_text.SetName(button1_text_name);
|
| - button1.role = blink::WebAXRoleButton;
|
| - button1_text.role = blink::WebAXRoleStaticText;
|
| - button1.state = 1 << blink::WebAXStateReadonly;
|
| - button1_text.state = 1 << blink::WebAXStateReadonly;
|
| + button1.role = ui::AX_ROLE_BUTTON;
|
| + button1_text.role = ui::AX_ROLE_STATIC_TEXT;
|
| + button1.state = 1 << ui::AX_STATE_READONLY;
|
| + button1_text.state = 1 << ui::AX_STATE_READONLY;
|
| button1.child_ids.push_back(15);
|
|
|
| - AccessibilityNodeData link1, link1_text;
|
| + ui::AXNodeData link1, link1_text;
|
| link1.id = 14;
|
| link1_text.id = 16;
|
| link1_text.SetName(link1_text_name);
|
| - link1.role = blink::WebAXRoleLink;
|
| - link1_text.role = blink::WebAXRoleStaticText;
|
| - link1.state = 1 << blink::WebAXStateReadonly;
|
| - link1_text.state = 1 << blink::WebAXStateReadonly;
|
| + link1.role = ui::AX_ROLE_LINK;
|
| + link1_text.role = ui::AX_ROLE_STATIC_TEXT;
|
| + link1.state = 1 << ui::AX_STATE_READONLY;
|
| + link1_text.state = 1 << ui::AX_STATE_READONLY;
|
| link1.child_ids.push_back(16);
|
|
|
| - AccessibilityNodeData root;
|
| + ui::AXNodeData root;
|
| root.id = 1;
|
| - root.role = blink::WebAXRoleRootWebArea;
|
| - root.state = 1 << blink::WebAXStateReadonly;
|
| + root.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| + root.state = 1 << ui::AX_STATE_READONLY;
|
| root.child_ids.push_back(11);
|
| root.child_ids.push_back(13);
|
| root.child_ids.push_back(12);
|
| @@ -602,8 +602,8 @@ TEST_F(BrowserAccessibilityTest, TestCreateEmptyDocument) {
|
| // Try creating an empty document with busy state. Readonly is
|
| // set automatically.
|
| CountedBrowserAccessibility::reset();
|
| - const int32 busy_state = 1 << blink::WebAXStateBusy;
|
| - const int32 readonly_state = 1 << blink::WebAXStateReadonly;
|
| + const int32 busy_state = 1 << ui::AX_STATE_BUSY;
|
| + const int32 readonly_state = 1 << ui::AX_STATE_READONLY;
|
| const int32 enabled_state = 1 << blink::WebAXStateEnabled;
|
| scoped_ptr<BrowserAccessibilityManager> manager(
|
| new BrowserAccessibilityManagerWin(
|
| @@ -616,24 +616,24 @@ TEST_F(BrowserAccessibilityTest, TestCreateEmptyDocument) {
|
| // Verify the root is as we expect by default.
|
| BrowserAccessibility* root = manager->GetRoot();
|
| EXPECT_EQ(0, root->renderer_id());
|
| - EXPECT_EQ(blink::WebAXRoleRootWebArea, root->role());
|
| + EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, root->role());
|
| EXPECT_EQ(busy_state | readonly_state | enabled_state, root->state());
|
|
|
| // Tree with a child textfield.
|
| - AccessibilityNodeData tree1_1;
|
| + ui::AXNodeData tree1_1;
|
| tree1_1.id = 1;
|
| - tree1_1.role = blink::WebAXRoleRootWebArea;
|
| + tree1_1.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| tree1_1.child_ids.push_back(2);
|
|
|
| - AccessibilityNodeData tree1_2;
|
| + ui::AXNodeData tree1_2;
|
| tree1_2.id = 2;
|
| - tree1_2.role = blink::WebAXRoleTextField;
|
| + tree1_2.role = ui::AX_ROLE_TEXT_FIELD;
|
|
|
| // Process a load complete.
|
| std::vector<AccessibilityHostMsg_EventParams> params;
|
| params.push_back(AccessibilityHostMsg_EventParams());
|
| AccessibilityHostMsg_EventParams* msg = ¶ms[0];
|
| - msg->event_type = blink::WebAXEventLoadComplete;
|
| + msg->event_type = ui::AX_EVENT_LOAD_COMPLETE;
|
| msg->nodes.push_back(tree1_1);
|
| msg->nodes.push_back(tree1_2);
|
| msg->id = tree1_1.id;
|
| @@ -646,18 +646,18 @@ TEST_F(BrowserAccessibilityTest, TestCreateEmptyDocument) {
|
| EXPECT_NE(root, manager->GetRoot());
|
|
|
| // And the proper child remains.
|
| - EXPECT_EQ(blink::WebAXRoleTextField, acc1_2->role());
|
| + EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, acc1_2->role());
|
| EXPECT_EQ(2, acc1_2->renderer_id());
|
|
|
| // Tree with a child button.
|
| - AccessibilityNodeData tree2_1;
|
| + ui::AXNodeData tree2_1;
|
| tree2_1.id = 1;
|
| - tree2_1.role = blink::WebAXRoleRootWebArea;
|
| + tree2_1.role = ui::AX_ROLE_ROOT_WEB_AREA;
|
| tree2_1.child_ids.push_back(3);
|
|
|
| - AccessibilityNodeData tree2_2;
|
| + ui::AXNodeData tree2_2;
|
| tree2_2.id = 3;
|
| - tree2_2.role = blink::WebAXRoleButton;
|
| + tree2_2.role = ui::AX_ROLE_BUTTON;
|
|
|
| msg->nodes.clear();
|
| msg->nodes.push_back(tree2_1);
|
| @@ -673,7 +673,7 @@ TEST_F(BrowserAccessibilityTest, TestCreateEmptyDocument) {
|
| EXPECT_NE(root, manager->GetRoot());
|
|
|
| // And the new child exists.
|
| - EXPECT_EQ(blink::WebAXRoleButton, acc2_2->role());
|
| + EXPECT_EQ(ui::AX_ROLE_BUTTON, acc2_2->role());
|
| EXPECT_EQ(3, acc2_2->renderer_id());
|
|
|
| // Ensure we properly cleaned up.
|
|
|