browser/devtools/inspector/test/browser_inspector_cmd_inspect.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/inspector/test/browser_inspector_cmd_inspect.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,133 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +// Tests that the inspect command works as it should
     1.8 +
     1.9 +const TEST_URI = "http://example.com/browser/browser/devtools/inspector/" +
    1.10 +                 "test/browser_inspector_cmd_inspect.html";
    1.11 +
    1.12 +function test() {
    1.13 +  helpers.addTabWithToolbar(TEST_URI, function(options) {
    1.14 +    return helpers.audit(options, [
    1.15 +      {
    1.16 +        setup: "inspect",
    1.17 +        check: {
    1.18 +          input:  'inspect',
    1.19 +          hints:         ' <selector>',
    1.20 +          markup: 'VVVVVVV',
    1.21 +          status: 'ERROR',
    1.22 +          args: {
    1.23 +            selector: {
    1.24 +              message: 'Value required for \'selector\'.'
    1.25 +            },
    1.26 +          }
    1.27 +        },
    1.28 +      },
    1.29 +      {
    1.30 +        setup: "inspect h1",
    1.31 +        check: {
    1.32 +          input:  'inspect h1',
    1.33 +          hints:            '',
    1.34 +          markup: 'VVVVVVVVII',
    1.35 +          status: 'ERROR',
    1.36 +          args: {
    1.37 +            selector: { message: 'No matches' },
    1.38 +          }
    1.39 +        },
    1.40 +      },
    1.41 +      {
    1.42 +        setup: "inspect span",
    1.43 +        check: {
    1.44 +          input:  'inspect span',
    1.45 +          hints:              '',
    1.46 +          markup: 'VVVVVVVVEEEE',
    1.47 +          status: 'ERROR',
    1.48 +          args: {
    1.49 +            selector: { message: 'Too many matches (2)' },
    1.50 +          }
    1.51 +        },
    1.52 +      },
    1.53 +      {
    1.54 +        setup: "inspect div",
    1.55 +        check: {
    1.56 +          input:  'inspect div',
    1.57 +          hints:             '',
    1.58 +          markup: 'VVVVVVVVVVV',
    1.59 +          status: 'VALID',
    1.60 +          args: {
    1.61 +            selector: { message: '' },
    1.62 +          }
    1.63 +        },
    1.64 +      },
    1.65 +      {
    1.66 +        setup: "inspect .someclas",
    1.67 +        check: {
    1.68 +          input:  'inspect .someclas',
    1.69 +          hints:                   '',
    1.70 +          markup: 'VVVVVVVVIIIIIIIII',
    1.71 +          status: 'ERROR',
    1.72 +          args: {
    1.73 +            selector: { message: 'No matches' },
    1.74 +          }
    1.75 +        },
    1.76 +      },
    1.77 +      {
    1.78 +        setup: "inspect .someclass",
    1.79 +        check: {
    1.80 +          input:  'inspect .someclass',
    1.81 +          hints:                    '',
    1.82 +          markup: 'VVVVVVVVVVVVVVVVVV',
    1.83 +          status: 'VALID',
    1.84 +          args: {
    1.85 +            selector: { message: '' },
    1.86 +          }
    1.87 +        },
    1.88 +      },
    1.89 +      {
    1.90 +        setup: "inspect #someid",
    1.91 +        check: {
    1.92 +          input:  'inspect #someid',
    1.93 +          hints:                 '',
    1.94 +          markup: 'VVVVVVVVVVVVVVV',
    1.95 +          status: 'VALID',
    1.96 +          args: {
    1.97 +            selector: { message: '' },
    1.98 +          }
    1.99 +        },
   1.100 +      },
   1.101 +      {
   1.102 +        setup: "inspect button[disabled]",
   1.103 +        check: {
   1.104 +          input:  'inspect button[disabled]',
   1.105 +          hints:                          '',
   1.106 +          markup: 'VVVVVVVVVVVVVVVVVVVVVVVV',
   1.107 +          status: 'VALID',
   1.108 +          args: {
   1.109 +            selector: { message: '' },
   1.110 +          }
   1.111 +        },
   1.112 +      },
   1.113 +      {
   1.114 +        setup: "inspect p>strong",
   1.115 +        check: {
   1.116 +          input:  'inspect p>strong',
   1.117 +          hints:                  '',
   1.118 +          markup: 'VVVVVVVVVVVVVVVV',
   1.119 +          status: 'VALID',
   1.120 +          args: {
   1.121 +            selector: { message: '' },
   1.122 +          }
   1.123 +        },
   1.124 +      },
   1.125 +      {
   1.126 +        setup: "inspect :root",
   1.127 +        check: {
   1.128 +          input:  'inspect :root',
   1.129 +          hints:               '',
   1.130 +          markup: 'VVVVVVVVVVVVV',
   1.131 +          status: 'VALID'
   1.132 +        },
   1.133 +      },
   1.134 +    ]);
   1.135 +  }).then(finish);
   1.136 +}

mercurial