browser/devtools/commandline/test/browser_gcli_cli2.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /*
michael@0 2 * Copyright 2012, Mozilla Foundation and contributors
michael@0 3 *
michael@0 4 * Licensed under the Apache License, Version 2.0 (the "License");
michael@0 5 * you may not use this file except in compliance with the License.
michael@0 6 * You may obtain a copy of the License at
michael@0 7 *
michael@0 8 * http://www.apache.org/licenses/LICENSE-2.0
michael@0 9 *
michael@0 10 * Unless required by applicable law or agreed to in writing, software
michael@0 11 * distributed under the License is distributed on an "AS IS" BASIS,
michael@0 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
michael@0 13 * See the License for the specific language governing permissions and
michael@0 14 * limitations under the License.
michael@0 15 */
michael@0 16
michael@0 17 'use strict';
michael@0 18 // <INJECTED SOURCE:START>
michael@0 19
michael@0 20 // THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
michael@0 21 // DO NOT EDIT IT DIRECTLY
michael@0 22
michael@0 23 var exports = {};
michael@0 24
michael@0 25 var TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testCli2.js</p>";
michael@0 26
michael@0 27 function test() {
michael@0 28 return Task.spawn(function() {
michael@0 29 let options = yield helpers.openTab(TEST_URI);
michael@0 30 yield helpers.openToolbar(options);
michael@0 31 gcli.addItems(mockCommands.items);
michael@0 32
michael@0 33 yield helpers.runTests(options, exports);
michael@0 34
michael@0 35 gcli.removeItems(mockCommands.items);
michael@0 36 yield helpers.closeToolbar(options);
michael@0 37 yield helpers.closeTab(options);
michael@0 38 }).then(finish, helpers.handleError);
michael@0 39 }
michael@0 40
michael@0 41 // <INJECTED SOURCE:END>
michael@0 42
michael@0 43 // var helpers = require('./helpers');
michael@0 44
michael@0 45 var nodetype = require('gcli/types/node');
michael@0 46
michael@0 47 exports.setup = function(options) {
michael@0 48 if (options.window) {
michael@0 49 nodetype.setDocument(options.window.document);
michael@0 50 }
michael@0 51 };
michael@0 52
michael@0 53 exports.shutdown = function(options) {
michael@0 54 nodetype.unsetDocument();
michael@0 55 };
michael@0 56
michael@0 57 exports.testSingleString = function(options) {
michael@0 58 return helpers.audit(options, [
michael@0 59 {
michael@0 60 setup: 'tsr',
michael@0 61 check: {
michael@0 62 input: 'tsr',
michael@0 63 hints: ' <text>',
michael@0 64 markup: 'VVV',
michael@0 65 cursor: 3,
michael@0 66 current: '__command',
michael@0 67 status: 'ERROR',
michael@0 68 unassigned: [ ],
michael@0 69 args: {
michael@0 70 command: { name: 'tsr' },
michael@0 71 text: {
michael@0 72 value: undefined,
michael@0 73 arg: '',
michael@0 74 status: 'INCOMPLETE',
michael@0 75 message: 'Value required for \'text\'.'
michael@0 76 }
michael@0 77 }
michael@0 78 }
michael@0 79 },
michael@0 80 {
michael@0 81 setup: 'tsr ',
michael@0 82 check: {
michael@0 83 input: 'tsr ',
michael@0 84 hints: '<text>',
michael@0 85 markup: 'VVVV',
michael@0 86 cursor: 4,
michael@0 87 current: 'text',
michael@0 88 status: 'ERROR',
michael@0 89 predictions: [ ],
michael@0 90 unassigned: [ ],
michael@0 91 args: {
michael@0 92 command: { name: 'tsr' },
michael@0 93 text: {
michael@0 94 value: undefined,
michael@0 95 arg: '',
michael@0 96 status: 'INCOMPLETE',
michael@0 97 message: 'Value required for \'text\'.'
michael@0 98 }
michael@0 99 }
michael@0 100 }
michael@0 101 },
michael@0 102 {
michael@0 103 setup: 'tsr h',
michael@0 104 check: {
michael@0 105 input: 'tsr h',
michael@0 106 hints: '',
michael@0 107 markup: 'VVVVV',
michael@0 108 cursor: 5,
michael@0 109 current: 'text',
michael@0 110 status: 'VALID',
michael@0 111 predictions: [ ],
michael@0 112 unassigned: [ ],
michael@0 113 args: {
michael@0 114 command: { name: 'tsr' },
michael@0 115 text: {
michael@0 116 value: 'h',
michael@0 117 arg: ' h',
michael@0 118 status: 'VALID',
michael@0 119 message: ''
michael@0 120 }
michael@0 121 }
michael@0 122 }
michael@0 123 },
michael@0 124 {
michael@0 125 setup: 'tsr "h h"',
michael@0 126 check: {
michael@0 127 input: 'tsr "h h"',
michael@0 128 hints: '',
michael@0 129 markup: 'VVVVVVVVV',
michael@0 130 cursor: 9,
michael@0 131 current: 'text',
michael@0 132 status: 'VALID',
michael@0 133 predictions: [ ],
michael@0 134 unassigned: [ ],
michael@0 135 args: {
michael@0 136 command: { name: 'tsr' },
michael@0 137 text: {
michael@0 138 value: 'h h',
michael@0 139 arg: ' "h h"',
michael@0 140 status: 'VALID',
michael@0 141 message: ''
michael@0 142 }
michael@0 143 }
michael@0 144 }
michael@0 145 },
michael@0 146 {
michael@0 147 setup: 'tsr h h h',
michael@0 148 check: {
michael@0 149 input: 'tsr h h h',
michael@0 150 hints: '',
michael@0 151 markup: 'VVVVVVVVV',
michael@0 152 cursor: 9,
michael@0 153 current: 'text',
michael@0 154 status: 'VALID',
michael@0 155 predictions: [ ],
michael@0 156 unassigned: [ ],
michael@0 157 args: {
michael@0 158 command: { name: 'tsr' },
michael@0 159 text: {
michael@0 160 value: 'h h h',
michael@0 161 arg: ' h h h',
michael@0 162 status: 'VALID',
michael@0 163 message: ''
michael@0 164 }
michael@0 165 }
michael@0 166 }
michael@0 167 }
michael@0 168 ]);
michael@0 169 };
michael@0 170
michael@0 171 exports.testSingleNumber = function(options) {
michael@0 172 return helpers.audit(options, [
michael@0 173 {
michael@0 174 setup: 'tsu',
michael@0 175 check: {
michael@0 176 input: 'tsu',
michael@0 177 hints: ' <num>',
michael@0 178 markup: 'VVV',
michael@0 179 cursor: 3,
michael@0 180 current: '__command',
michael@0 181 status: 'ERROR',
michael@0 182 predictions: [ ],
michael@0 183 unassigned: [ ],
michael@0 184 args: {
michael@0 185 command: { name: 'tsu' },
michael@0 186 num: {
michael@0 187 value: undefined,
michael@0 188 arg: '',
michael@0 189 status: 'INCOMPLETE',
michael@0 190 message: 'Value required for \'num\'.'
michael@0 191 }
michael@0 192 }
michael@0 193 }
michael@0 194 },
michael@0 195 {
michael@0 196 setup: 'tsu ',
michael@0 197 check: {
michael@0 198 input: 'tsu ',
michael@0 199 hints: '<num>',
michael@0 200 markup: 'VVVV',
michael@0 201 cursor: 4,
michael@0 202 current: 'num',
michael@0 203 status: 'ERROR',
michael@0 204 predictions: [ ],
michael@0 205 unassigned: [ ],
michael@0 206 args: {
michael@0 207 command: { name: 'tsu' },
michael@0 208 num: {
michael@0 209 value: undefined,
michael@0 210 arg: '',
michael@0 211 status: 'INCOMPLETE',
michael@0 212 message: 'Value required for \'num\'.'
michael@0 213 }
michael@0 214 }
michael@0 215 }
michael@0 216 },
michael@0 217 {
michael@0 218 setup: 'tsu 1',
michael@0 219 check: {
michael@0 220 input: 'tsu 1',
michael@0 221 hints: '',
michael@0 222 markup: 'VVVVV',
michael@0 223 cursor: 5,
michael@0 224 current: 'num',
michael@0 225 status: 'VALID',
michael@0 226 predictions: [ ],
michael@0 227 unassigned: [ ],
michael@0 228 args: {
michael@0 229 command: { name: 'tsu' },
michael@0 230 num: { value: 1, arg: ' 1', status: 'VALID', message: '' }
michael@0 231 }
michael@0 232 }
michael@0 233 },
michael@0 234 {
michael@0 235 setup: 'tsu x',
michael@0 236 check: {
michael@0 237 input: 'tsu x',
michael@0 238 hints: '',
michael@0 239 markup: 'VVVVE',
michael@0 240 cursor: 5,
michael@0 241 current: 'num',
michael@0 242 status: 'ERROR',
michael@0 243 predictions: [ ],
michael@0 244 unassigned: [ ],
michael@0 245 tooltipState: 'true:isError',
michael@0 246 args: {
michael@0 247 command: { name: 'tsu' },
michael@0 248 num: {
michael@0 249 value: undefined,
michael@0 250 arg: ' x',
michael@0 251 status: 'ERROR',
michael@0 252 message: 'Can\'t convert "x" to a number.'
michael@0 253 }
michael@0 254 }
michael@0 255 }
michael@0 256 },
michael@0 257 {
michael@0 258 setup: 'tsu 1.5',
michael@0 259 check: {
michael@0 260 input: 'tsu 1.5',
michael@0 261 hints: '',
michael@0 262 markup: 'VVVVEEE',
michael@0 263 cursor: 7,
michael@0 264 current: 'num',
michael@0 265 status: 'ERROR',
michael@0 266 predictions: [ ],
michael@0 267 unassigned: [ ],
michael@0 268 args: {
michael@0 269 command: { name: 'tsu' },
michael@0 270 num: {
michael@0 271 value: undefined,
michael@0 272 arg: ' 1.5',
michael@0 273 status: 'ERROR',
michael@0 274 message: 'Can\'t convert "1.5" to an integer.'
michael@0 275 }
michael@0 276 }
michael@0 277 }
michael@0 278 }
michael@0 279 ]);
michael@0 280 };
michael@0 281
michael@0 282 exports.testSingleFloat = function(options) {
michael@0 283 return helpers.audit(options, [
michael@0 284 {
michael@0 285 setup: 'tsf',
michael@0 286 check: {
michael@0 287 input: 'tsf',
michael@0 288 hints: ' <num>',
michael@0 289 markup: 'VVV',
michael@0 290 cursor: 3,
michael@0 291 current: '__command',
michael@0 292 status: 'ERROR',
michael@0 293 error: '',
michael@0 294 unassigned: [ ],
michael@0 295 args: {
michael@0 296 command: { name: 'tsf' },
michael@0 297 num: {
michael@0 298 value: undefined,
michael@0 299 arg: '',
michael@0 300 status: 'INCOMPLETE',
michael@0 301 message: 'Value required for \'num\'.'
michael@0 302 }
michael@0 303 }
michael@0 304 }
michael@0 305 },
michael@0 306 {
michael@0 307 setup: 'tsf 1',
michael@0 308 check: {
michael@0 309 input: 'tsf 1',
michael@0 310 hints: '',
michael@0 311 markup: 'VVVVV',
michael@0 312 cursor: 5,
michael@0 313 current: 'num',
michael@0 314 status: 'VALID',
michael@0 315 error: '',
michael@0 316 predictions: [ ],
michael@0 317 unassigned: [ ],
michael@0 318 args: {
michael@0 319 command: { name: 'tsf' },
michael@0 320 num: { value: 1, arg: ' 1', status: 'VALID', message: '' }
michael@0 321 }
michael@0 322 }
michael@0 323 },
michael@0 324 {
michael@0 325 setup: 'tsf 1.',
michael@0 326 check: {
michael@0 327 input: 'tsf 1.',
michael@0 328 hints: '',
michael@0 329 markup: 'VVVVVV',
michael@0 330 cursor: 6,
michael@0 331 current: 'num',
michael@0 332 status: 'VALID',
michael@0 333 error: '',
michael@0 334 predictions: [ ],
michael@0 335 unassigned: [ ],
michael@0 336 args: {
michael@0 337 command: { name: 'tsf' },
michael@0 338 num: { value: 1, arg: ' 1.', status: 'VALID', message: '' }
michael@0 339 }
michael@0 340 }
michael@0 341 },
michael@0 342 {
michael@0 343 setup: 'tsf 1.5',
michael@0 344 check: {
michael@0 345 input: 'tsf 1.5',
michael@0 346 hints: '',
michael@0 347 markup: 'VVVVVVV',
michael@0 348 cursor: 7,
michael@0 349 current: 'num',
michael@0 350 status: 'VALID',
michael@0 351 error: '',
michael@0 352 predictions: [ ],
michael@0 353 unassigned: [ ],
michael@0 354 args: {
michael@0 355 command: { name: 'tsf' },
michael@0 356 num: { value: 1.5, arg: ' 1.5', status: 'VALID', message: '' }
michael@0 357 }
michael@0 358 }
michael@0 359 },
michael@0 360 {
michael@0 361 setup: 'tsf 1.5x',
michael@0 362 check: {
michael@0 363 input: 'tsf 1.5x',
michael@0 364 hints: '',
michael@0 365 markup: 'VVVVVVVV',
michael@0 366 cursor: 8,
michael@0 367 current: 'num',
michael@0 368 status: 'VALID',
michael@0 369 error: '',
michael@0 370 predictions: [ ],
michael@0 371 unassigned: [ ],
michael@0 372 args: {
michael@0 373 command: { name: 'tsf' },
michael@0 374 num: { value: 1.5, arg: ' 1.5x', status: 'VALID', message: '' }
michael@0 375 }
michael@0 376 }
michael@0 377 },
michael@0 378 {
michael@0 379 skipRemainingIf: options.isNoDom,
michael@0 380 name: 'tsf x (cursor=4)',
michael@0 381 setup: function() {
michael@0 382 return helpers.setInput(options, 'tsf x', 4);
michael@0 383 },
michael@0 384 check: {
michael@0 385 input: 'tsf x',
michael@0 386 hints: '',
michael@0 387 markup: 'VVVVE',
michael@0 388 cursor: 4,
michael@0 389 current: 'num',
michael@0 390 status: 'ERROR',
michael@0 391 error: 'Can\'t convert "x" to a number.',
michael@0 392 predictions: [ ],
michael@0 393 unassigned: [ ],
michael@0 394 args: {
michael@0 395 command: { name: 'tsf' },
michael@0 396 num: {
michael@0 397 value: undefined,
michael@0 398 arg: ' x',
michael@0 399 status: 'ERROR',
michael@0 400 message: 'Can\'t convert "x" to a number.'
michael@0 401 }
michael@0 402 }
michael@0 403 }
michael@0 404 }
michael@0 405 ]);
michael@0 406 };
michael@0 407
michael@0 408 exports.testElementWeb = function(options) {
michael@0 409 var inputElement = options.isNoDom ?
michael@0 410 null :
michael@0 411 options.window.document.getElementById('gcli-input');
michael@0 412
michael@0 413 return helpers.audit(options, [
michael@0 414 {
michael@0 415 skipIf: function gcliInputElementExists() {
michael@0 416 return inputElement == null;
michael@0 417 },
michael@0 418 setup: 'tse #gcli-input',
michael@0 419 check: {
michael@0 420 input: 'tse #gcli-input',
michael@0 421 hints: ' [options]',
michael@0 422 markup: 'VVVVVVVVVVVVVVV',
michael@0 423 cursor: 15,
michael@0 424 current: 'node',
michael@0 425 status: 'VALID',
michael@0 426 predictions: [ ],
michael@0 427 unassigned: [ ],
michael@0 428 args: {
michael@0 429 command: { name: 'tse' },
michael@0 430 node: {
michael@0 431 value: inputElement,
michael@0 432 arg: ' #gcli-input',
michael@0 433 status: 'VALID',
michael@0 434 message: ''
michael@0 435 },
michael@0 436 nodes: { arg: '', status: 'VALID', message: '' },
michael@0 437 nodes2: { arg: '', status: 'VALID', message: '' },
michael@0 438 }
michael@0 439 }
michael@0 440 }
michael@0 441 ]);
michael@0 442 };
michael@0 443
michael@0 444 exports.testElement = function(options) {
michael@0 445 return helpers.audit(options, [
michael@0 446 {
michael@0 447 skipRemainingIf: options.isNoDom,
michael@0 448 setup: 'tse',
michael@0 449 check: {
michael@0 450 input: 'tse',
michael@0 451 hints: ' <node> [options]',
michael@0 452 markup: 'VVV',
michael@0 453 cursor: 3,
michael@0 454 current: '__command',
michael@0 455 status: 'ERROR',
michael@0 456 predictions: [ 'tse', 'tselarr' ],
michael@0 457 unassigned: [ ],
michael@0 458 args: {
michael@0 459 command: { name: 'tse' },
michael@0 460 node: { value: undefined, arg: '', status: 'INCOMPLETE' },
michael@0 461 nodes: { arg: '', status: 'VALID', message: '' },
michael@0 462 nodes2: { arg: '', status: 'VALID', message: '' },
michael@0 463 }
michael@0 464 }
michael@0 465 },
michael@0 466 {
michael@0 467 setup: 'tse #gcli-nomatch',
michael@0 468 check: {
michael@0 469 input: 'tse #gcli-nomatch',
michael@0 470 hints: ' [options]',
michael@0 471 markup: 'VVVVIIIIIIIIIIIII',
michael@0 472 cursor: 17,
michael@0 473 current: 'node',
michael@0 474 status: 'ERROR',
michael@0 475 predictions: [ ],
michael@0 476 unassigned: [ ],
michael@0 477 outputState: 'false:default',
michael@0 478 tooltipState: 'true:isError',
michael@0 479 args: {
michael@0 480 command: { name: 'tse' },
michael@0 481 node: {
michael@0 482 value: undefined,
michael@0 483 arg: ' #gcli-nomatch',
michael@0 484 // This is somewhat debatable because this input can't be corrected
michael@0 485 // simply by typing so it's and error rather than incomplete,
michael@0 486 // however without digging into the CSS engine we can't tell that
michael@0 487 // so we default to incomplete
michael@0 488 status: 'INCOMPLETE',
michael@0 489 message: 'No matches'
michael@0 490 },
michael@0 491 nodes: { arg: '', status: 'VALID', message: '' },
michael@0 492 nodes2: { arg: '', status: 'VALID', message: '' },
michael@0 493 }
michael@0 494 }
michael@0 495 },
michael@0 496 {
michael@0 497 setup: 'tse #',
michael@0 498 check: {
michael@0 499 input: 'tse #',
michael@0 500 hints: ' [options]',
michael@0 501 markup: 'VVVVE',
michael@0 502 cursor: 5,
michael@0 503 current: 'node',
michael@0 504 status: 'ERROR',
michael@0 505 predictions: [ ],
michael@0 506 unassigned: [ ],
michael@0 507 tooltipState: 'true:isError',
michael@0 508 args: {
michael@0 509 command: { name: 'tse' },
michael@0 510 node: {
michael@0 511 value: undefined,
michael@0 512 arg: ' #',
michael@0 513 status: 'ERROR',
michael@0 514 message: 'Syntax error in CSS query'
michael@0 515 },
michael@0 516 nodes: { arg: '', status: 'VALID', message: '' },
michael@0 517 nodes2: { arg: '', status: 'VALID', message: '' },
michael@0 518 }
michael@0 519 }
michael@0 520 },
michael@0 521 {
michael@0 522 setup: 'tse .',
michael@0 523 check: {
michael@0 524 input: 'tse .',
michael@0 525 hints: ' [options]',
michael@0 526 markup: 'VVVVE',
michael@0 527 cursor: 5,
michael@0 528 current: 'node',
michael@0 529 status: 'ERROR',
michael@0 530 predictions: [ ],
michael@0 531 unassigned: [ ],
michael@0 532 tooltipState: 'true:isError',
michael@0 533 args: {
michael@0 534 command: { name: 'tse' },
michael@0 535 node: {
michael@0 536 value: undefined,
michael@0 537 arg: ' .',
michael@0 538 status: 'ERROR',
michael@0 539 message: 'Syntax error in CSS query'
michael@0 540 },
michael@0 541 nodes: { arg: '', status: 'VALID', message: '' },
michael@0 542 nodes2: { arg: '', status: 'VALID', message: '' },
michael@0 543 }
michael@0 544 }
michael@0 545 },
michael@0 546 {
michael@0 547 setup: 'tse *',
michael@0 548 check: {
michael@0 549 input: 'tse *',
michael@0 550 hints: ' [options]',
michael@0 551 markup: 'VVVVE',
michael@0 552 cursor: 5,
michael@0 553 current: 'node',
michael@0 554 status: 'ERROR',
michael@0 555 predictions: [ ],
michael@0 556 unassigned: [ ],
michael@0 557 tooltipState: 'true:isError',
michael@0 558 args: {
michael@0 559 command: { name: 'tse' },
michael@0 560 node: {
michael@0 561 value: undefined,
michael@0 562 arg: ' *',
michael@0 563 status: 'ERROR',
michael@0 564 message: /^Too many matches \([0-9]*\)/
michael@0 565 },
michael@0 566 nodes: { arg: '', status: 'VALID', message: '' },
michael@0 567 nodes2: { arg: '', status: 'VALID', message: '' },
michael@0 568 }
michael@0 569 }
michael@0 570 }
michael@0 571 ]);
michael@0 572 };
michael@0 573
michael@0 574 exports.testNestedCommand = function(options) {
michael@0 575 return helpers.audit(options, [
michael@0 576 {
michael@0 577 setup: 'tsn',
michael@0 578 check: {
michael@0 579 input: 'tsn',
michael@0 580 hints: ' deep down nested cmd',
michael@0 581 markup: 'III',
michael@0 582 cursor: 3,
michael@0 583 current: '__command',
michael@0 584 status: 'ERROR',
michael@0 585 predictionsInclude: [
michael@0 586 'tsn deep', 'tsn deep down', 'tsn deep down nested',
michael@0 587 'tsn deep down nested cmd', 'tsn dif'
michael@0 588 ],
michael@0 589 unassigned: [ ],
michael@0 590 args: {
michael@0 591 command: { name: 'tsn' }
michael@0 592 }
michael@0 593 }
michael@0 594 },
michael@0 595 {
michael@0 596 setup: 'tsn ',
michael@0 597 check: {
michael@0 598 input: 'tsn ',
michael@0 599 hints: ' deep down nested cmd',
michael@0 600 markup: 'IIIV',
michael@0 601 cursor: 4,
michael@0 602 current: '__command',
michael@0 603 status: 'ERROR',
michael@0 604 unassigned: [ ]
michael@0 605 }
michael@0 606 },
michael@0 607 {
michael@0 608 skipIf: options.isPhantomjs,
michael@0 609 setup: 'tsn x',
michael@0 610 check: {
michael@0 611 input: 'tsn x',
michael@0 612 hints: ' -> tsn ext',
michael@0 613 markup: 'IIIVI',
michael@0 614 cursor: 5,
michael@0 615 current: '__command',
michael@0 616 status: 'ERROR',
michael@0 617 predictions: [ 'tsn ext' ],
michael@0 618 unassigned: [ ]
michael@0 619 }
michael@0 620 },
michael@0 621 {
michael@0 622 setup: 'tsn dif',
michael@0 623 check: {
michael@0 624 input: 'tsn dif',
michael@0 625 hints: ' <text>',
michael@0 626 markup: 'VVVVVVV',
michael@0 627 cursor: 7,
michael@0 628 current: '__command',
michael@0 629 status: 'ERROR',
michael@0 630 predictions: [ ],
michael@0 631 unassigned: [ ],
michael@0 632 args: {
michael@0 633 command: { name: 'tsn dif' },
michael@0 634 text: {
michael@0 635 value: undefined,
michael@0 636 arg: '',
michael@0 637 status: 'INCOMPLETE',
michael@0 638 message: 'Value required for \'text\'.'
michael@0 639 }
michael@0 640 }
michael@0 641 }
michael@0 642 },
michael@0 643 {
michael@0 644 setup: 'tsn dif ',
michael@0 645 check: {
michael@0 646 input: 'tsn dif ',
michael@0 647 hints: '<text>',
michael@0 648 markup: 'VVVVVVVV',
michael@0 649 cursor: 8,
michael@0 650 current: 'text',
michael@0 651 status: 'ERROR',
michael@0 652 predictions: [ ],
michael@0 653 unassigned: [ ],
michael@0 654 args: {
michael@0 655 command: { name: 'tsn dif' },
michael@0 656 text: {
michael@0 657 value: undefined,
michael@0 658 arg: '',
michael@0 659 status: 'INCOMPLETE',
michael@0 660 message: 'Value required for \'text\'.'
michael@0 661 }
michael@0 662 }
michael@0 663 }
michael@0 664 },
michael@0 665 {
michael@0 666 setup: 'tsn dif x',
michael@0 667 check: {
michael@0 668 input: 'tsn dif x',
michael@0 669 hints: '',
michael@0 670 markup: 'VVVVVVVVV',
michael@0 671 cursor: 9,
michael@0 672 current: 'text',
michael@0 673 status: 'VALID',
michael@0 674 predictions: [ ],
michael@0 675 unassigned: [ ],
michael@0 676 args: {
michael@0 677 command: { name: 'tsn dif' },
michael@0 678 text: { value: 'x', arg: ' x', status: 'VALID', message: '' }
michael@0 679 }
michael@0 680 }
michael@0 681 },
michael@0 682 {
michael@0 683 setup: 'tsn ext',
michael@0 684 check: {
michael@0 685 input: 'tsn ext',
michael@0 686 hints: ' <text>',
michael@0 687 markup: 'VVVVVVV',
michael@0 688 cursor: 7,
michael@0 689 current: '__command',
michael@0 690 status: 'ERROR',
michael@0 691 predictions: [ 'tsn ext', 'tsn exte', 'tsn exten', 'tsn extend' ],
michael@0 692 unassigned: [ ],
michael@0 693 args: {
michael@0 694 command: { name: 'tsn ext' },
michael@0 695 text: {
michael@0 696 value: undefined,
michael@0 697 arg: '',
michael@0 698 status: 'INCOMPLETE',
michael@0 699 message: 'Value required for \'text\'.'
michael@0 700 }
michael@0 701 }
michael@0 702 }
michael@0 703 },
michael@0 704 {
michael@0 705 setup: 'tsn exte',
michael@0 706 check: {
michael@0 707 input: 'tsn exte',
michael@0 708 hints: ' <text>',
michael@0 709 markup: 'VVVVVVVV',
michael@0 710 cursor: 8,
michael@0 711 current: '__command',
michael@0 712 status: 'ERROR',
michael@0 713 predictions: [ 'tsn exte', 'tsn exten', 'tsn extend' ],
michael@0 714 unassigned: [ ],
michael@0 715 args: {
michael@0 716 command: { name: 'tsn exte' },
michael@0 717 text: {
michael@0 718 value: undefined,
michael@0 719 arg: '',
michael@0 720 status: 'INCOMPLETE',
michael@0 721 message: 'Value required for \'text\'.'
michael@0 722 }
michael@0 723 }
michael@0 724 }
michael@0 725 },
michael@0 726 {
michael@0 727 setup: 'tsn exten',
michael@0 728 check: {
michael@0 729 input: 'tsn exten',
michael@0 730 hints: ' <text>',
michael@0 731 markup: 'VVVVVVVVV',
michael@0 732 cursor: 9,
michael@0 733 current: '__command',
michael@0 734 status: 'ERROR',
michael@0 735 predictions: [ 'tsn exten', 'tsn extend' ],
michael@0 736 unassigned: [ ],
michael@0 737 args: {
michael@0 738 command: { name: 'tsn exten' },
michael@0 739 text: {
michael@0 740 value: undefined,
michael@0 741 arg: '',
michael@0 742 status: 'INCOMPLETE',
michael@0 743 message: 'Value required for \'text\'.'
michael@0 744 }
michael@0 745 }
michael@0 746 }
michael@0 747 },
michael@0 748 {
michael@0 749 setup: 'tsn extend',
michael@0 750 check: {
michael@0 751 input: 'tsn extend',
michael@0 752 hints: ' <text>',
michael@0 753 markup: 'VVVVVVVVVV',
michael@0 754 cursor: 10,
michael@0 755 current: '__command',
michael@0 756 status: 'ERROR',
michael@0 757 predictions: [ ],
michael@0 758 unassigned: [ ],
michael@0 759 args: {
michael@0 760 command: { name: 'tsn extend' },
michael@0 761 text: {
michael@0 762 value: undefined,
michael@0 763 arg: '',
michael@0 764 status: 'INCOMPLETE',
michael@0 765 message: 'Value required for \'text\'.'
michael@0 766 }
michael@0 767 }
michael@0 768 }
michael@0 769 },
michael@0 770 {
michael@0 771 setup: 'ts ',
michael@0 772 check: {
michael@0 773 input: 'ts ',
michael@0 774 hints: '',
michael@0 775 markup: 'EEV',
michael@0 776 cursor: 3,
michael@0 777 current: '__command',
michael@0 778 status: 'ERROR',
michael@0 779 predictions: [ ],
michael@0 780 unassigned: [ ],
michael@0 781 tooltipState: 'true:isError'
michael@0 782 }
michael@0 783 },
michael@0 784 ]);
michael@0 785 };
michael@0 786
michael@0 787 // From Bug 664203
michael@0 788 exports.testDeeplyNested = function(options) {
michael@0 789 return helpers.audit(options, [
michael@0 790 {
michael@0 791 setup: 'tsn deep down nested',
michael@0 792 check: {
michael@0 793 input: 'tsn deep down nested',
michael@0 794 hints: ' cmd',
michael@0 795 markup: 'IIIVIIIIVIIIIVIIIIII',
michael@0 796 cursor: 20,
michael@0 797 current: '__command',
michael@0 798 status: 'ERROR',
michael@0 799 predictions: [ 'tsn deep down nested cmd' ],
michael@0 800 unassigned: [ ],
michael@0 801 outputState: 'false:default',
michael@0 802 tooltipState: 'false:default',
michael@0 803 args: {
michael@0 804 command: { name: 'tsn deep down nested' },
michael@0 805 }
michael@0 806 }
michael@0 807 },
michael@0 808 {
michael@0 809 setup: 'tsn deep down nested cmd',
michael@0 810 check: {
michael@0 811 input: 'tsn deep down nested cmd',
michael@0 812 hints: '',
michael@0 813 markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
michael@0 814 cursor: 24,
michael@0 815 current: '__command',
michael@0 816 status: 'VALID',
michael@0 817 predictions: [ ],
michael@0 818 unassigned: [ ],
michael@0 819 args: {
michael@0 820 command: { name: 'tsn deep down nested cmd' },
michael@0 821 }
michael@0 822 }
michael@0 823 }
michael@0 824 ]);
michael@0 825 };

mercurial