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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/braille/braille_display_manager_test.unitjs

Issue 2401393003: Add multiline braille support. (Closed)
Patch Set: Fixed tests and addressed comments Created 4 years, 1 month 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
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_unittest_base.js', 6 GEN_INCLUDE(['../testing/chromevox_unittest_base.js',
7 '../testing/fake_objects.js']); 7 '../testing/fake_objects.js']);
8 8
9 /** 9 /**
10 * Test fixture. 10 * Test fixture.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 }.bind(this); 42 }.bind(this);
43 this.writtenCells = []; 43 this.writtenCells = [];
44 chrome.brailleDisplayPrivate.writeDots = function(cells) { 44 chrome.brailleDisplayPrivate.writeDots = function(cells) {
45 this.writtenCells.push(cells); 45 this.writtenCells.push(cells);
46 }.bind(this); 46 }.bind(this);
47 chrome.brailleDisplayPrivate.onDisplayStateChanged = new FakeChromeEvent(); 47 chrome.brailleDisplayPrivate.onDisplayStateChanged = new FakeChromeEvent();
48 chrome.brailleDisplayPrivate.onKeyEvent = new FakeChromeEvent(); 48 chrome.brailleDisplayPrivate.onKeyEvent = new FakeChromeEvent();
49 }, 49 },
50 50
51 displayAvailable: function() { 51 displayAvailable: function() {
52 this.displayState = {available: true, textCellCount: this.DISPLAY_SIZE}; 52 this.displayState = {available: true, textRowCount: 1, textColumnCount: this .DISPLAY_SIZE};
53 }, 53 },
54 54
55 /** 55 /**
56 * Asserts display pan position and selection markers on the last written 56 * Asserts display pan position and selection markers on the last written
57 * display content and clears it. There must be exactly one 57 * display content and clears it. There must be exactly one
58 * set of cells written. 58 * set of cells written.
59 * @param {number} start expected pan position 59 * @param {number} start expected pan position
60 * @param {number=} opt_selStart first cell (relative to buffer start that 60 * @param {number=} opt_selStart first cell (relative to buffer start that
61 * should have a selection 61 * should have a selection
62 * @param {number=} opt_selEnd last cell that should have a selection. 62 * @param {number=} opt_selEnd last cell that should have a selection.
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 var text = 'knowledgeIsPower'; 345 var text = 'knowledgeIsPower';
346 var translated = '1X23X45678'; 346 var translated = '1X23X45678';
347 var mapping = [0, 9, 9, 10, 11, 11, 12, 13, 14, 15]; 347 var mapping = [0, 9, 9, 10, 11, 11, 12, 13, 14, 15];
348 var expected = [['knowledge', '1'], ['I', 'X2'], ['s', '3'], ['P', 'X4'], 348 var expected = [['knowledge', '1'], ['I', 'X2'], ['s', '3'], ['P', 'X4'],
349 ['o', '5'], ['w', '6'], ['e', '7'], ['r', '8']]; 349 ['o', '5'], ['w', '6'], ['e', '7'], ['r', '8']];
350 350
351 var groups = cvox.BrailleCaptionsBackground.groupBrailleAndText( 351 var groups = cvox.BrailleCaptionsBackground.groupBrailleAndText(
352 translated, text, mapping); 352 translated, text, mapping);
353 this.assertGroupsValid(groups, expected); 353 this.assertGroupsValid(groups, expected);
354 }); 354 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698