browser/devtools/commandline/test/browser_gcli_short.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /*
     2  * Copyright 2012, Mozilla Foundation and contributors
     3  *
     4  * Licensed under the Apache License, Version 2.0 (the "License");
     5  * you may not use this file except in compliance with the License.
     6  * You may obtain a copy of the License at
     7  *
     8  * http://www.apache.org/licenses/LICENSE-2.0
     9  *
    10  * Unless required by applicable law or agreed to in writing, software
    11  * distributed under the License is distributed on an "AS IS" BASIS,
    12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  * See the License for the specific language governing permissions and
    14  * limitations under the License.
    15  */
    17 'use strict';
    18 // <INJECTED SOURCE:START>
    20 // THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT
    21 // DO NOT EDIT IT DIRECTLY
    23 var exports = {};
    25 var TEST_URI = "data:text/html;charset=utf-8,<p id='gcli-input'>gcli-testShort.js</p>";
    27 function test() {
    28   return Task.spawn(function() {
    29     let options = yield helpers.openTab(TEST_URI);
    30     yield helpers.openToolbar(options);
    31     gcli.addItems(mockCommands.items);
    33     yield helpers.runTests(options, exports);
    35     gcli.removeItems(mockCommands.items);
    36     yield helpers.closeToolbar(options);
    37     yield helpers.closeTab(options);
    38   }).then(finish, helpers.handleError);
    39 }
    41 // <INJECTED SOURCE:END>
    43 // var helpers = require('./helpers');
    45 exports.testBasic = function(options) {
    46   return helpers.audit(options, [
    47     {
    48       setup:    'tshidden -v',
    49       check: {
    50         input:  'tshidden -v',
    51         hints:             ' <string>',
    52         markup: 'VVVVVVVVVII',
    53         cursor: 11,
    54         current: 'visible',
    55         status: 'ERROR',
    56         options: [ ],
    57         message: '',
    58         predictions: [ ],
    59         unassigned: [ ],
    60         args: {
    61           command: { name: 'tshidden' },
    62           visible: {
    63             value: undefined,
    64             arg: ' -v',
    65             status: 'INCOMPLETE'
    66           },
    67           invisiblestring: {
    68             value: undefined,
    69             arg: '',
    70             status: 'VALID',
    71             message: ''
    72           },
    73           invisibleboolean: {
    74             value: false,
    75             arg: '',
    76             status: 'VALID',
    77             message: ''
    78           }
    79         }
    80       }
    81     },
    82     {
    83       setup:    'tshidden -v v',
    84       check: {
    85         input:  'tshidden -v v',
    86         hints:               '',
    87         markup: 'VVVVVVVVVVVVV',
    88         cursor: 13,
    89         current: 'visible',
    90         status: 'VALID',
    91         options: [ ],
    92         message: '',
    93         predictions: [ ],
    94         unassigned: [ ],
    95         args: {
    96           command: { name: 'tshidden' },
    97           visible: {
    98             value: 'v',
    99             arg: ' -v v',
   100             status: 'VALID',
   101             message: ''
   102           },
   103           invisiblestring: {
   104             value: undefined,
   105             arg: '',
   106             status: 'VALID',
   107             message: ''
   108           },
   109           invisibleboolean: {
   110             value: false,
   111             arg: '',
   112             status: 'VALID',
   113             message: ''
   114           }
   115         }
   116       }
   117     },
   118     {
   119       setup:    'tshidden -i i',
   120       check: {
   121         input:  'tshidden -i i',
   122         hints:               ' [options]',
   123         markup: 'VVVVVVVVVVVVV',
   124         cursor: 13,
   125         current: 'invisiblestring',
   126         status: 'VALID',
   127         options: [ ],
   128         message: '',
   129         predictions: [ ],
   130         unassigned: [ ],
   131         args: {
   132           command: { name: 'tshidden' },
   133           visible: {
   134             value: undefined,
   135             arg: '',
   136             status: 'VALID',
   137             message: ''
   138           },
   139           invisiblestring: {
   140             value: 'i',
   141             arg: ' -i i',
   142             status: 'VALID',
   143             message: ''
   144           },
   145           invisibleboolean: {
   146             value: false,
   147             arg: '',
   148             status: 'VALID',
   149             message: ''
   150           }
   151         }
   152       }
   153     },
   154     {
   155       setup:    'tshidden -b',
   156       check: {
   157         input:  'tshidden -b',
   158         hints:             ' [options]',
   159         markup: 'VVVVVVVVVVV',
   160         cursor: 11,
   161         current: 'invisibleboolean',
   162         status: 'VALID',
   163         options: [ ],
   164         message: '',
   165         predictions: [ ],
   166         unassigned: [ ],
   167         args: {
   168           command: { name: 'tshidden' },
   169           visible: {
   170             value: undefined,
   171             arg: '',
   172             status: 'VALID',
   173             message: ''
   174           },
   175           invisiblestring: {
   176             value: undefined,
   177             arg: '',
   178             status: 'VALID',
   179             message: ''
   180           },
   181           invisibleboolean: {
   182             value: true,
   183             arg: ' -b',
   184             status: 'VALID',
   185             message: ''
   186           }
   187         }
   188       }
   189     },
   190     {
   191       setup:    'tshidden -j',
   192       check: {
   193         input:  'tshidden -j',
   194         hints:             ' [options]',
   195         markup: 'VVVVVVVVVEE',
   196         cursor: 11,
   197         current: '__unassigned',
   198         status: 'ERROR',
   199         options: [ ],
   200         message: 'Can\'t use \'-j\'.',
   201         predictions: [ ],
   202         unassigned: [ ' -j' ],
   203         args: {
   204           command: { name: 'tshidden' },
   205           visible: {
   206             value: undefined,
   207             arg: '',
   208             status: 'VALID',
   209             message: ''
   210           },
   211           invisiblestring: {
   212             value: undefined,
   213             arg: '',
   214             status: 'VALID',
   215             message: ''
   216           },
   217           invisibleboolean: {
   218             value: false,
   219             arg: '',
   220             status: 'VALID',
   221             message: ''
   222           }
   223         }
   224       }
   225     },
   226     {
   227       setup:    'tshidden -v jj -b --',
   228       check: {
   229         input:  'tshidden -v jj -b --',
   230         hints:                      '',
   231         markup: 'VVVVVVVVVVVVVVVVVVEE',
   232         cursor: 20,
   233         current: '__unassigned',
   234         status: 'ERROR',
   235         options: [ ],
   236         message: 'Can\'t use \'--\'.',
   237         predictions: [ ],
   238         unassigned: [ ' --' ],
   239         args: {
   240           command: { name: 'tshidden' },
   241           visible: {
   242             value: 'jj',
   243             arg: ' -v jj',
   244             status: 'VALID',
   245             message: ''
   246           },
   247           invisiblestring: {
   248             value: undefined,
   249             arg: '',
   250             status: 'VALID',
   251             message: ''
   252           },
   253           invisibleboolean: {
   254             value: true,
   255             arg: ' -b',
   256             status: 'VALID',
   257             message: ''
   258           }
   259         }
   260       }
   261     }
   262   ]);
   263 };

mercurial