browser/devtools/commandline/test/browser_gcli_completion1.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_completion1.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,292 @@
     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-testCompletion1.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.testActivate = function(options) {
    1.49 +  return helpers.audit(options, [
    1.50 +    {
    1.51 +      setup: '',
    1.52 +      check: {
    1.53 +        hints: ''
    1.54 +      }
    1.55 +    },
    1.56 +    {
    1.57 +      setup: ' ',
    1.58 +      check: {
    1.59 +        hints: ''
    1.60 +      }
    1.61 +    },
    1.62 +    {
    1.63 +      setup: 'tsr',
    1.64 +      check: {
    1.65 +        hints: ' <text>'
    1.66 +      }
    1.67 +    },
    1.68 +    {
    1.69 +      setup: 'tsr ',
    1.70 +      check: {
    1.71 +        hints: '<text>'
    1.72 +      }
    1.73 +    },
    1.74 +    {
    1.75 +      setup: 'tsr b',
    1.76 +      check: {
    1.77 +        hints: ''
    1.78 +      }
    1.79 +    },
    1.80 +    {
    1.81 +      setup: 'tsb',
    1.82 +      check: {
    1.83 +        hints: ' [toggle]'
    1.84 +      }
    1.85 +    },
    1.86 +    {
    1.87 +      setup: 'tsm',
    1.88 +      check: {
    1.89 +        hints: ' <abc> <txt> <num>'
    1.90 +      }
    1.91 +    },
    1.92 +    {
    1.93 +      setup: 'tsm ',
    1.94 +      check: {
    1.95 +        hints: 'a <txt> <num>'
    1.96 +      }
    1.97 +    },
    1.98 +    {
    1.99 +      setup: 'tsm a',
   1.100 +      check: {
   1.101 +        hints: ' <txt> <num>'
   1.102 +      }
   1.103 +    },
   1.104 +    {
   1.105 +      setup: 'tsm a ',
   1.106 +      check: {
   1.107 +        hints: '<txt> <num>'
   1.108 +      }
   1.109 +    },
   1.110 +    {
   1.111 +      setup: 'tsm a  ',
   1.112 +      check: {
   1.113 +        hints: '<txt> <num>'
   1.114 +      }
   1.115 +    },
   1.116 +    {
   1.117 +      setup: 'tsm a  d',
   1.118 +      check: {
   1.119 +        hints: ' <num>'
   1.120 +      }
   1.121 +    },
   1.122 +    {
   1.123 +      setup: 'tsm a "d d"',
   1.124 +      check: {
   1.125 +        hints: ' <num>'
   1.126 +      }
   1.127 +    },
   1.128 +    {
   1.129 +      setup: 'tsm a "d ',
   1.130 +      check: {
   1.131 +        hints: ' <num>'
   1.132 +      }
   1.133 +    },
   1.134 +    {
   1.135 +      setup: 'tsm a "d d" ',
   1.136 +      check: {
   1.137 +        hints: '<num>'
   1.138 +      }
   1.139 +    },
   1.140 +    {
   1.141 +      setup: 'tsm a "d d ',
   1.142 +      check: {
   1.143 +        hints: ' <num>'
   1.144 +      }
   1.145 +    },
   1.146 +    {
   1.147 +      setup: 'tsm d r',
   1.148 +      check: {
   1.149 +        hints: ' <num>'
   1.150 +      }
   1.151 +    },
   1.152 +    {
   1.153 +      setup: 'tsm a d ',
   1.154 +      check: {
   1.155 +        hints: '<num>'
   1.156 +      }
   1.157 +    },
   1.158 +    {
   1.159 +      setup: 'tsm a d 4',
   1.160 +      check: {
   1.161 +        hints: ''
   1.162 +      }
   1.163 +    },
   1.164 +    {
   1.165 +      setup: 'tsg',
   1.166 +      check: {
   1.167 +        hints: ' <solo> [options]'
   1.168 +      }
   1.169 +    },
   1.170 +    {
   1.171 +      setup: 'tsg ',
   1.172 +      check: {
   1.173 +        hints: 'aaa [options]'
   1.174 +      }
   1.175 +    },
   1.176 +    {
   1.177 +      setup: 'tsg a',
   1.178 +      check: {
   1.179 +        hints: 'aa [options]'
   1.180 +      }
   1.181 +    },
   1.182 +    {
   1.183 +      setup: 'tsg b',
   1.184 +      check: {
   1.185 +        hints: 'bb [options]'
   1.186 +      }
   1.187 +    },
   1.188 +    {
   1.189 +      skipIf: options.isPhantomjs,
   1.190 +      setup: 'tsg d',
   1.191 +      check: {
   1.192 +        hints: ' [options] -> ccc'
   1.193 +      }
   1.194 +    },
   1.195 +    {
   1.196 +      setup: 'tsg aa',
   1.197 +      check: {
   1.198 +        hints: 'a [options]'
   1.199 +      }
   1.200 +    },
   1.201 +    {
   1.202 +      setup: 'tsg aaa',
   1.203 +      check: {
   1.204 +        hints: ' [options]'
   1.205 +      }
   1.206 +    },
   1.207 +    {
   1.208 +      setup: 'tsg aaa ',
   1.209 +      check: {
   1.210 +        hints: '[options]'
   1.211 +      }
   1.212 +    },
   1.213 +    {
   1.214 +      setup: 'tsg aaa d',
   1.215 +      check: {
   1.216 +        hints: ' [options]'
   1.217 +      }
   1.218 +    },
   1.219 +    {
   1.220 +      setup: 'tsg aaa dddddd',
   1.221 +      check: {
   1.222 +        hints: ' [options]'
   1.223 +      }
   1.224 +    },
   1.225 +    {
   1.226 +      setup: 'tsg aaa dddddd ',
   1.227 +      check: {
   1.228 +        hints: '[options]'
   1.229 +      }
   1.230 +    },
   1.231 +    {
   1.232 +      setup: 'tsg aaa "d',
   1.233 +      check: {
   1.234 +        hints: ' [options]'
   1.235 +      }
   1.236 +    },
   1.237 +    {
   1.238 +      setup: 'tsg aaa "d d',
   1.239 +      check: {
   1.240 +        hints: ' [options]'
   1.241 +      }
   1.242 +    },
   1.243 +    {
   1.244 +      setup: 'tsg aaa "d d"',
   1.245 +      check: {
   1.246 +        hints: ' [options]'
   1.247 +      }
   1.248 +    },
   1.249 +    {
   1.250 +      setup: 'tsn ex ',
   1.251 +      check: {
   1.252 +        hints: ''
   1.253 +      }
   1.254 +    },
   1.255 +    {
   1.256 +      setup: 'selarr',
   1.257 +      check: {
   1.258 +        hints: ' -> tselarr'
   1.259 +      }
   1.260 +    },
   1.261 +    {
   1.262 +      setup: 'tselar 1',
   1.263 +      check: {
   1.264 +        hints: ''
   1.265 +      }
   1.266 +    },
   1.267 +    {
   1.268 +      name: 'tselar |1',
   1.269 +      setup: function() {
   1.270 +        return helpers.setInput(options, 'tselar 1', 7);
   1.271 +      },
   1.272 +      check: {
   1.273 +        hints: ''
   1.274 +      }
   1.275 +    },
   1.276 +    {
   1.277 +      name: 'tselar| 1',
   1.278 +      setup: function() {
   1.279 +        return helpers.setInput(options, 'tselar 1', 6);
   1.280 +      },
   1.281 +      check: {
   1.282 +        hints: ' -> tselarr'
   1.283 +      }
   1.284 +    },
   1.285 +    {
   1.286 +      name: 'tsela|r 1',
   1.287 +      setup: function() {
   1.288 +        return helpers.setInput(options, 'tselar 1', 5);
   1.289 +      },
   1.290 +      check: {
   1.291 +        hints: ' -> tselarr'
   1.292 +      }
   1.293 +    },
   1.294 +  ]);
   1.295 +};

mercurial