Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
  • Loading branch information
chickenleaf authored and servo-wpt-sync committed Nov 2, 2024
1 parent 0323acd commit d2f2efe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webxr/events_input_sources_change.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<script src="resources/webxr_test_constants.js"></script>

<script>
"use strict"
let testName = "Transient input sources fire events in the right order";

let watcherDone = new Event("watcherdone");
Expand All @@ -25,6 +26,17 @@
assert_equals(event.session, session);
validateSameObject(event);

assert_throws_js(
TypeError,
() => { event.added[0] = "test"; },
"added array must be frozen"
);
assert_throws_js(
TypeError,
() => { event.removed[0] = "test"; },
"removed array must be frozen"
);

// The first change event should be adding our controller.
if (inputChangeEvents === 1) {
validateAdded(event.added, 1);
Expand Down

0 comments on commit d2f2efe

Please sign in to comment.