michael@0: /* michael@0: * Copyright 2012, Mozilla Foundation and contributors michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: 'use strict'; michael@0: // michael@0: michael@0: // THIS FILE IS GENERATED FROM SOURCE IN THE GCLI PROJECT michael@0: // DO NOT EDIT IT DIRECTLY michael@0: michael@0: var exports = {}; michael@0: michael@0: var TEST_URI = "data:text/html;charset=utf-8,

gcli-testCompletion2.js

"; michael@0: michael@0: function test() { michael@0: return Task.spawn(function() { michael@0: let options = yield helpers.openTab(TEST_URI); michael@0: yield helpers.openToolbar(options); michael@0: gcli.addItems(mockCommands.items); michael@0: michael@0: yield helpers.runTests(options, exports); michael@0: michael@0: gcli.removeItems(mockCommands.items); michael@0: yield helpers.closeToolbar(options); michael@0: yield helpers.closeTab(options); michael@0: }).then(finish, helpers.handleError); michael@0: } michael@0: michael@0: // michael@0: michael@0: // var helpers = require('./helpers'); michael@0: michael@0: exports.testLong = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'tslong --sel', michael@0: check: { michael@0: input: 'tslong --sel', michael@0: hints: ' [options]', michael@0: markup: 'VVVVVVVIIIII' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --sel', michael@0: check: { michael@0: input: 'tslong --sel ', michael@0: hints: 'space [options]', michael@0: markup: 'VVVVVVVIIIIIV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --sel ', michael@0: check: { michael@0: input: 'tslong --sel ', michael@0: hints: 'space [options]', michael@0: markup: 'VVVVVVVIIIIIV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --sel s', michael@0: check: { michael@0: input: 'tslong --sel s', michael@0: hints: 'pace [options]', michael@0: markup: 'VVVVVVVIIIIIVI' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num ', michael@0: check: { michael@0: input: 'tslong --num ', michael@0: hints: ' [options]', michael@0: markup: 'VVVVVVVIIIIIV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num 42', michael@0: check: { michael@0: input: 'tslong --num 42', michael@0: hints: ' [options]', michael@0: markup: 'VVVVVVVVVVVVVVV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num 42 ', michael@0: check: { michael@0: input: 'tslong --num 42 ', michael@0: hints: ' [options]', michael@0: markup: 'VVVVVVVVVVVVVVVV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num 42 --se', michael@0: check: { michael@0: input: 'tslong --num 42 --se', michael@0: hints: 'l [options]', michael@0: markup: 'VVVVVVVVVVVVVVVVIIII' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num 42 --se', michael@0: check: { michael@0: input: 'tslong --num 42 --sel ', michael@0: hints: 'space [options]', michael@0: markup: 'VVVVVVVVVVVVVVVVIIIIIV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num 42 --se', michael@0: check: { michael@0: input: 'tslong --num 42 --sel space ', michael@0: hints: ' [options]', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num 42 --sel ', michael@0: check: { michael@0: input: 'tslong --num 42 --sel ', michael@0: hints: 'space [options]', michael@0: markup: 'VVVVVVVVVVVVVVVVIIIIIV' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --num 42 --sel space ', michael@0: check: { michael@0: input: 'tslong --num 42 --sel space ', michael@0: hints: ' [options]', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVVV' michael@0: } michael@0: } michael@0: ]); michael@0: }; michael@0: michael@0: exports.testNoTab = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'tss', michael@0: check: { michael@0: input: 'tss ', michael@0: markup: 'VVVV', michael@0: hints: '' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tss', michael@0: check: { michael@0: input: 'tss ', michael@0: markup: 'VVVV', michael@0: hints: '' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'xxxx', michael@0: check: { michael@0: input: 'xxxx', michael@0: markup: 'EEEE', michael@0: hints: '' michael@0: } michael@0: }, michael@0: { michael@0: skipIf: options.isNoDom, michael@0: name: '', michael@0: setup: function() { michael@0: // Doing it this way avoids clearing the input buffer michael@0: return helpers.pressTab(options); michael@0: }, michael@0: check: { michael@0: input: 'xxxx', michael@0: markup: 'EEEE', michael@0: hints: '' michael@0: } michael@0: } michael@0: ]); michael@0: }; michael@0: michael@0: exports.testOutstanding = function(options) { michael@0: // See bug 779800 michael@0: /* michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'tsg --txt1 ddd ', michael@0: check: { michael@0: input: 'tsg --txt1 ddd ', michael@0: hints: 'aaa [options]', michael@0: markup: 'VVVVVVVVVVVVVVV' michael@0: } michael@0: }, michael@0: ]); michael@0: */ michael@0: }; michael@0: michael@0: exports.testCompleteIntoOptional = function(options) { michael@0: // From bug 779816 michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'tso ', michael@0: check: { michael@0: typed: 'tso ', michael@0: hints: '[text]', michael@0: markup: 'VVVV', michael@0: status: 'VALID' michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tso', michael@0: check: { michael@0: typed: 'tso ', michael@0: hints: '[text]', michael@0: markup: 'VVVV', michael@0: status: 'VALID' michael@0: } michael@0: } michael@0: ]); michael@0: }; michael@0: michael@0: exports.testSpaceComplete = function(options) { michael@0: return helpers.audit(options, [ michael@0: { michael@0: setup: 'tslong --sel2 wit', michael@0: check: { michael@0: input: 'tslong --sel2 wit', michael@0: hints: 'h space [options]', michael@0: markup: 'VVVVVVVIIIIIIVIII', michael@0: cursor: 17, michael@0: current: 'sel2', michael@0: status: 'ERROR', michael@0: tooltipState: 'true:importantFieldFlag', michael@0: args: { michael@0: command: { name: 'tslong' }, michael@0: msg: { status: 'INCOMPLETE' }, michael@0: num: { status: 'VALID' }, michael@0: sel: { status: 'VALID' }, michael@0: bool: { value: false, status: 'VALID' }, michael@0: num2: { status: 'VALID' }, michael@0: bool2: { value: false, status: 'VALID' }, michael@0: sel2: { arg: ' --sel2 wit', status: 'INCOMPLETE' } michael@0: } michael@0: } michael@0: }, michael@0: { michael@0: setup: 'tslong --sel2 wit', michael@0: check: { michael@0: input: 'tslong --sel2 \'with space\' ', michael@0: hints: ' [options]', michael@0: markup: 'VVVVVVVVVVVVVVVVVVVVVVVVVVV', michael@0: cursor: 27, michael@0: current: 'sel2', michael@0: status: 'ERROR', michael@0: tooltipState: 'true:importantFieldFlag', michael@0: args: { michael@0: command: { name: 'tslong' }, michael@0: msg: { status: 'INCOMPLETE' }, michael@0: num: { status: 'VALID' }, michael@0: sel: { status: 'VALID' }, michael@0: bool: { value: false, status: 'VALID' }, michael@0: num2: { status: 'VALID' }, michael@0: bool2: { value: false, status: 'VALID' }, michael@0: sel2: { michael@0: value: 'with space', michael@0: arg: ' --sel2 \'with space\' ', michael@0: status: 'VALID' michael@0: } michael@0: } michael@0: } michael@0: } michael@0: ]); michael@0: };