-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wptrunner] Support testdriver.js in {ref,print-ref,crash}tests (#48486)
* [wptrunner] Add `testdriver` flag to non-testharness manifest items This will let wptrunner gracefully skip testdriver tests if the executor doesn't support them. * [wptrunner] Support testdriver.js in {ref,print-ref,crash}tests Non-testharness executors that don't support testdriver simply skip those tests.
- Loading branch information
1 parent
5c0247d
commit c715b79
Showing
18 changed files
with
284 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html class="test-wait"> | ||
<title>crashtests support testdriver.js</title> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<button>Complete the test</button> | ||
<script> | ||
const button = document.querySelector("button"); | ||
button.addEventListener("click", () => { | ||
document.documentElement.classList.remove("test-wait"); | ||
}); | ||
test_driver.click(button); | ||
</script> |
5 changes: 5 additions & 0 deletions
5
infrastructure/metadata/infrastructure/reftest/testdriver-in-ref.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[testdriver-in-ref.html] | ||
disabled: | ||
# https://github.com/web-platform-tests/wpt/issues/13183 | ||
if product == "firefox" or product == "firefox_android": | ||
"marionette executor doesn't currently implement testdriver for reftests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<style> | ||
:root { | ||
background-color: red; | ||
} | ||
</style> | ||
<button>Turn green</button> | ||
<script> | ||
test_driver.set_test_context(parent); | ||
const button = document.querySelector("button"); | ||
button.addEventListener("click", () => { | ||
button.remove(); | ||
document.documentElement.style.backgroundColor = "green"; | ||
test_driver.message_test("done"); | ||
}); | ||
test_driver.click(button); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<title>reftests support testdriver.js in iframes</title> | ||
<link rel="match" href="green.html"> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
iframe { | ||
position: absolute; | ||
border: none; | ||
width: inherit; | ||
height: inherit; | ||
} | ||
</style> | ||
<script> | ||
// Attach the handler that completes the test before loading the calling iframe. | ||
window.addEventListener("message", (evt) => { | ||
if (evt.data === "done") { | ||
document.documentElement.classList.remove("reftest-wait"); | ||
} | ||
}); | ||
</script> | ||
<iframe src="https://{{host}}:{{ports[https][1]}}/infrastructure/reftest/testdriver-child.html"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<title>references support testdriver.js</title> | ||
<link rel="match" href="testdriver.html"> | ||
<style> | ||
:root {background-color:green} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<title>print-reftests support testdriver.js</title> | ||
<link rel="match" href="reftest_match-print-ref.html"> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<style> | ||
* { margin: 0; padding: 0; } | ||
div { page-break-after: always; } | ||
</style> | ||
<button>Add a page</button> | ||
<div>page 1</div> | ||
<script> | ||
const button = document.querySelector("button"); | ||
button.addEventListener("click", () => { | ||
button.remove(); | ||
const page2 = document.createElement("div"); | ||
page2.innerText = "page 2"; | ||
document.body.appendChild(page2); | ||
document.documentElement.classList.remove("reftest-wait"); | ||
}); | ||
test_driver.click(button); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<title>reftests support testdriver.js</title> | ||
<link rel="match" href="green.html"> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<style> | ||
:root { | ||
background-color: red; | ||
} | ||
</style> | ||
<button>Turn green</button> | ||
<script> | ||
const button = document.querySelector("button"); | ||
button.addEventListener("click", () => { | ||
button.remove(); | ||
document.documentElement.style.backgroundColor = "green"; | ||
document.documentElement.classList.remove("reftest-wait"); | ||
}); | ||
test_driver.click(button); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.