summaryrefslogtreecommitdiffstats
path: root/chrome/browser/accessibility
diff options
context:
space:
mode:
authorctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-20 06:50:15 +0000
committerctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-20 06:50:15 +0000
commit243dff47851291f60ea574c926136932c02e0b15 (patch)
treed71139737b2376874dcce4d5f52800d2b5e3a31a /chrome/browser/accessibility
parent68e621105cd0b452a0d06396e855e6dbdd26df94 (diff)
downloadchromium_src-243dff47851291f60ea574c926136932c02e0b15.zip
chromium_src-243dff47851291f60ea574c926136932c02e0b15.tar.gz
chromium_src-243dff47851291f60ea574c926136932c02e0b15.tar.bz2
Fix handling of a case where an AccessibilityObject is listed as a child multiple times.
BUG=79726 TEST=browser_tests:RendererAccessibilityBrowserTest.CrossPlatformDuplicateChildrenAccessibility Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82076 Review URL: http://codereview.chromium.org/6873063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/accessibility')
-rw-r--r--chrome/browser/accessibility/renderer_accessibility_browsertest.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/accessibility/renderer_accessibility_browsertest.cc b/chrome/browser/accessibility/renderer_accessibility_browsertest.cc
index 2944d43..6c4c0b7 100644
--- a/chrome/browser/accessibility/renderer_accessibility_browsertest.cc
+++ b/chrome/browser/accessibility/renderer_accessibility_browsertest.cc
@@ -317,4 +317,21 @@ IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
EXPECT_STREQ("Button 3", UTF16ToUTF8(button3.name).c_str());
}
+IN_PROC_BROWSER_TEST_F(RendererAccessibilityBrowserTest,
+ CrossPlatformDuplicateChildrenAccessibility) {
+ // Here's another html snippet where WebKit has a parent node containing
+ // two duplicate child nodes. Instead of checking the exact output, just
+ // make sure that no id is reused in the resulting tree.
+ const char url_str[] =
+ "data:text/html,"
+ "<!doctype html>"
+ "<em><code ><h4 ></em>";
+ GURL url(url_str);
+ browser()->OpenURL(url, GURL(), CURRENT_TAB, PageTransition::TYPED);
+
+ const WebAccessibility& tree = GetWebAccessibilityTree();
+ base::hash_set<int> ids;
+ RecursiveAssertUniqueIds(tree, &ids);
+}
+
} // namespace