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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs

Issue 1457683009: Complete live region support in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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: chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs
index 2c75b9fc26bea3c972fe4f6d44892d6770432128..0d69c566992939ba86b9157c2965d94a5e543408 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs
@@ -25,6 +25,10 @@ AutomationUtilE2ETest.prototype = {
basicDoc: function() {/*!
<p><a href='#'></a>hello</p>
<h1><ul><li>a</ul><button></h1>
+ */},
+
+ secondDoc: function() {/*!
+ <html><head><title>Second doc</title></head><body>Second</body></html>
*/}
};
@@ -100,3 +104,23 @@ TEST_F('AutomationUtilE2ETest', 'GetDirection', function() {
});
});
+
+TEST_F('AutomationUtilE2ETest', 'IsInSameWebpage', function() {
+ this.runWithLoadedTree(this.basicDoc, function(root) {
+ this.runWithLoadedTree(this.secondDoc, function(root2) {
+ assertTrue(AutomationUtil.isInSameWebpage(root, root));
+ assertTrue(AutomationUtil.isInSameWebpage(root.firstChild, root));
+ assertTrue(AutomationUtil.isInSameWebpage(root, root.firstChild));
+
+ assertTrue(AutomationUtil.isInSameWebpage(root2, root2));
+ assertTrue(AutomationUtil.isInSameWebpage(root2.firstChild, root2));
+ assertTrue(AutomationUtil.isInSameWebpage(root2, root2.firstChild));
+
+ assertFalse(AutomationUtil.isInSameWebpage(root, root2));
+ assertFalse(AutomationUtil.isInSameWebpage(root.firstChild, root2));
+ assertFalse(AutomationUtil.isInSameWebpage(root2.firstChild));
+ assertFalse(AutomationUtil.isInSameWebpage(
+ root.firstChild, root2.firstChild));
+ });
+ });
Peter Lundblad 2015/11/24 11:04:30 Could test with one node being in the desktop tree
dmazzoni 2015/11/30 22:00:46 All good ideas. I think it was worth adding a test
+});

Powered by Google App Engine
This is Rietveld 408576698