| 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 d8f33386b1c455aae130b6939c1efe85f25afae5..87f0321aafe9bed5aa0ff928cb5224fca2668a92 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
|
| @@ -66,7 +66,14 @@ BackgroundTest.prototype = {
|
| <option>grape</option>
|
| <option> banana</option>
|
| </select>
|
| - */}
|
| + */},
|
| +
|
| + iframesDoc: function() {/*!
|
| + <p>start</p>
|
| + <button>Before</button>
|
| + <iframe srcdoc="<button>Inside</button>"></iframe>
|
| + <button>After</button>
|
| + */},
|
| };
|
|
|
| /** Tests that ChromeVox classic is in this context. */
|
| @@ -586,3 +593,40 @@ TEST_F('BackgroundTest', 'Checkbox', function() {
|
| .replay();
|
| });
|
| });
|
| +
|
| +/** Tests navigating into and out of iframes.. */
|
| +TEST_F('BackgroundTest', 'ForwardNavigationThroughIframes', function() {
|
| + var mockFeedback = this.createMockFeedback();
|
| +
|
| + var runTestIfIframeIsLoaded = function(rootNode) {
|
| + // 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;
|
| + }
|
| +
|
| + var doCmd = this.doCmd.bind(this);
|
| +
|
| + mockFeedback.expectSpeech('start').expectBraille('start');
|
| +
|
| + mockFeedback.call(doCmd('nextButton'))
|
| + .expectSpeech('Before', 'Button');
|
| + mockFeedback.call(doCmd('nextButton'))
|
| + .expectSpeech('Inside', 'Button');
|
| + mockFeedback.call(doCmd('nextButton'))
|
| + .expectSpeech('After', '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);
|
| + });
|
| + });
|
| +});
|
|
|