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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/command_store_test.unitjs

Issue 2054473003: Implement update notifications for ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 6 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
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 7
8 /** 8 /**
9 * Test fixture. 9 * Test fixture.
10 * @constructor 10 * @constructor
11 * @extends {ChromeVoxUnitTestBase} 11 * @extends {ChromeVoxUnitTestBase}
12 */ 12 */
13 function CvoxCommandStoreUnitTest() {} 13 function CvoxCommandStoreUnitTest() {}
14 14
15 CvoxCommandStoreUnitTest.prototype = { 15 CvoxCommandStoreUnitTest.prototype = {
16 __proto__: ChromeVoxUnitTestBase.prototype, 16 __proto__: ChromeVoxUnitTestBase.prototype,
17 17
18 /** @override */ 18 /** @override */
19 closureModuleDeps: [ 19 closureModuleDeps: [
20 'cvox.ChromeVoxUserCommands', 20 'cvox.ChromeVoxUserCommands',
21 'cvox.CommandStore', 21 'cvox.CommandStore',
22 ] 22 ]
23 }; 23 };
24 24
25 TEST_F('CvoxCommandStoreUnitTest', 'TableData', function() { 25 TEST_F('CvoxCommandStoreUnitTest', 'TableData', function() {
26 var categories = cvox.CommandStore.categories(); 26 var categories = cvox.CommandStore.categories();
27 assertEquals(10, categories.length); 27 assertEquals(10, categories.length);
28 assertEquals('modifier_keys', categories[0]); 28 assertEquals('modifier_keys', categories[0]);
29 assertEquals('controlling_speech', categories[1]); 29 assertEquals('controlling_speech', categories[1]);
30 assertEquals('navigation', categories[2]); 30 assertEquals('help_commands', categories[2]);
31 assertEquals('information', categories[3]); 31 assertEquals('navigation', categories[3]);
32 assertEquals('help_commands', categories[4]); 32 assertEquals('information', categories[4]);
33 assertEquals('overview', categories[5]); 33 assertEquals('overview', categories[5]);
34 assertEquals('jump_commands', categories[6]); 34 assertEquals('jump_commands', categories[6]);
35 assertEquals('tables', categories[7]); 35 assertEquals('tables', categories[7]);
36 36
37 assertEquals('stop_speech_key', 37 assertEquals('stop_speech_key',
38 cvox.CommandStore.messageForCommand('stopSpeech')); 38 cvox.CommandStore.messageForCommand('stopSpeech'));
39 assertEquals('controlling_speech', 39 assertEquals('controlling_speech',
40 cvox.CommandStore.categoryForCommand('stopSpeech')); 40 cvox.CommandStore.categoryForCommand('stopSpeech'));
41 41
42 var controllingSpeechCmds = 42 var controllingSpeechCmds =
(...skipping 20 matching lines...) Expand all
63 var categories = cvox.CommandStore.categories(); 63 var categories = cvox.CommandStore.categories();
64 for (var i = 0; i < categories.length; i++) { 64 for (var i = 0; i < categories.length; i++) {
65 var commands = cvox.CommandStore.commandsForCategory(categories[i]); 65 var commands = cvox.CommandStore.commandsForCategory(categories[i]);
66 for (j = 0; j < commands.length; j++) { 66 for (j = 0; j < commands.length; j++) {
67 var command = commands[j]; 67 var command = commands[j];
68 assertEquals(command + ' function', 68 assertEquals(command + ' function',
69 command + ' ' + typeof(cvox.ChromeVoxUserCommands.commands[command])); 69 command + ' ' + typeof(cvox.ChromeVoxUserCommands.commands[command]));
70 } 70 }
71 } 71 }
72 }); 72 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698