summaryrefslogtreecommitdiffstats
path: root/chrome/browser/accessibility/renderer_accessibility_browsertest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/accessibility/renderer_accessibility_browsertest.cc')
-rw-r--r--chrome/browser/accessibility/renderer_accessibility_browsertest.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/accessibility/renderer_accessibility_browsertest.cc b/chrome/browser/accessibility/renderer_accessibility_browsertest.cc
index 2944d43..93107cb 100644
--- a/chrome/browser/accessibility/renderer_accessibility_browsertest.cc
+++ b/chrome/browser/accessibility/renderer_accessibility_browsertest.cc
@@ -317,4 +317,29 @@ 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>"
+ "<script>"
+ " document.write('');"
+ " document.close();"
+ " setTimeout(function () {"
+ " document.write('<DT><em><sr><code ><h4 ></em><<');"
+ " document.close();"
+ " setTimeout('location.reload()', 0);"
+ " }, 0);"
+ "</script>";
+ 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