tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

capture_reflect.html (2526B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <meta charset='utf-8'>
      5    <title>HTML Media Capture Test: capture_reflect</title>
      6    <link rel='author' title='Intel' href='http://www.intel.com/'>
      7    <link rel='help' href='https://w3c.github.io/html-media-capture/#the-capture-attribute'>
      8    <meta name='flags' content='dom'>
      9    <meta name='assert' content='Test checks that the capture IDL attribute must reflect the content attribute of the same name.'>
     10    <script src='/resources/testharness.js'></script>
     11    <script src='/resources/testharnessreport.js'></script>
     12  </head>
     13  <body>
     14    <pre style='display:none'>
     15      partial interface HTMLInputElement {
     16        attribute CaptureFacingMode capture;
     17      };
     18      enum CaptureFacingMode {
     19        "user",
     20        "environment"
     21      };
     22    </pre>
     23 
     24    <div style='display:none'>
     25      <input id='absent' type='file' accept='image/*'>
     26      <input id='present-missing' type='file' accept='image/*' capture>
     27      <input id='present-user' type='file' accept='image/*' capture='user'>
     28      <input id='present-invalid' type='file' accept='image/*' capture='invalid'>
     29      <input id='present-environment' type='file' accept='image/*' capture='environment'>
     30    </div>
     31 
     32    <div id='log'></div>
     33 
     34    <script>
     35      test(function() {
     36        let inputs = document.querySelectorAll('input');
     37        for (let i=0, obj; i<inputs.length, obj=inputs[i]; i++) {
     38          assert_true('capture' in obj);
     39          assert_equals(typeof obj.capture, 'string');
     40        }
     41      }, 'Element input should have own property capture');
     42 
     43      test(function() {
     44        assert_equals(document.querySelector('#absent').capture, "");
     45      }, 'input.capture is "" when the capture attribute is absent');
     46 
     47      test(function() {
     48        assert_equals(document.querySelector('#present-missing').capture, "");
     49      }, 'input.capture is "" when the capture attribute is missing value default');
     50 
     51      test(function() {
     52        assert_equals(document.querySelector('#present-user').capture, "user");
     53      }, 'input.capture is "user" when the capture attribute is user');
     54 
     55      test(function() {
     56        assert_equals(document.querySelector('#present-invalid').capture, "");
     57      }, 'input.capture is "" when the capture attribute is invalid value default');
     58 
     59      test(function() {
     60        assert_equals(document.querySelector('#present-environment').capture, "environment");
     61      }, 'input.capture is "environment" when the capture attribute is environment');
     62    </script>
     63  </body>
     64 </html>