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

Unified Diff: chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs

Issue 927313002: Fix and reenable liblouis chromevox tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_api
Patch Set: Fix BrailleTranslatorManager tests that broke when fetchTables was moved into the event handler. Created 5 years, 10 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
Index: chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs b/chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs
index 8555b27eec8ecc7b5474eebc14b295f27a95a7f9..7e7ef9f946fe6d29bfc6ea00fe5d820212eea0b1 100644
--- a/chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs
@@ -22,7 +22,15 @@ CvoxBrailleTranslatorManagerTest.prototype = {
setUp: function() {
this.liblouis = new FakeLibLouis();
this.manager = new cvox.BrailleTranslatorManager(this.liblouis);
- this.liblouis.translator_manager = this.manager;
+ this.liblouis.translatorManager = this.manager;
+ // This is called by an event handler in production, but we don't rely
+ // on that for this test.
+ this.manager.loadLiblouis_();
+ },
+
+ addChangeListener: function(callback) {
+ return this.manager.addChangeListener(this.continueTest(
+ WhenTestDone.ASSERT, callback));
},
};
@@ -36,7 +44,7 @@ FakeLibLouis.prototype = {
/** @override */
getTranslator: function(fileNames, callback) {
- var tables = this.translator_manager.getTablesForTest();
+ var tables = this.translatorManager.getTablesForTest();
var result = null;
if (tables != null) {
var found = tables.filter(function(table) {
@@ -73,7 +81,7 @@ TEST_F('CvoxBrailleTranslatorManagerTest', 'testInitial', function() {
assertEquals(null, this.manager.getExpandingTranslator());
assertEquals(null, this.manager.getDefaultTranslator());
assertEquals(null, this.manager.getUncontractedTranslator());
- this.manager.addChangeListener(function() {
+ this.addChangeListener(function() {
assertNotEquals(null, this.manager.getExpandingTranslator());
assertEquals('en-US-comp8', this.manager.getDefaultTranslator().table.id);
assertEquals(null, this.manager.getUncontractedTranslator());
@@ -83,10 +91,10 @@ TEST_F('CvoxBrailleTranslatorManagerTest', 'testInitial', function() {
TEST_F('CvoxBrailleTranslatorManagerTest', 'testRefreshWithoutChange',
function() {
- this.manager.addChangeListener(callOnce(function() {
+ this.addChangeListener(callOnce(function() {
assertNotEquals(null, this.manager.getExpandingTranslator());
- // This works because the fake liblouis is actually not synchonous.
- this.manager.addChangeListener(function() {
+ // This works because the fake liblouis is actually not asynchonous.
+ this.addChangeListener(function() {
throw Error('Should not be called.');
});
this.manager.refresh();
@@ -96,9 +104,9 @@ TEST_F('CvoxBrailleTranslatorManagerTest', 'testRefreshWithoutChange',
TEST_F('CvoxBrailleTranslatorManagerTest', 'testRefreshWithChange',
function() {
- this.manager.addChangeListener(callOnce(function() {
+ this.addChangeListener(callOnce(function() {
assertNotEquals(null, this.manager.getExpandingTranslator());
- this.manager.addChangeListener(function() {
+ this.addChangeListener(function() {
assertEquals('en-UEB-g2', this.manager.getDefaultTranslator().table.id);
assertEquals('en-US-comp8',
this.manager.getUncontractedTranslator().table.id);

Powered by Google App Engine
This is Rietveld 408576698