| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 10 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 "data:text/html," | 137 "data:text/html," |
| 138 "<!doctype html>" | 138 "<!doctype html>" |
| 139 "<html><head><title>Accessibility Test</title></head>" | 139 "<html><head><title>Accessibility Test</title></head>" |
| 140 "<body><input type='button' value='push' /><input type='checkbox' />" | 140 "<body><input type='button' value='push' /><input type='checkbox' />" |
| 141 "</body></html>"; | 141 "</body></html>"; |
| 142 GURL url(url_str); | 142 GURL url(url_str); |
| 143 NavigateToURL(shell(), url); | 143 NavigateToURL(shell(), url); |
| 144 const ui::AXTree& tree = GetAXTree(); | 144 const ui::AXTree& tree = GetAXTree(); |
| 145 const ui::AXNode* root = tree.root(); | 145 const ui::AXNode* root = tree.root(); |
| 146 | 146 |
| 147 // Check properties of thet tree. |
| 148 EXPECT_STREQ(url_str, tree.data().url.c_str()); |
| 149 EXPECT_STREQ("Accessibility Test", tree.data().title.c_str()); |
| 150 EXPECT_STREQ("html", tree.data().doctype.c_str()); |
| 151 EXPECT_STREQ("text/html", tree.data().mimetype.c_str()); |
| 152 |
| 147 // Check properties of the root element of the tree. | 153 // Check properties of the root element of the tree. |
| 148 EXPECT_STREQ(url_str, | |
| 149 GetAttr(root, ui::AX_ATTR_DOC_URL).c_str()); | |
| 150 EXPECT_STREQ( | |
| 151 "Accessibility Test", | |
| 152 GetAttr(root, ui::AX_ATTR_DOC_TITLE).c_str()); | |
| 153 EXPECT_STREQ( | |
| 154 "html", GetAttr(root, ui::AX_ATTR_DOC_DOCTYPE).c_str()); | |
| 155 EXPECT_STREQ( | |
| 156 "text/html", | |
| 157 GetAttr(root, ui::AX_ATTR_DOC_MIMETYPE).c_str()); | |
| 158 EXPECT_STREQ( | 154 EXPECT_STREQ( |
| 159 "Accessibility Test", | 155 "Accessibility Test", |
| 160 GetAttr(root, ui::AX_ATTR_NAME).c_str()); | 156 GetAttr(root, ui::AX_ATTR_NAME).c_str()); |
| 161 EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, root->data().role); | 157 EXPECT_EQ(ui::AX_ROLE_ROOT_WEB_AREA, root->data().role); |
| 162 | 158 |
| 163 // Check properties of the BODY element. | 159 // Check properties of the BODY element. |
| 164 ASSERT_EQ(1, root->child_count()); | 160 ASSERT_EQ(1, root->child_count()); |
| 165 const ui::AXNode* body = root->ChildAtIndex(0); | 161 const ui::AXNode* body = root->ChildAtIndex(0); |
| 166 EXPECT_EQ(ui::AX_ROLE_GROUP, body->data().role); | 162 EXPECT_EQ(ui::AX_ROLE_GROUP, body->data().role); |
| 167 EXPECT_STREQ("body", | 163 EXPECT_STREQ("body", |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 GURL url(url_str); | 484 GURL url(url_str); |
| 489 NavigateToURL(shell(), url); | 485 NavigateToURL(shell(), url); |
| 490 const ui::AXTree& tree = GetAXTree(); | 486 const ui::AXTree& tree = GetAXTree(); |
| 491 const ui::AXNode* root = tree.root(); | 487 const ui::AXNode* root = tree.root(); |
| 492 ASSERT_EQ(1, root->child_count()); | 488 ASSERT_EQ(1, root->child_count()); |
| 493 const ui::AXNode* textbox = root->ChildAtIndex(0); | 489 const ui::AXNode* textbox = root->ChildAtIndex(0); |
| 494 EXPECT_EQ(true, GetBoolAttr(textbox, ui::AX_ATTR_CAN_SET_VALUE)); | 490 EXPECT_EQ(true, GetBoolAttr(textbox, ui::AX_ATTR_CAN_SET_VALUE)); |
| 495 } | 491 } |
| 496 | 492 |
| 497 } // namespace content | 493 } // namespace content |
| OLD | NEW |