browser/devtools/commandline/test/browser_gcli_tooltip.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_tooltip.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,152 @@
     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-testTooltip.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 assert = require('../testharness/assert');
    1.47 +// var helpers = require('./helpers');
    1.48 +
    1.49 +exports.testActivate = function(options) {
    1.50 +  if (!options.display) {
    1.51 +    assert.log('No display. Skipping activate tests');
    1.52 +    return;
    1.53 +  }
    1.54 +
    1.55 +  return helpers.audit(options, [
    1.56 +    {
    1.57 +      setup:    ' ',
    1.58 +      check: {
    1.59 +        input:  ' ',
    1.60 +        hints:   '',
    1.61 +        markup: 'V',
    1.62 +        cursor: 1,
    1.63 +        current: '__command',
    1.64 +        status: 'ERROR',
    1.65 +        message:  '',
    1.66 +        unassigned: [ ],
    1.67 +        outputState: 'false:default',
    1.68 +        tooltipState: 'false:default'
    1.69 +      }
    1.70 +    },
    1.71 +    {
    1.72 +      setup:    'tsb ',
    1.73 +      check: {
    1.74 +        input:  'tsb ',
    1.75 +        hints:      'false',
    1.76 +        markup: 'VVVV',
    1.77 +        cursor: 4,
    1.78 +        current: 'toggle',
    1.79 +        status: 'VALID',
    1.80 +        options: [ 'false', 'true' ],
    1.81 +        message:  '',
    1.82 +        predictions: [ 'false', 'true' ],
    1.83 +        unassigned: [ ],
    1.84 +        outputState: 'false:default',
    1.85 +        tooltipState: 'true:importantFieldFlag'
    1.86 +      }
    1.87 +    },
    1.88 +    {
    1.89 +      setup:    'tsb t',
    1.90 +      check: {
    1.91 +        input:  'tsb t',
    1.92 +        hints:       'rue',
    1.93 +        markup: 'VVVVI',
    1.94 +        cursor: 5,
    1.95 +        current: 'toggle',
    1.96 +        status: 'ERROR',
    1.97 +        options: [ 'true' ],
    1.98 +        message:  '',
    1.99 +        predictions: [ 'true' ],
   1.100 +        unassigned: [ ],
   1.101 +        outputState: 'false:default',
   1.102 +        tooltipState: 'true:importantFieldFlag'
   1.103 +      }
   1.104 +    },
   1.105 +    {
   1.106 +      setup:    'tsb tt',
   1.107 +      check: {
   1.108 +        input:  'tsb tt',
   1.109 +        hints:        ' -> true',
   1.110 +        markup: 'VVVVII',
   1.111 +        cursor: 6,
   1.112 +        current: 'toggle',
   1.113 +        status: 'ERROR',
   1.114 +        options: [ 'true' ],
   1.115 +        message: '',
   1.116 +        predictions: [ 'true' ],
   1.117 +        unassigned: [ ],
   1.118 +        outputState: 'false:default',
   1.119 +        tooltipState: 'true:importantFieldFlag'
   1.120 +      }
   1.121 +    },
   1.122 +    {
   1.123 +      setup:    'wxqy',
   1.124 +      check: {
   1.125 +        input:  'wxqy',
   1.126 +        hints:      '',
   1.127 +        markup: 'EEEE',
   1.128 +        cursor: 4,
   1.129 +        current: '__command',
   1.130 +        status: 'ERROR',
   1.131 +        options: [ ],
   1.132 +        message:  'Can\'t use \'wxqy\'.',
   1.133 +        predictions: [ ],
   1.134 +        unassigned: [ ],
   1.135 +        outputState: 'false:default',
   1.136 +        tooltipState: 'true:isError'
   1.137 +      }
   1.138 +    },
   1.139 +    {
   1.140 +      setup:    '',
   1.141 +      check: {
   1.142 +        input:  '',
   1.143 +        hints:  '',
   1.144 +        markup: '',
   1.145 +        cursor: 0,
   1.146 +        current: '__command',
   1.147 +        status: 'ERROR',
   1.148 +        message: '',
   1.149 +        unassigned: [ ],
   1.150 +        outputState: 'false:default',
   1.151 +        tooltipState: 'false:default'
   1.152 +      }
   1.153 +    }
   1.154 +  ]);
   1.155 +};

mercurial