browser/devtools/commandline/test/browser_gcli_cli2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/commandline/test/browser_gcli_cli2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,825 @@
     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-testCli2.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 +var nodetype = require('gcli/types/node');
    1.49 +
    1.50 +exports.setup = function(options) {
    1.51 +  if (options.window) {
    1.52 +    nodetype.setDocument(options.window.document);
    1.53 +  }
    1.54 +};
    1.55 +
    1.56 +exports.shutdown = function(options) {
    1.57 +  nodetype.unsetDocument();
    1.58 +};
    1.59 +
    1.60 +exports.testSingleString = function(options) {
    1.61 +  return helpers.audit(options, [
    1.62 +    {
    1.63 +      setup:    'tsr',
    1.64 +      check: {
    1.65 +        input:  'tsr',
    1.66 +        hints:     ' <text>',
    1.67 +        markup: 'VVV',
    1.68 +        cursor: 3,
    1.69 +        current: '__command',
    1.70 +        status: 'ERROR',
    1.71 +        unassigned: [ ],
    1.72 +        args: {
    1.73 +          command: { name: 'tsr' },
    1.74 +          text: {
    1.75 +            value: undefined,
    1.76 +            arg: '',
    1.77 +            status: 'INCOMPLETE',
    1.78 +            message: 'Value required for \'text\'.'
    1.79 +          }
    1.80 +        }
    1.81 +      }
    1.82 +    },
    1.83 +    {
    1.84 +      setup:    'tsr ',
    1.85 +      check: {
    1.86 +        input:  'tsr ',
    1.87 +        hints:      '<text>',
    1.88 +        markup: 'VVVV',
    1.89 +        cursor: 4,
    1.90 +        current: 'text',
    1.91 +        status: 'ERROR',
    1.92 +        predictions: [ ],
    1.93 +        unassigned: [ ],
    1.94 +        args: {
    1.95 +          command: { name: 'tsr' },
    1.96 +          text: {
    1.97 +            value: undefined,
    1.98 +            arg: '',
    1.99 +            status: 'INCOMPLETE',
   1.100 +            message: 'Value required for \'text\'.'
   1.101 +          }
   1.102 +        }
   1.103 +      }
   1.104 +    },
   1.105 +    {
   1.106 +      setup:    'tsr h',
   1.107 +      check: {
   1.108 +        input:  'tsr h',
   1.109 +        hints:       '',
   1.110 +        markup: 'VVVVV',
   1.111 +        cursor: 5,
   1.112 +        current: 'text',
   1.113 +        status: 'VALID',
   1.114 +        predictions: [ ],
   1.115 +        unassigned: [ ],
   1.116 +        args: {
   1.117 +          command: { name: 'tsr' },
   1.118 +          text: {
   1.119 +            value: 'h',
   1.120 +            arg: ' h',
   1.121 +            status: 'VALID',
   1.122 +            message: ''
   1.123 +          }
   1.124 +        }
   1.125 +      }
   1.126 +    },
   1.127 +    {
   1.128 +      setup:    'tsr "h h"',
   1.129 +      check: {
   1.130 +        input:  'tsr "h h"',
   1.131 +        hints:           '',
   1.132 +        markup: 'VVVVVVVVV',
   1.133 +        cursor: 9,
   1.134 +        current: 'text',
   1.135 +        status: 'VALID',
   1.136 +        predictions: [ ],
   1.137 +        unassigned: [ ],
   1.138 +        args: {
   1.139 +          command: { name: 'tsr' },
   1.140 +          text: {
   1.141 +            value: 'h h',
   1.142 +            arg: ' "h h"',
   1.143 +            status: 'VALID',
   1.144 +            message: ''
   1.145 +          }
   1.146 +        }
   1.147 +      }
   1.148 +    },
   1.149 +    {
   1.150 +      setup:    'tsr h h h',
   1.151 +      check: {
   1.152 +        input:  'tsr h h h',
   1.153 +        hints:           '',
   1.154 +        markup: 'VVVVVVVVV',
   1.155 +        cursor: 9,
   1.156 +        current: 'text',
   1.157 +        status: 'VALID',
   1.158 +        predictions: [ ],
   1.159 +        unassigned: [ ],
   1.160 +        args: {
   1.161 +          command: { name: 'tsr' },
   1.162 +          text: {
   1.163 +            value: 'h h h',
   1.164 +            arg: ' h h h',
   1.165 +            status: 'VALID',
   1.166 +            message: ''
   1.167 +          }
   1.168 +        }
   1.169 +      }
   1.170 +    }
   1.171 +  ]);
   1.172 +};
   1.173 +
   1.174 +exports.testSingleNumber = function(options) {
   1.175 +  return helpers.audit(options, [
   1.176 +    {
   1.177 +      setup:    'tsu',
   1.178 +      check: {
   1.179 +        input:  'tsu',
   1.180 +        hints:     ' <num>',
   1.181 +        markup: 'VVV',
   1.182 +        cursor: 3,
   1.183 +        current: '__command',
   1.184 +        status: 'ERROR',
   1.185 +        predictions: [ ],
   1.186 +        unassigned: [ ],
   1.187 +        args: {
   1.188 +          command: { name: 'tsu' },
   1.189 +          num: {
   1.190 +            value: undefined,
   1.191 +            arg: '',
   1.192 +            status: 'INCOMPLETE',
   1.193 +            message: 'Value required for \'num\'.'
   1.194 +          }
   1.195 +        }
   1.196 +      }
   1.197 +    },
   1.198 +    {
   1.199 +      setup:    'tsu ',
   1.200 +      check: {
   1.201 +        input:  'tsu ',
   1.202 +        hints:      '<num>',
   1.203 +        markup: 'VVVV',
   1.204 +        cursor: 4,
   1.205 +        current: 'num',
   1.206 +        status: 'ERROR',
   1.207 +        predictions: [ ],
   1.208 +        unassigned: [ ],
   1.209 +        args: {
   1.210 +          command: { name: 'tsu' },
   1.211 +          num: {
   1.212 +            value: undefined,
   1.213 +            arg: '',
   1.214 +            status: 'INCOMPLETE',
   1.215 +            message: 'Value required for \'num\'.'
   1.216 +          }
   1.217 +        }
   1.218 +      }
   1.219 +    },
   1.220 +    {
   1.221 +      setup:    'tsu 1',
   1.222 +      check: {
   1.223 +        input:  'tsu 1',
   1.224 +        hints:       '',
   1.225 +        markup: 'VVVVV',
   1.226 +        cursor: 5,
   1.227 +        current: 'num',
   1.228 +        status: 'VALID',
   1.229 +        predictions: [ ],
   1.230 +        unassigned: [ ],
   1.231 +        args: {
   1.232 +          command: { name: 'tsu' },
   1.233 +          num: { value: 1, arg: ' 1', status: 'VALID', message: '' }
   1.234 +        }
   1.235 +      }
   1.236 +    },
   1.237 +    {
   1.238 +      setup:    'tsu x',
   1.239 +      check: {
   1.240 +        input:  'tsu x',
   1.241 +        hints:       '',
   1.242 +        markup: 'VVVVE',
   1.243 +        cursor: 5,
   1.244 +        current: 'num',
   1.245 +        status: 'ERROR',
   1.246 +        predictions: [ ],
   1.247 +        unassigned: [ ],
   1.248 +        tooltipState: 'true:isError',
   1.249 +        args: {
   1.250 +          command: { name: 'tsu' },
   1.251 +          num: {
   1.252 +            value: undefined,
   1.253 +            arg: ' x',
   1.254 +            status: 'ERROR',
   1.255 +            message: 'Can\'t convert "x" to a number.'
   1.256 +          }
   1.257 +        }
   1.258 +      }
   1.259 +    },
   1.260 +    {
   1.261 +      setup:    'tsu 1.5',
   1.262 +      check: {
   1.263 +        input:  'tsu 1.5',
   1.264 +        hints:       '',
   1.265 +        markup: 'VVVVEEE',
   1.266 +        cursor: 7,
   1.267 +        current: 'num',
   1.268 +        status: 'ERROR',
   1.269 +        predictions: [ ],
   1.270 +        unassigned: [ ],
   1.271 +        args: {
   1.272 +          command: { name: 'tsu' },
   1.273 +          num: {
   1.274 +            value: undefined,
   1.275 +            arg: ' 1.5',
   1.276 +            status: 'ERROR',
   1.277 +            message: 'Can\'t convert "1.5" to an integer.'
   1.278 +          }
   1.279 +        }
   1.280 +      }
   1.281 +    }
   1.282 +  ]);
   1.283 +};
   1.284 +
   1.285 +exports.testSingleFloat = function(options) {
   1.286 +  return helpers.audit(options, [
   1.287 +    {
   1.288 +      setup:    'tsf',
   1.289 +      check: {
   1.290 +        input:  'tsf',
   1.291 +        hints:     ' <num>',
   1.292 +        markup: 'VVV',
   1.293 +        cursor: 3,
   1.294 +        current: '__command',
   1.295 +        status: 'ERROR',
   1.296 +        error: '',
   1.297 +        unassigned: [ ],
   1.298 +        args: {
   1.299 +          command: { name: 'tsf' },
   1.300 +          num: {
   1.301 +            value: undefined,
   1.302 +            arg: '',
   1.303 +            status: 'INCOMPLETE',
   1.304 +            message: 'Value required for \'num\'.'
   1.305 +          }
   1.306 +        }
   1.307 +      }
   1.308 +    },
   1.309 +    {
   1.310 +      setup:    'tsf 1',
   1.311 +      check: {
   1.312 +        input:  'tsf 1',
   1.313 +        hints:       '',
   1.314 +        markup: 'VVVVV',
   1.315 +        cursor: 5,
   1.316 +        current: 'num',
   1.317 +        status: 'VALID',
   1.318 +        error: '',
   1.319 +        predictions: [ ],
   1.320 +        unassigned: [ ],
   1.321 +        args: {
   1.322 +          command: { name: 'tsf' },
   1.323 +          num: { value: 1, arg: ' 1', status: 'VALID', message: '' }
   1.324 +        }
   1.325 +      }
   1.326 +    },
   1.327 +    {
   1.328 +      setup:    'tsf 1.',
   1.329 +      check: {
   1.330 +        input:  'tsf 1.',
   1.331 +        hints:        '',
   1.332 +        markup: 'VVVVVV',
   1.333 +        cursor: 6,
   1.334 +        current: 'num',
   1.335 +        status: 'VALID',
   1.336 +        error: '',
   1.337 +        predictions: [ ],
   1.338 +        unassigned: [ ],
   1.339 +        args: {
   1.340 +          command: { name: 'tsf' },
   1.341 +          num: { value: 1, arg: ' 1.', status: 'VALID', message: '' }
   1.342 +        }
   1.343 +      }
   1.344 +    },
   1.345 +    {
   1.346 +      setup:    'tsf 1.5',
   1.347 +      check: {
   1.348 +        input:  'tsf 1.5',
   1.349 +        hints:         '',
   1.350 +        markup: 'VVVVVVV',
   1.351 +        cursor: 7,
   1.352 +        current: 'num',
   1.353 +        status: 'VALID',
   1.354 +        error: '',
   1.355 +        predictions: [ ],
   1.356 +        unassigned: [ ],
   1.357 +        args: {
   1.358 +          command: { name: 'tsf' },
   1.359 +          num: { value: 1.5, arg: ' 1.5', status: 'VALID', message: '' }
   1.360 +        }
   1.361 +      }
   1.362 +    },
   1.363 +    {
   1.364 +      setup:    'tsf 1.5x',
   1.365 +      check: {
   1.366 +        input:  'tsf 1.5x',
   1.367 +        hints:          '',
   1.368 +        markup: 'VVVVVVVV',
   1.369 +        cursor: 8,
   1.370 +        current: 'num',
   1.371 +        status: 'VALID',
   1.372 +        error: '',
   1.373 +        predictions: [ ],
   1.374 +        unassigned: [ ],
   1.375 +        args: {
   1.376 +          command: { name: 'tsf' },
   1.377 +          num: { value: 1.5, arg: ' 1.5x', status: 'VALID', message: '' }
   1.378 +        }
   1.379 +      }
   1.380 +    },
   1.381 +    {
   1.382 +      skipRemainingIf: options.isNoDom,
   1.383 +      name: 'tsf x (cursor=4)',
   1.384 +      setup: function() {
   1.385 +        return helpers.setInput(options, 'tsf x', 4);
   1.386 +      },
   1.387 +      check: {
   1.388 +        input:  'tsf x',
   1.389 +        hints:       '',
   1.390 +        markup: 'VVVVE',
   1.391 +        cursor: 4,
   1.392 +        current: 'num',
   1.393 +        status: 'ERROR',
   1.394 +        error: 'Can\'t convert "x" to a number.',
   1.395 +        predictions: [ ],
   1.396 +        unassigned: [ ],
   1.397 +        args: {
   1.398 +          command: { name: 'tsf' },
   1.399 +          num: {
   1.400 +            value: undefined,
   1.401 +            arg: ' x',
   1.402 +            status: 'ERROR',
   1.403 +            message: 'Can\'t convert "x" to a number.'
   1.404 +          }
   1.405 +        }
   1.406 +      }
   1.407 +    }
   1.408 +  ]);
   1.409 +};
   1.410 +
   1.411 +exports.testElementWeb = function(options) {
   1.412 +  var inputElement = options.isNoDom ?
   1.413 +      null :
   1.414 +      options.window.document.getElementById('gcli-input');
   1.415 +
   1.416 +  return helpers.audit(options, [
   1.417 +    {
   1.418 +      skipIf: function gcliInputElementExists() {
   1.419 +        return inputElement == null;
   1.420 +      },
   1.421 +      setup:    'tse #gcli-input',
   1.422 +      check: {
   1.423 +        input:  'tse #gcli-input',
   1.424 +        hints:                 ' [options]',
   1.425 +        markup: 'VVVVVVVVVVVVVVV',
   1.426 +        cursor: 15,
   1.427 +        current: 'node',
   1.428 +        status: 'VALID',
   1.429 +        predictions: [ ],
   1.430 +        unassigned: [ ],
   1.431 +        args: {
   1.432 +          command: { name: 'tse' },
   1.433 +          node: {
   1.434 +            value: inputElement,
   1.435 +            arg: ' #gcli-input',
   1.436 +            status: 'VALID',
   1.437 +            message: ''
   1.438 +          },
   1.439 +          nodes: { arg: '', status: 'VALID', message: '' },
   1.440 +          nodes2: { arg: '', status: 'VALID', message: '' },
   1.441 +        }
   1.442 +      }
   1.443 +    }
   1.444 +  ]);
   1.445 +};
   1.446 +
   1.447 +exports.testElement = function(options) {
   1.448 +  return helpers.audit(options, [
   1.449 +    {
   1.450 +      skipRemainingIf: options.isNoDom,
   1.451 +      setup:    'tse',
   1.452 +      check: {
   1.453 +        input:  'tse',
   1.454 +        hints:     ' <node> [options]',
   1.455 +        markup: 'VVV',
   1.456 +        cursor: 3,
   1.457 +        current: '__command',
   1.458 +        status: 'ERROR',
   1.459 +        predictions: [ 'tse', 'tselarr' ],
   1.460 +        unassigned: [ ],
   1.461 +        args: {
   1.462 +          command: { name: 'tse' },
   1.463 +          node: { value: undefined, arg: '', status: 'INCOMPLETE' },
   1.464 +          nodes: { arg: '', status: 'VALID', message: '' },
   1.465 +          nodes2: { arg: '', status: 'VALID', message: '' },
   1.466 +        }
   1.467 +      }
   1.468 +    },
   1.469 +    {
   1.470 +      setup:    'tse #gcli-nomatch',
   1.471 +      check: {
   1.472 +        input:  'tse #gcli-nomatch',
   1.473 +        hints:                   ' [options]',
   1.474 +        markup: 'VVVVIIIIIIIIIIIII',
   1.475 +        cursor: 17,
   1.476 +        current: 'node',
   1.477 +        status: 'ERROR',
   1.478 +        predictions: [ ],
   1.479 +        unassigned: [ ],
   1.480 +        outputState: 'false:default',
   1.481 +        tooltipState: 'true:isError',
   1.482 +        args: {
   1.483 +          command: { name: 'tse' },
   1.484 +          node: {
   1.485 +            value: undefined,
   1.486 +            arg: ' #gcli-nomatch',
   1.487 +            // This is somewhat debatable because this input can't be corrected
   1.488 +            // simply by typing so it's and error rather than incomplete,
   1.489 +            // however without digging into the CSS engine we can't tell that
   1.490 +            // so we default to incomplete
   1.491 +            status: 'INCOMPLETE',
   1.492 +            message: 'No matches'
   1.493 +          },
   1.494 +          nodes: { arg: '', status: 'VALID', message: '' },
   1.495 +          nodes2: { arg: '', status: 'VALID', message: '' },
   1.496 +        }
   1.497 +      }
   1.498 +    },
   1.499 +    {
   1.500 +      setup:    'tse #',
   1.501 +      check: {
   1.502 +        input:  'tse #',
   1.503 +        hints:       ' [options]',
   1.504 +        markup: 'VVVVE',
   1.505 +        cursor: 5,
   1.506 +        current: 'node',
   1.507 +        status: 'ERROR',
   1.508 +        predictions: [ ],
   1.509 +        unassigned: [ ],
   1.510 +        tooltipState: 'true:isError',
   1.511 +        args: {
   1.512 +          command: { name: 'tse' },
   1.513 +          node: {
   1.514 +            value: undefined,
   1.515 +            arg: ' #',
   1.516 +            status: 'ERROR',
   1.517 +            message: 'Syntax error in CSS query'
   1.518 +          },
   1.519 +          nodes: { arg: '', status: 'VALID', message: '' },
   1.520 +          nodes2: { arg: '', status: 'VALID', message: '' },
   1.521 +        }
   1.522 +      }
   1.523 +    },
   1.524 +    {
   1.525 +      setup:    'tse .',
   1.526 +      check: {
   1.527 +        input:  'tse .',
   1.528 +        hints:       ' [options]',
   1.529 +        markup: 'VVVVE',
   1.530 +        cursor: 5,
   1.531 +        current: 'node',
   1.532 +        status: 'ERROR',
   1.533 +        predictions: [ ],
   1.534 +        unassigned: [ ],
   1.535 +        tooltipState: 'true:isError',
   1.536 +        args: {
   1.537 +          command: { name: 'tse' },
   1.538 +          node: {
   1.539 +            value: undefined,
   1.540 +            arg: ' .',
   1.541 +            status: 'ERROR',
   1.542 +            message: 'Syntax error in CSS query'
   1.543 +          },
   1.544 +          nodes: { arg: '', status: 'VALID', message: '' },
   1.545 +          nodes2: { arg: '', status: 'VALID', message: '' },
   1.546 +        }
   1.547 +      }
   1.548 +    },
   1.549 +    {
   1.550 +      setup:    'tse *',
   1.551 +      check: {
   1.552 +        input:  'tse *',
   1.553 +        hints:       ' [options]',
   1.554 +        markup: 'VVVVE',
   1.555 +        cursor: 5,
   1.556 +        current: 'node',
   1.557 +        status: 'ERROR',
   1.558 +        predictions: [ ],
   1.559 +        unassigned: [ ],
   1.560 +        tooltipState: 'true:isError',
   1.561 +        args: {
   1.562 +          command: { name: 'tse' },
   1.563 +          node: {
   1.564 +            value: undefined,
   1.565 +            arg: ' *',
   1.566 +            status: 'ERROR',
   1.567 +            message: /^Too many matches \([0-9]*\)/
   1.568 +          },
   1.569 +          nodes: { arg: '', status: 'VALID', message: '' },
   1.570 +          nodes2: { arg: '', status: 'VALID', message: '' },
   1.571 +        }
   1.572 +      }
   1.573 +    }
   1.574 +  ]);
   1.575 +};
   1.576 +
   1.577 +exports.testNestedCommand = function(options) {
   1.578 +  return helpers.audit(options, [
   1.579 +    {
   1.580 +      setup:    'tsn',
   1.581 +      check: {
   1.582 +        input:  'tsn',
   1.583 +        hints:     ' deep down nested cmd',
   1.584 +        markup: 'III',
   1.585 +        cursor: 3,
   1.586 +        current: '__command',
   1.587 +        status: 'ERROR',
   1.588 +        predictionsInclude: [
   1.589 +          'tsn deep', 'tsn deep down', 'tsn deep down nested',
   1.590 +          'tsn deep down nested cmd', 'tsn dif'
   1.591 +        ],
   1.592 +        unassigned: [ ],
   1.593 +        args: {
   1.594 +          command: { name: 'tsn' }
   1.595 +        }
   1.596 +      }
   1.597 +    },
   1.598 +    {
   1.599 +      setup:    'tsn ',
   1.600 +      check: {
   1.601 +        input:  'tsn ',
   1.602 +        hints:      ' deep down nested cmd',
   1.603 +        markup: 'IIIV',
   1.604 +        cursor: 4,
   1.605 +        current: '__command',
   1.606 +        status: 'ERROR',
   1.607 +        unassigned: [ ]
   1.608 +      }
   1.609 +    },
   1.610 +    {
   1.611 +      skipIf: options.isPhantomjs,
   1.612 +      setup:    'tsn x',
   1.613 +      check: {
   1.614 +        input:  'tsn x',
   1.615 +        hints:       ' -> tsn ext',
   1.616 +        markup: 'IIIVI',
   1.617 +        cursor: 5,
   1.618 +        current: '__command',
   1.619 +        status: 'ERROR',
   1.620 +        predictions: [ 'tsn ext' ],
   1.621 +        unassigned: [ ]
   1.622 +      }
   1.623 +    },
   1.624 +    {
   1.625 +      setup:    'tsn dif',
   1.626 +      check: {
   1.627 +        input:  'tsn dif',
   1.628 +        hints:         ' <text>',
   1.629 +        markup: 'VVVVVVV',
   1.630 +        cursor: 7,
   1.631 +        current: '__command',
   1.632 +        status: 'ERROR',
   1.633 +        predictions: [ ],
   1.634 +        unassigned: [ ],
   1.635 +        args: {
   1.636 +          command: { name: 'tsn dif' },
   1.637 +          text: {
   1.638 +            value: undefined,
   1.639 +            arg: '',
   1.640 +            status: 'INCOMPLETE',
   1.641 +            message: 'Value required for \'text\'.'
   1.642 +          }
   1.643 +        }
   1.644 +      }
   1.645 +    },
   1.646 +    {
   1.647 +      setup:    'tsn dif ',
   1.648 +      check: {
   1.649 +        input:  'tsn dif ',
   1.650 +        hints:          '<text>',
   1.651 +        markup: 'VVVVVVVV',
   1.652 +        cursor: 8,
   1.653 +        current: 'text',
   1.654 +        status: 'ERROR',
   1.655 +        predictions: [ ],
   1.656 +        unassigned: [ ],
   1.657 +        args: {
   1.658 +          command: { name: 'tsn dif' },
   1.659 +          text: {
   1.660 +            value: undefined,
   1.661 +            arg: '',
   1.662 +            status: 'INCOMPLETE',
   1.663 +            message: 'Value required for \'text\'.'
   1.664 +          }
   1.665 +        }
   1.666 +      }
   1.667 +    },
   1.668 +    {
   1.669 +      setup:    'tsn dif x',
   1.670 +      check: {
   1.671 +        input:  'tsn dif x',
   1.672 +        hints:           '',
   1.673 +        markup: 'VVVVVVVVV',
   1.674 +        cursor: 9,
   1.675 +        current: 'text',
   1.676 +        status: 'VALID',
   1.677 +        predictions: [ ],
   1.678 +        unassigned: [ ],
   1.679 +        args: {
   1.680 +          command: { name: 'tsn dif' },
   1.681 +          text: { value: 'x', arg: ' x', status: 'VALID', message: '' }
   1.682 +        }
   1.683 +      }
   1.684 +    },
   1.685 +    {
   1.686 +      setup:    'tsn ext',
   1.687 +      check: {
   1.688 +        input:  'tsn ext',
   1.689 +        hints:         ' <text>',
   1.690 +        markup: 'VVVVVVV',
   1.691 +        cursor: 7,
   1.692 +        current: '__command',
   1.693 +        status: 'ERROR',
   1.694 +        predictions: [ 'tsn ext', 'tsn exte', 'tsn exten', 'tsn extend' ],
   1.695 +        unassigned: [ ],
   1.696 +        args: {
   1.697 +          command: { name: 'tsn ext' },
   1.698 +          text: {
   1.699 +            value: undefined,
   1.700 +            arg: '',
   1.701 +            status: 'INCOMPLETE',
   1.702 +            message: 'Value required for \'text\'.'
   1.703 +          }
   1.704 +        }
   1.705 +      }
   1.706 +    },
   1.707 +    {
   1.708 +      setup:    'tsn exte',
   1.709 +      check: {
   1.710 +        input:  'tsn exte',
   1.711 +        hints:          ' <text>',
   1.712 +        markup: 'VVVVVVVV',
   1.713 +        cursor: 8,
   1.714 +        current: '__command',
   1.715 +        status: 'ERROR',
   1.716 +        predictions: [ 'tsn exte', 'tsn exten', 'tsn extend' ],
   1.717 +        unassigned: [ ],
   1.718 +        args: {
   1.719 +          command: { name: 'tsn exte' },
   1.720 +          text: {
   1.721 +            value: undefined,
   1.722 +            arg: '',
   1.723 +            status: 'INCOMPLETE',
   1.724 +            message: 'Value required for \'text\'.'
   1.725 +          }
   1.726 +        }
   1.727 +      }
   1.728 +    },
   1.729 +    {
   1.730 +      setup:    'tsn exten',
   1.731 +      check: {
   1.732 +        input:  'tsn exten',
   1.733 +        hints:           ' <text>',
   1.734 +        markup: 'VVVVVVVVV',
   1.735 +        cursor: 9,
   1.736 +        current: '__command',
   1.737 +        status: 'ERROR',
   1.738 +        predictions: [ 'tsn exten', 'tsn extend' ],
   1.739 +        unassigned: [ ],
   1.740 +        args: {
   1.741 +          command: { name: 'tsn exten' },
   1.742 +          text: {
   1.743 +            value: undefined,
   1.744 +            arg: '',
   1.745 +            status: 'INCOMPLETE',
   1.746 +            message: 'Value required for \'text\'.'
   1.747 +          }
   1.748 +        }
   1.749 +      }
   1.750 +    },
   1.751 +    {
   1.752 +      setup:    'tsn extend',
   1.753 +      check: {
   1.754 +        input:  'tsn extend',
   1.755 +        hints:            ' <text>',
   1.756 +        markup: 'VVVVVVVVVV',
   1.757 +        cursor: 10,
   1.758 +        current: '__command',
   1.759 +        status: 'ERROR',
   1.760 +        predictions: [ ],
   1.761 +        unassigned: [ ],
   1.762 +        args: {
   1.763 +          command: { name: 'tsn extend' },
   1.764 +          text: {
   1.765 +            value: undefined,
   1.766 +            arg: '',
   1.767 +            status: 'INCOMPLETE',
   1.768 +            message: 'Value required for \'text\'.'
   1.769 +          }
   1.770 +        }
   1.771 +      }
   1.772 +    },
   1.773 +    {
   1.774 +      setup:    'ts ',
   1.775 +      check: {
   1.776 +        input:  'ts ',
   1.777 +        hints:     '',
   1.778 +        markup: 'EEV',
   1.779 +        cursor: 3,
   1.780 +        current: '__command',
   1.781 +        status: 'ERROR',
   1.782 +        predictions: [ ],
   1.783 +        unassigned: [ ],
   1.784 +        tooltipState: 'true:isError'
   1.785 +      }
   1.786 +    },
   1.787 +  ]);
   1.788 +};
   1.789 +
   1.790 +// From Bug 664203
   1.791 +exports.testDeeplyNested = function(options) {
   1.792 +  return helpers.audit(options, [
   1.793 +    {
   1.794 +      setup:    'tsn deep down nested',
   1.795 +      check: {
   1.796 +        input:  'tsn deep down nested',
   1.797 +        hints:                      ' cmd',
   1.798 +        markup: 'IIIVIIIIVIIIIVIIIIII',
   1.799 +        cursor: 20,
   1.800 +        current: '__command',
   1.801 +        status: 'ERROR',
   1.802 +        predictions: [ 'tsn deep down nested cmd' ],
   1.803 +        unassigned: [ ],
   1.804 +        outputState: 'false:default',
   1.805 +        tooltipState: 'false:default',
   1.806 +        args: {
   1.807 +          command: { name: 'tsn deep down nested' },
   1.808 +        }
   1.809 +      }
   1.810 +    },
   1.811 +    {
   1.812 +      setup:    'tsn deep down nested cmd',
   1.813 +      check: {
   1.814 +        input:  'tsn deep down nested cmd',
   1.815 +        hints:                          '',
   1.816 +        markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
   1.817 +        cursor: 24,
   1.818 +        current: '__command',
   1.819 +        status: 'VALID',
   1.820 +        predictions: [ ],
   1.821 +        unassigned: [ ],
   1.822 +        args: {
   1.823 +          command: { name: 'tsn deep down nested cmd' },
   1.824 +        }
   1.825 +      }
   1.826 +    }
   1.827 +  ]);
   1.828 +};

mercurial