https://github.com/web-platform-tests/wpt
Raw File
Tip revision: efebd77ee5ec77d90333b10605c37aa1e6698ee5 authored by moz-wptsync-bot on 14 March 2018, 18:16:47 UTC
Use WorkerRef in FileReader,
Tip revision: efebd77
interface.html
<!doctype html>
<meta charset=utf-8>

<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>

<script type=text/plain class=untested>
[Exposed=Window]
interface Navigator {
  // objects implementing this interface also implement the interfaces given below
};
</script>

<script type=text/plain>
Navigator includes NavigatorAutomationInformation;

interface mixin NavigatorAutomationInformation {
  readonly attribute boolean webdriver;
};
</script>

<script>
"use strict";

test(() => assert_idl_attribute(navigator, "webdriver"), "navigator.webdriver is present");

// When test is run in automation navigator.webdriver is likely to
// be true because WebDriver controls the browser instance.  To that
// extent, this test is a bit special.  It should also be possible to
// run the test manually, when WebDriver is not active, and so either
// true/false outcome is OK.
if (navigator.webdriver) {
  test(() => assert_true(navigator.webdriver), "navigator.webdriver is true when webdriver-active is set");
} else {
  test(() => assert_false(navigator.webdriver), "navigator.webdriver is false when webdriver-active is not set");
}

var idls = new IdlArray();
for (let node of [...document.scripts].filter(({type}) => type == "text/plain")) {
  if (node.className == "untested") {
    idls.add_untested_idls(node.textContent);
  } else {
    idls.add_idls(node.textContent);
  }
};
idls.test();
</script>
back to top