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

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

Issue 1998153004: ChromeVox shouldn't navigate to iframe or webview elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made test more robust Created 4 years, 7 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
index 61e8b2124c2900aa1de3577d99948e55fd5c4b2c..443ce8baa51ef53305cc0a479977994a32644902 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -71,7 +71,7 @@ BackgroundTest.prototype = {
iframesDoc: function() {/*!
<p>start</p>
<button>Before</button>
- <iframe srcdoc="<button>Inside</button>"></iframe>
+ <iframe srcdoc="<button>Inside</button><h1>Inside</h1>"></iframe>
<button>After</button>
*/},
};
@@ -616,29 +616,84 @@ TEST_F('BackgroundTest', 'Checkbox', function() {
});
});
-/** Tests navigating into and out of iframes.. */
-TEST_F('BackgroundTest', 'DISABLED_ForwardNavigationThroughIframes', function() {
+/** Tests navigating into and out of iframes using nextButton */
+TEST_F('BackgroundTest', 'ForwardNavigationThroughIframeButtons', function() {
var mockFeedback = this.createMockFeedback();
+ var running = false;
var runTestIfIframeIsLoaded = function(rootNode) {
+ if (running)
+ return;
+
// Return if the iframe hasn't loaded yet.
var iframe = rootNode.find({role: 'iframe'});
var childDoc = iframe.firstChild;
- if (childDoc && childDoc.children.length == 0) {
+ if (!childDoc || childDoc.children.length == 0)
return;
- }
+ running = true;
var doCmd = this.doCmd.bind(this);
- mockFeedback.expectSpeech('start').expectBraille('start');
-
- mockFeedback.call(doCmd('nextButton'))
- .expectSpeech('Before', 'Button');
+ var beforeButton = rootNode.find({role: RoleType.button,
+ name: 'Before'});
+ beforeButton.focus();
+ mockFeedback.expectSpeech('Before', 'Button');
mockFeedback.call(doCmd('nextButton'))
.expectSpeech('Inside', 'Button');
mockFeedback.call(doCmd('nextButton'))
.expectSpeech('After', 'Button');
+ mockFeedback.call(doCmd('previousButton'))
+ .expectSpeech('Inside', 'Button');
+ mockFeedback.call(doCmd('previousButton'))
+ .expectSpeech('Before', 'Button');
+ mockFeedback.replay();
+ }.bind(this);
+
+ this.runWithLoadedTree(this.iframesDoc, function(rootNode) {
+ chrome.automation.getDesktop(function(desktopNode) {
+ runTestIfIframeIsLoaded(rootNode);
+
+ desktopNode.addEventListener('loadComplete', function(evt) {
+ runTestIfIframeIsLoaded(rootNode);
+ }, true);
+ });
+ });
+});
+/** Tests navigating into and out of iframes using nextObject */
+TEST_F('BackgroundTest', 'ForwardObjectNavigationThroughIframes', function() {
+ var mockFeedback = this.createMockFeedback();
+
+ var running = false;
+ var runTestIfIframeIsLoaded = function(rootNode) {
+ if (running)
+ return;
+
+ // Return if the iframe hasn't loaded yet.
+ var iframe = rootNode.find({role: 'iframe'});
+ var childDoc = iframe.firstChild;
+ if (!childDoc || childDoc.children.length == 0)
+ return;
+
+ running = true;
+ var doCmd = this.doCmd.bind(this);
+
+ var beforeButton = rootNode.find({role: RoleType.button,
+ name: 'Before'});
+ beforeButton.focus();
+ mockFeedback.expectSpeech('Before', 'Button');
+ mockFeedback.call(doCmd('nextObject'))
+ .expectSpeech('Inside', 'Button');
+ mockFeedback.call(doCmd('nextObject'))
+ .expectSpeech('Inside', 'Heading 1');
+ mockFeedback.call(doCmd('nextObject'))
+ .expectSpeech('After', 'Button');
+ mockFeedback.call(doCmd('previousObject'))
+ .expectSpeech('Inside', 'Heading 1');
+ mockFeedback.call(doCmd('previousObject'))
+ .expectSpeech('Inside', 'Button');
+ mockFeedback.call(doCmd('previousObject'))
+ .expectSpeech('Before', 'Button');
mockFeedback.replay();
}.bind(this);
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698