Revision 89ba9443f1d80b2bea3a33477b1ac53585fbb16d authored by jimevans on 16 March 2018, 14:46:32 UTC, committed by Andreas Tolfsen on 16 March 2018, 14:46:32 UTC
When the context element is `document.documentElement`, and an attempt is
made to find elements from that context element using an XPath of `..`, a
snapshot is returned containing the `document` object. While this is
apparently the correct behavior for XPath, the WebDriver spec says that if
the object in the snapshot is not an element, we should return an error
with error code "invalid selector." The test_parent_htmldocument test in
both find_element_from_element.py and find_elements_from_element.py expect
a success in this case. This commit changes the tests to correctly expect
an error from the driver.
1 parent 1cbb928
Raw File
name-property.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test the name property of shared and dedicated workers via the name constructor option</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#concept-workerglobalscope-name">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-sharedworkerglobalscope-name">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-name">
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script>
"use strict";

const worker = new Worker("support/name.js", { name: "my name" });
fetch_tests_from_worker(worker);

const worker2 = new Worker("support/name-as-accidental-global.js");
fetch_tests_from_worker(worker2);

const sharedWorker = new SharedWorker("support/name.js", { name: "my name" });
fetch_tests_from_worker(sharedWorker);

const sharedWorker2 = new SharedWorker("support/name-as-accidental-global.js");
fetch_tests_from_worker(sharedWorker2);
</script>
back to top