1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/commandline/test/browser_gcli_keyboard4.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,204 @@ 1.4 +/* 1.5 + * Copyright 2012, Mozilla Foundation and contributors 1.6 + * 1.7 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.8 + * you may not use this file except in compliance with the License. 1.9 + * You may obtain a copy of the License at 1.10 + * 1.11 + * http://www.apache.org/licenses/LICENSE-2.0 1.12 + * 1.13 + * Unless required by applicable law or agreed to in writing, software 1.14 + * distributed under the License is distributed on an "AS IS" BASIS, 1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1.16 + * See the License for the specific language governing permissions and 1.17 + * limitations under the License. 1.18 + */ 1.19 + 1.20 +'use strict'; 1.21 +// <INJECTED SOURCE:START> 1.22 + 1.23 +// THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT 1.24 +// DO NOT EDIT IT DIRECTLY 1.25 + 1.26 +var exports = {}; 1.27 + 1.28 +var TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testKeyboard4.js</p>"; 1.29 + 1.30 +function test() { 1.31 + return Task.spawn(function() { 1.32 + let options = yield helpers.openTab(TEST_URI); 1.33 + yield helpers.openToolbar(options); 1.34 + gcli.addItems(mockCommands.items); 1.35 + 1.36 + yield helpers.runTests(options, exports); 1.37 + 1.38 + gcli.removeItems(mockCommands.items); 1.39 + yield helpers.closeToolbar(options); 1.40 + yield helpers.closeTab(options); 1.41 + }).then(finish, helpers.handleError); 1.42 +} 1.43 + 1.44 +// <INJECTED SOURCE:END> 1.45 + 1.46 +// var helpers = require('./helpers'); 1.47 + 1.48 +exports.testIncrFloat = function(options) { 1.49 + return helpers.audit(options, [ 1.50 + /* 1.51 + // See notes at top of testIncr 1.52 + { 1.53 + setup: 'tsf -70<UP>', 1.54 + check: { input: 'tsf -6.5' } 1.55 + }, 1.56 + */ 1.57 + { 1.58 + setup: 'tsf -6.5<UP>', 1.59 + check: { input: 'tsf -6' } 1.60 + }, 1.61 + { 1.62 + setup: 'tsf -6<UP>', 1.63 + check: { input: 'tsf -4.5' } 1.64 + }, 1.65 + { 1.66 + setup: 'tsf -4.5<UP>', 1.67 + check: { input: 'tsf -3' } 1.68 + }, 1.69 + { 1.70 + setup: 'tsf -4<UP>', 1.71 + check: { input: 'tsf -3' } 1.72 + }, 1.73 + { 1.74 + setup: 'tsf -3<UP>', 1.75 + check: { input: 'tsf -1.5' } 1.76 + }, 1.77 + { 1.78 + setup: 'tsf -1.5<UP>', 1.79 + check: { input: 'tsf 0' } 1.80 + }, 1.81 + { 1.82 + setup: 'tsf 0<UP>', 1.83 + check: { input: 'tsf 1.5' } 1.84 + }, 1.85 + { 1.86 + setup: 'tsf 1.5<UP>', 1.87 + check: { input: 'tsf 3' } 1.88 + }, 1.89 + { 1.90 + setup: 'tsf 2<UP>', 1.91 + check: { input: 'tsf 3' } 1.92 + }, 1.93 + { 1.94 + setup: 'tsf 3<UP>', 1.95 + check: { input: 'tsf 4.5' } 1.96 + }, 1.97 + { 1.98 + setup: 'tsf 5<UP>', 1.99 + check: { input: 'tsf 6' } 1.100 + } 1.101 + /* 1.102 + // See notes at top of testIncr 1.103 + { 1.104 + setup: 'tsf 100<UP>', 1.105 + check: { input: 'tsf -6.5' } 1.106 + } 1.107 + */ 1.108 + ]); 1.109 +}; 1.110 + 1.111 +exports.testDecrFloat = function(options) { 1.112 + return helpers.audit(options, [ 1.113 + /* 1.114 + // See notes at top of testIncr 1.115 + { 1.116 + setup: 'tsf -70<DOWN>', 1.117 + check: { input: 'tsf 11.5' } 1.118 + }, 1.119 + */ 1.120 + { 1.121 + setup: 'tsf -6.5<DOWN>', 1.122 + check: { input: 'tsf -6.5' } 1.123 + }, 1.124 + { 1.125 + setup: 'tsf -6<DOWN>', 1.126 + check: { input: 'tsf -6.5' } 1.127 + }, 1.128 + { 1.129 + setup: 'tsf -4.5<DOWN>', 1.130 + check: { input: 'tsf -6' } 1.131 + }, 1.132 + { 1.133 + setup: 'tsf -4<DOWN>', 1.134 + check: { input: 'tsf -4.5' } 1.135 + }, 1.136 + { 1.137 + setup: 'tsf -3<DOWN>', 1.138 + check: { input: 'tsf -4.5' } 1.139 + }, 1.140 + { 1.141 + setup: 'tsf -1.5<DOWN>', 1.142 + check: { input: 'tsf -3' } 1.143 + }, 1.144 + { 1.145 + setup: 'tsf 0<DOWN>', 1.146 + check: { input: 'tsf -1.5' } 1.147 + }, 1.148 + { 1.149 + setup: 'tsf 1.5<DOWN>', 1.150 + check: { input: 'tsf 0' } 1.151 + }, 1.152 + { 1.153 + setup: 'tsf 2<DOWN>', 1.154 + check: { input: 'tsf 1.5' } 1.155 + }, 1.156 + { 1.157 + setup: 'tsf 3<DOWN>', 1.158 + check: { input: 'tsf 1.5' } 1.159 + }, 1.160 + { 1.161 + setup: 'tsf 5<DOWN>', 1.162 + check: { input: 'tsf 4.5' } 1.163 + } 1.164 + /* 1.165 + // See notes at top of testIncr 1.166 + { 1.167 + setup: 'tsf 100<DOWN>', 1.168 + check: { input: 'tsf 11.5' } 1.169 + } 1.170 + */ 1.171 + ]); 1.172 +}; 1.173 + 1.174 +exports.testIncrSelection = function(options) { 1.175 + /* 1.176 + // Bug 829516: GCLI up/down navigation over selection is sometimes bizarre 1.177 + return helpers.audit(options, [ 1.178 + { 1.179 + setup: 'tselarr <DOWN>', 1.180 + check: { hints: '2' }, 1.181 + exec: {} 1.182 + }, 1.183 + { 1.184 + setup: 'tselarr <DOWN><DOWN>', 1.185 + check: { hints: '3' }, 1.186 + exec: {} 1.187 + }, 1.188 + { 1.189 + setup: 'tselarr <DOWN><DOWN><DOWN>', 1.190 + check: { hints: '1' }, 1.191 + exec: {} 1.192 + } 1.193 + ]); 1.194 + */ 1.195 +}; 1.196 + 1.197 +exports.testDecrSelection = function(options) { 1.198 + /* 1.199 + // Bug 829516: GCLI up/down navigation over selection is sometimes bizarre 1.200 + return helpers.audit(options, [ 1.201 + { 1.202 + setup: 'tselarr <UP>', 1.203 + check: { hints: '3' } 1.204 + } 1.205 + ]); 1.206 + */ 1.207 +};