From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- .../scripting/event-loops/resources/common.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js (limited to 'testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js') diff --git a/testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js b/testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js new file mode 100644 index 000000000..e2279f93d --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/scripting/event-loops/resources/common.js @@ -0,0 +1,20 @@ +// Helper for tests that just want to verify the ordering of a series of events. +// Usage: +// log_test(function(t, log) { +// log('first'); +// log('second'); +// }, ['first', 'second'], 'Ordinal numbers are ordinal'); + +function log_test(func, expected, description) { + async_test(function(t) { + var actual = []; + function log(entry) { + actual.push(entry); + if (expected.length <= actual.length) { + assert_array_equals(actual, expected); + t.done(); + } + } + func(t, t.step_func(log)); + }, description); +} -- cgit v1.2.3