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

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

Issue 1621823003: Avoid getting stuck when calling focus() on iframe nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Include test fixture. 5 // Include test fixture.
6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js', 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js',
7 '../../testing/assert_additions.js']); 7 '../../testing/assert_additions.js']);
8 8
9 GEN_INCLUDE(['../../testing/mock_feedback.js']); 9 GEN_INCLUDE(['../../testing/mock_feedback.js']);
10 10
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 assertEquals('classic', global.backgroundObj.mode); 498 assertEquals('classic', global.backgroundObj.mode);
499 499
500 // Now, try refreshing mode (which we call after tab switching) with a range 500 // Now, try refreshing mode (which we call after tab switching) with a range
501 // that's not actually focused. 501 // that's not actually focused.
502 assertEquals(undefined, root.parent.parent.state.focused); 502 assertEquals(undefined, root.parent.parent.state.focused);
503 global.backgroundObj.setCurrentRange(cursors.Range.fromNode(root.parent.pare nt)); 503 global.backgroundObj.setCurrentRange(cursors.Range.fromNode(root.parent.pare nt));
504 global.backgroundObj.refreshMode(''); 504 global.backgroundObj.refreshMode('');
505 assertEquals('classic', global.backgroundObj.mode); 505 assertEquals('classic', global.backgroundObj.mode);
506 }.bind(this)); 506 }.bind(this));
507 }); 507 });
508
509 TEST_F('BackgroundTest', 'FocusIframe', function() {
510 this.runWithLoadedTree( function() {/*!
511 <iframe tabindex=0 src="data:text/html,<p>Inside</p>"></iframe>
512 <button>outside</button>
513 */}, function(root) {
514 var iframe = root.find({role: 'iframe'});
515 var button = root.find({role: 'button'});
516
517 assertEquals('iframe', iframe.role);
518 assertEquals('button', button.role);
519
520 var didFocus = false;
521 iframe.focus = function() {
522 didFocus = true;
523 };
524 var b = global.backgroundObj;
525 b.currentRange_ = cursors.Range.fromNode(button);
526 b.onGotCommand('previousElement');
527 assertFalse(didFocus);
528 }.bind(this));
529 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698