summaryrefslogtreecommitdiffstats
path: root/devtools/client/commandline/test/browser_cmd_highlight_03.js
blob: 75b28af61d1718a93dd96af4babce9396e2135ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

/* eslint key-spacing: 0 */

// Tests the various highlight command parameters and options that doesn't
// involve nodes at all.

var TEST_PAGE = "data:text/html;charset=utf-8,";

function test() {
  return Task.spawn(spawnTest).then(finish, helpers.handleError);
}

function* spawnTest() {
  let options = yield helpers.openTab(TEST_PAGE);
  yield helpers.openToolbar(options);

  yield helpers.audit(options, [
    {
      setup: "highlight body --hide",
      check: {
        input:  "highlight body --hide",
        hints:                       "guides [options]",
        markup: "VVVVVVVVVVVVVVVIIIIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Too many arguments"
      }
    },
    {
      setup: "highlight body --show",
      check: {
        input:  "highlight body --show",
        hints:                       "infobar [options]",
        markup: "VVVVVVVVVVVVVVVIIIIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Too many arguments"
      }
    },
    {
      setup: "highlight body --showa",
      check: {
        input:  "highlight body --showa",
        hints:                        "ll [options]",
        markup: "VVVVVVVVVVVVVVVIIIIIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Too many arguments"
      }
    },
    {
      setup: "highlight body --r",
      check: {
        input:  "highlight body --r",
        hints:                    "egion [options]",
        markup: "VVVVVVVVVVVVVVVIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Too many arguments"
      }
    },
    {
      setup: "highlight body --region",
      check: {
        input:  "highlight body --region",
        hints:                         " <selection> [options]",
        markup: "VVVVVVVVVVVVVVVIIIIIIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Value required for \u2018region\u2019."
      }
    },
    {
      setup: "highlight body --fi",
      check: {
        input:  "highlight body --fi",
        hints:                     "ll [options]",
        markup: "VVVVVVVVVVVVVVVIIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Too many arguments"
      }
    },
    {
      setup: "highlight body --fill",
      check: {
        input:  "highlight body --fill",
        hints:                       " <string> [options]",
        markup: "VVVVVVVVVVVVVVVIIIIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Value required for \u2018fill\u2019."
      }
    },
    {
      setup: "highlight body --ke",
      check: {
        input:  "highlight body --ke",
        hints:                     "ep [options]",
        markup: "VVVVVVVVVVVVVVVIIII",
        status: "ERROR"
      },
      exec: {
        output: "Error: Too many arguments"
      }
    },
    {
      setup: "unhighlight",
      check: {
        input:  "unhighlight",
        hints:  "",
        markup: "VVVVVVVVVVV",
        status: "VALID"
      }
    }
  ]);

  yield helpers.closeToolbar(options);
  yield helpers.closeTab(options);
}