| <!DOCTYPE html> |
| <body> |
| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script> |
| |
| test(function() { |
| assert_true(!!window.internals |
| && !!internals.runtimeFlags, |
| "This test only works when run as a layout test!"); |
| }, "Prerequisites to running the rest of the tests"); |
| |
| internals.runtimeFlags.automationControlledEnabled = true; |
| |
| test(function() { |
| assert_true(internals.runtimeFlags.automationControlledEnabled); |
| assert_true("webdriver" in window.navigator); |
| assert_true(navigator.webdriver); |
| }, "Test if Navigator implements NavigatorAutomationInformation interface"); |
| |
| |
| test(function() { |
| var descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator), "webdriver"); |
| assert_true(descriptor !== undefined); |
| assert_true(descriptor.configurable); |
| assert_true(descriptor.enumerable); |
| assert_true(descriptor.set === undefined); |
| }, "Test that the navigator.webdriver descriptor has expected properties"); |
| </script> |
| </body> |
| </html> |