browser/devtools/commandline/test/browser_gcli_tooltip.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-testTooltip.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 assert = require('../testharness/assert');
    44 // var helpers = require('./helpers');
    46 exports.testActivate = function(options) {
    47   if (!options.display) {
    48     assert.log('No display. Skipping activate tests');
    49     return;
    50   }
    52   return helpers.audit(options, [
    53     {
    54       setup:    ' ',
    55       check: {
    56         input:  ' ',
    57         hints:   '',
    58         markup: 'V',
    59         cursor: 1,
    60         current: '__command',
    61         status: 'ERROR',
    62         message:  '',
    63         unassigned: [ ],
    64         outputState: 'false:default',
    65         tooltipState: 'false:default'
    66       }
    67     },
    68     {
    69       setup:    'tsb ',
    70       check: {
    71         input:  'tsb ',
    72         hints:      'false',
    73         markup: 'VVVV',
    74         cursor: 4,
    75         current: 'toggle',
    76         status: 'VALID',
    77         options: [ 'false', 'true' ],
    78         message:  '',
    79         predictions: [ 'false', 'true' ],
    80         unassigned: [ ],
    81         outputState: 'false:default',
    82         tooltipState: 'true:importantFieldFlag'
    83       }
    84     },
    85     {
    86       setup:    'tsb t',
    87       check: {
    88         input:  'tsb t',
    89         hints:       'rue',
    90         markup: 'VVVVI',
    91         cursor: 5,
    92         current: 'toggle',
    93         status: 'ERROR',
    94         options: [ 'true' ],
    95         message:  '',
    96         predictions: [ 'true' ],
    97         unassigned: [ ],
    98         outputState: 'false:default',
    99         tooltipState: 'true:importantFieldFlag'
   100       }
   101     },
   102     {
   103       setup:    'tsb tt',
   104       check: {
   105         input:  'tsb tt',
   106         hints:        ' -> true',
   107         markup: 'VVVVII',
   108         cursor: 6,
   109         current: 'toggle',
   110         status: 'ERROR',
   111         options: [ 'true' ],
   112         message: '',
   113         predictions: [ 'true' ],
   114         unassigned: [ ],
   115         outputState: 'false:default',
   116         tooltipState: 'true:importantFieldFlag'
   117       }
   118     },
   119     {
   120       setup:    'wxqy',
   121       check: {
   122         input:  'wxqy',
   123         hints:      '',
   124         markup: 'EEEE',
   125         cursor: 4,
   126         current: '__command',
   127         status: 'ERROR',
   128         options: [ ],
   129         message:  'Can\'t use \'wxqy\'.',
   130         predictions: [ ],
   131         unassigned: [ ],
   132         outputState: 'false:default',
   133         tooltipState: 'true:isError'
   134       }
   135     },
   136     {
   137       setup:    '',
   138       check: {
   139         input:  '',
   140         hints:  '',
   141         markup: '',
   142         cursor: 0,
   143         current: '__command',
   144         status: 'ERROR',
   145         message: '',
   146         unassigned: [ ],
   147         outputState: 'false:default',
   148         tooltipState: 'false:default'
   149       }
   150     }
   151   ]);
   152 };

mercurial