| 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_e2e_test_base.js', | 6 GEN_INCLUDE(['../testing/chromevox_e2e_test_base.js', |
| 7 '../testing/assert_additions.js']); | 7 '../testing/assert_additions.js']); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Test fixture for cvox.BrailleTranslatorManager tests. | 10 * Test fixture for cvox.BrailleTranslatorManager tests. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 }); | 90 }); |
| 91 | 91 |
| 92 TEST_F('CvoxBrailleTranslatorManagerTest', 'testRefreshWithoutChange', | 92 TEST_F('CvoxBrailleTranslatorManagerTest', 'testRefreshWithoutChange', |
| 93 function() { | 93 function() { |
| 94 this.addChangeListener(function() { | 94 this.addChangeListener(function() { |
| 95 assertNotEquals(null, this.manager.getExpandingTranslator()); | 95 assertNotEquals(null, this.manager.getExpandingTranslator()); |
| 96 // This works because the fake liblouis is actually not asynchonous. | 96 // This works because the fake liblouis is actually not asynchonous. |
| 97 this.manager.addChangeListener(function() { | 97 this.manager.addChangeListener(function() { |
| 98 assertNotReached('Refresh should not be called without a change.'); | 98 assertNotReached('Refresh should not be called without a change.'); |
| 99 }); | 99 }); |
| 100 this.manager.refresh(); | 100 this.manager.refresh(localStorage['brailleTable']); |
| 101 }); | 101 }); |
| 102 }); | 102 }); |
| 103 | 103 |
| 104 TEST_F('CvoxBrailleTranslatorManagerTest', 'testRefreshWithChange', | 104 TEST_F('CvoxBrailleTranslatorManagerTest', 'testRefreshWithChange', |
| 105 function() { | 105 function() { |
| 106 this.addChangeListener(function() { | 106 this.addChangeListener(function() { |
| 107 assertNotEquals(null, this.manager.getExpandingTranslator()); | 107 assertNotEquals(null, this.manager.getExpandingTranslator()); |
| 108 this.addChangeListener(function() { | 108 this.addChangeListener(function() { |
| 109 assertEquals('en-UEB-g2', this.manager.getDefaultTranslator().table.id); | 109 assertEquals('en-UEB-g2', this.manager.getDefaultTranslator().table.id); |
| 110 assertEquals('en-US-comp8', | 110 assertEquals('en-UEB-g1', |
| 111 this.manager.getUncontractedTranslator().table.id); | 111 this.manager.getUncontractedTranslator().table.id); |
| 112 }); | 112 }); |
| 113 localStorage['brailleTable'] = 'en-UEB-g2'; | 113 this.manager.refresh('en-UEB-g2'); |
| 114 this.manager.refresh(); | |
| 115 }); | 114 }); |
| 116 }); | 115 }); |
| OLD | NEW |