tor-browser

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

NDEFReader-write-document-hidden-manual.https.html (890B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <meta name="timeout" content="long">
      4 <title>NDEFReader.write respect page visibility changes</title>
      5 <link rel="help" href="https://w3c.github.io/web-nfc/#visible-document">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="resources/nfc-helpers.js"></script>
      9 <script>
     10 
     11 promise_test(async t => {
     12  const writer = new NDEFReader();
     13  const p1 = writer.write(test_text_data);
     14 
     15  return await new Promise((resolve, reject) => {
     16    p1.then(() => {
     17      assert_false(document.hidden);
     18      resolve();
     19    }).catch(e => {
     20      reject();
     21    });
     22  });
     23 }, "Test NDEFReader.write operation should be suspended when document is not visible");
     24 
     25 </script>
     26 
     27 <p>Step1: switch the page to the background, then tap an NFC tag.</p>
     28 <p>Step2: switch back to the page, then tap the tag again.</p>