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

Unified Diff: LayoutTests/accessibility/deleting-iframe-destroys-axcache.html

Issue 876003003: Extract buildAccessibilityTree() from the individual layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated some tests and added rolesToIgnore param to helper function. Created 5 years, 11 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: LayoutTests/accessibility/deleting-iframe-destroys-axcache.html
diff --git a/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html b/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html
index 537b876183fb337439c4f422ec8da2ce64f6f205..e0fae7f197dbf468fdd2de91f284291be5caf532 100644
--- a/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html
+++ b/LayoutTests/accessibility/deleting-iframe-destroys-axcache.html
@@ -1,35 +1,21 @@
<html>
-<head>
<script src="../resources/js-test.js"></script>
+<script src="../resources/accessibility-helper.js"></script>
+<body>
- <script>
- if (window.testRunner)
- testRunner.waitUntilDone();
-
- function buildAccessibilityTree(accessibilityObject, indent) {
- var str = "";
- for (var i = 0; i < indent; i++)
- str += " ";
- str += accessibilityObject.role;
- str += " " + accessibilityObject.stringValue;
-
- if (accessibilityObject.role == '')
- str += accessibilityObject.allAttributes();
+<p>Before</p>
- str += "\n";
- document.getElementById("console").innerText += str;
+<iframe id="iframe" src="data:text/html,<body><button>Click me</button></body>"></iframe>
- if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
- return false;
+<p>After</p>
- var count = accessibilityObject.childrenCount;
- for (var i = 0; i < count; ++i) {
- if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
- return false;
- }
+<p>End of test</p>
- return true;
- }
+<p id="description"></p>
+<div id="console"></div>
+<script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
function runTest()
{
@@ -50,7 +36,7 @@
window.frameButtonRole = window.frameButton.role;
document.getElementById("console").innerText += "\nBefore:\n";
- buildAccessibilityTree(root, 0);
+ buildAccessibilityTree(root, 0, 1);
// Remove the iframe.
document.body.removeChild(document.getElementById("iframe"));
@@ -65,7 +51,7 @@
window.newAfter = newBody.childAtIndex(1).childAtIndex(0);
document.getElementById("console").innerText += "\nAfter:\n";
- buildAccessibilityTree(newRoot, 0);
+ buildAccessibilityTree(newRoot, 0, 1);
document.getElementById("console").innerText += "\n";
// Make sure that the accessibility objects from the iframe's nodes
@@ -89,21 +75,6 @@
window.addEventListener('load', function() {
setTimeout(runTest, 10);
}, false);
-
- </script>
-</head>
-<body>
-
-<p>Before</p>
-
-<iframe id="iframe" src="data:text/html,<body><button>Click me</button></body>"></iframe>
-
-<p>After</p>
-
-<p>End of test</p>
-
-<p id="description"></p>
-<div id="console"></div>
-
+</script>
</body>
</html>
« no previous file with comments | « LayoutTests/accessibility/aria-tables-expected.txt ('k') | LayoutTests/accessibility/div-within-anchors-causes-crash.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698