Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace general source type with none source type #14081

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions infrastructure/testdriver/actions/pause.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>TestDriver actions: event order</title>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind updating the title?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I will also need to skip the test for Chrome as we don't support it yet in ChromeDriver.

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>

<script>
async_test(t => {
let t0 = performance.now();
let actions = new test_driver.Actions()
.addTick(2000)
.send()
.then(t.step_func_done(() => assert_greater_than(performance.now() - t0, 2000)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test will time out instead of fail if the promise is rejected. Could you add a rejection handler or refactor it into a promise_test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

})
</script>
8 changes: 4 additions & 4 deletions resources/testdriver-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
function Actions() {
this.sourceTypes = new Map([["key", KeySource],
["pointer", PointerSource],
["general", GeneralSource]]);
["none", GeneralSource]]);
this.sources = new Map();
this.sourceOrder = [];
for (let sourceType of this.sourceTypes.keys()) {
Expand All @@ -17,7 +17,7 @@
for (let sourceType of this.sourceTypes.keys()) {
this.currentSources.set(sourceType, null);
}
this.createSource("general");
this.createSource("none");
this.tickIdx = 0;
}

Expand Down Expand Up @@ -62,7 +62,7 @@
* If no name is passed, a new source with the given type is
* created.
*
* @param {String} type - Source type ('general', 'key', or 'pointer')
* @param {String} type - Source type ('none', 'key', or 'pointer')
* @param {String?} name - Name of the source
* @returns {Source} Source object for that source.
*/
Expand Down Expand Up @@ -187,7 +187,7 @@
* @returns {Actions}
*/
pause: function(duration) {
this.getSource("general").addPause(this, duration);
this.getSource("none").addPause(this, duration);
return this;
},

Expand Down