browser/devtools/commandline/test/browser_gcli_completion1.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.

     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-testCompletion1.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.testActivate = function(options) {
    46   return helpers.audit(options, [
    47     {
    48       setup: '',
    49       check: {
    50         hints: ''
    51       }
    52     },
    53     {
    54       setup: ' ',
    55       check: {
    56         hints: ''
    57       }
    58     },
    59     {
    60       setup: 'tsr',
    61       check: {
    62         hints: ' <text>'
    63       }
    64     },
    65     {
    66       setup: 'tsr ',
    67       check: {
    68         hints: '<text>'
    69       }
    70     },
    71     {
    72       setup: 'tsr b',
    73       check: {
    74         hints: ''
    75       }
    76     },
    77     {
    78       setup: 'tsb',
    79       check: {
    80         hints: ' [toggle]'
    81       }
    82     },
    83     {
    84       setup: 'tsm',
    85       check: {
    86         hints: ' <abc> <txt> <num>'
    87       }
    88     },
    89     {
    90       setup: 'tsm ',
    91       check: {
    92         hints: 'a <txt> <num>'
    93       }
    94     },
    95     {
    96       setup: 'tsm a',
    97       check: {
    98         hints: ' <txt> <num>'
    99       }
   100     },
   101     {
   102       setup: 'tsm a ',
   103       check: {
   104         hints: '<txt> <num>'
   105       }
   106     },
   107     {
   108       setup: 'tsm a  ',
   109       check: {
   110         hints: '<txt> <num>'
   111       }
   112     },
   113     {
   114       setup: 'tsm a  d',
   115       check: {
   116         hints: ' <num>'
   117       }
   118     },
   119     {
   120       setup: 'tsm a "d d"',
   121       check: {
   122         hints: ' <num>'
   123       }
   124     },
   125     {
   126       setup: 'tsm a "d ',
   127       check: {
   128         hints: ' <num>'
   129       }
   130     },
   131     {
   132       setup: 'tsm a "d d" ',
   133       check: {
   134         hints: '<num>'
   135       }
   136     },
   137     {
   138       setup: 'tsm a "d d ',
   139       check: {
   140         hints: ' <num>'
   141       }
   142     },
   143     {
   144       setup: 'tsm d r',
   145       check: {
   146         hints: ' <num>'
   147       }
   148     },
   149     {
   150       setup: 'tsm a d ',
   151       check: {
   152         hints: '<num>'
   153       }
   154     },
   155     {
   156       setup: 'tsm a d 4',
   157       check: {
   158         hints: ''
   159       }
   160     },
   161     {
   162       setup: 'tsg',
   163       check: {
   164         hints: ' <solo> [options]'
   165       }
   166     },
   167     {
   168       setup: 'tsg ',
   169       check: {
   170         hints: 'aaa [options]'
   171       }
   172     },
   173     {
   174       setup: 'tsg a',
   175       check: {
   176         hints: 'aa [options]'
   177       }
   178     },
   179     {
   180       setup: 'tsg b',
   181       check: {
   182         hints: 'bb [options]'
   183       }
   184     },
   185     {
   186       skipIf: options.isPhantomjs,
   187       setup: 'tsg d',
   188       check: {
   189         hints: ' [options] -> ccc'
   190       }
   191     },
   192     {
   193       setup: 'tsg aa',
   194       check: {
   195         hints: 'a [options]'
   196       }
   197     },
   198     {
   199       setup: 'tsg aaa',
   200       check: {
   201         hints: ' [options]'
   202       }
   203     },
   204     {
   205       setup: 'tsg aaa ',
   206       check: {
   207         hints: '[options]'
   208       }
   209     },
   210     {
   211       setup: 'tsg aaa d',
   212       check: {
   213         hints: ' [options]'
   214       }
   215     },
   216     {
   217       setup: 'tsg aaa dddddd',
   218       check: {
   219         hints: ' [options]'
   220       }
   221     },
   222     {
   223       setup: 'tsg aaa dddddd ',
   224       check: {
   225         hints: '[options]'
   226       }
   227     },
   228     {
   229       setup: 'tsg aaa "d',
   230       check: {
   231         hints: ' [options]'
   232       }
   233     },
   234     {
   235       setup: 'tsg aaa "d d',
   236       check: {
   237         hints: ' [options]'
   238       }
   239     },
   240     {
   241       setup: 'tsg aaa "d d"',
   242       check: {
   243         hints: ' [options]'
   244       }
   245     },
   246     {
   247       setup: 'tsn ex ',
   248       check: {
   249         hints: ''
   250       }
   251     },
   252     {
   253       setup: 'selarr',
   254       check: {
   255         hints: ' -> tselarr'
   256       }
   257     },
   258     {
   259       setup: 'tselar 1',
   260       check: {
   261         hints: ''
   262       }
   263     },
   264     {
   265       name: 'tselar |1',
   266       setup: function() {
   267         return helpers.setInput(options, 'tselar 1', 7);
   268       },
   269       check: {
   270         hints: ''
   271       }
   272     },
   273     {
   274       name: 'tselar| 1',
   275       setup: function() {
   276         return helpers.setInput(options, 'tselar 1', 6);
   277       },
   278       check: {
   279         hints: ' -> tselarr'
   280       }
   281     },
   282     {
   283       name: 'tsela|r 1',
   284       setup: function() {
   285         return helpers.setInput(options, 'tselar 1', 5);
   286       },
   287       check: {
   288         hints: ' -> tselarr'
   289       }
   290     },
   291   ]);
   292 };

mercurial