| OLD | NEW |
| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 'charlie', 'Heading 1'); | 221 'charlie', 'Heading 1'); |
| 222 mockFeedback.replay(); | 222 mockFeedback.replay(); |
| 223 }); | 223 }); |
| 224 }); | 224 }); |
| 225 | 225 |
| 226 TEST_F('BackgroundTest', 'InitialFocus', function() { | 226 TEST_F('BackgroundTest', 'InitialFocus', function() { |
| 227 var mockFeedback = this.createMockFeedback(); | 227 var mockFeedback = this.createMockFeedback(); |
| 228 this.runWithLoadedTree('<a href="a">a</a>', | 228 this.runWithLoadedTree('<a href="a">a</a>', |
| 229 function(rootNode) { | 229 function(rootNode) { |
| 230 mockFeedback.expectSpeech('data:text/html,<!doctype html>' + | 230 mockFeedback.expectSpeech('data:text/html,<!doctype html>' + |
| 231 '<a href="a">a</a><!-- chromevox_next_test -->') | 231 '<a href="a">a</a>') |
| 232 .expectSpeech('a') | 232 .expectSpeech('a') |
| 233 .expectSpeech('Link'); | 233 .expectSpeech('Link'); |
| 234 mockFeedback.replay(); | 234 mockFeedback.replay(); |
| 235 }); | 235 }); |
| 236 }); | 236 }); |
| 237 | 237 |
| 238 TEST_F('BackgroundTest', 'AriaLabel', function() { | 238 TEST_F('BackgroundTest', 'AriaLabel', function() { |
| 239 var mockFeedback = this.createMockFeedback(); | 239 var mockFeedback = this.createMockFeedback(); |
| 240 this.runWithLoadedTree('<a aria-label="foo" href="a">a</a>', | 240 this.runWithLoadedTree('<a aria-label="foo" href="a">a</a>', |
| 241 function(rootNode) { | 241 function(rootNode) { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 466 |
| 467 mockFeedback.call(focusButton) | 467 mockFeedback.call(focusButton) |
| 468 .expectSpeech('b').expectSpeech('Button') | 468 .expectSpeech('b').expectSpeech('Button') |
| 469 .call(off) | 469 .call(off) |
| 470 .call(focusThen.bind(this, rootNode.find({ role: 'link' }), on)) | 470 .call(focusThen.bind(this, rootNode.find({ role: 'link' }), on)) |
| 471 .call(focusThen.bind(this, rootNode.find({ role: 'textField' }))) | 471 .call(focusThen.bind(this, rootNode.find({ role: 'textField' }))) |
| 472 .expectNextSpeechUtteranceIsNot('a') | 472 .expectNextSpeechUtteranceIsNot('a') |
| 473 .expectSpeech('Edit text'); | 473 .expectSpeech('Edit text'); |
| 474 | 474 |
| 475 mockFeedback.replay(); | 475 mockFeedback.replay(); |
| 476 } | 476 }); |
| 477 ); | |
| 478 }); | 477 }); |
| 479 | 478 |
| 480 TEST_F('BackgroundTest', 'ModeSwitching', function() { | 479 TEST_F('BackgroundTest', 'ModeSwitching', function() { |
| 481 this.runWithLoadedTree('<button></button>', function(root) { | 480 this.runWithLoadedTree('<button></button>', function(root) { |
| 482 var fakeDesktop = {}; | 481 var fakeDesktop = {}; |
| 483 fakeDesktop.role = 'desktop'; | 482 fakeDesktop.role = 'desktop'; |
| 484 fakeDesktop.root = fakeDesktop; | 483 fakeDesktop.root = fakeDesktop; |
| 485 | 484 |
| 486 var fakeWebRoot = {}; | 485 var fakeWebRoot = {}; |
| 487 fakeWebRoot.root = fakeWebRoot; | 486 fakeWebRoot.root = fakeWebRoot; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 */}, function(root) { | 766 */}, function(root) { |
| 768 var nextEditText = this.doCmd('nextEditText'); | 767 var nextEditText = this.doCmd('nextEditText'); |
| 769 var previousEditText = this.doCmd('previousEditText'); | 768 var previousEditText = this.doCmd('previousEditText'); |
| 770 mockFeedback.call(nextEditText) | 769 mockFeedback.call(nextEditText) |
| 771 .expectSpeech('Combo box') | 770 .expectSpeech('Combo box') |
| 772 .call(previousEditText) | 771 .call(previousEditText) |
| 773 .expectSpeech('Edit text') | 772 .expectSpeech('Edit text') |
| 774 .replay(); | 773 .replay(); |
| 775 }); | 774 }); |
| 776 }); | 775 }); |
| OLD | NEW |