Automatic update from web-platform-tests [wpt] Convert console manual tests to Bidi-based automation. Convert several manual WPT console tests to automated testharness.js tests using WebDriver BiDi log.entryAdded via testdriver.js?feature=bidi. Changes: - Remove manual tests: console-count-logging-manual.html console-countReset-logging-manual.html console-number-format-specifiers-symbol-manual.html console-timing-logging-manual.html - Add automated tests: console-count-logging.html console-countReset-logging.html console-number-format-specifiers-symbol.html console-timing-logging.html console-timing-missing-label-warnings.tentative.html - Update NeverFixTests accordingly. Bug: 489738791 Change-Id: Iba1718b4e423391cc8a186664a3889002e87c4fd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7657323 Commit-Queue: Minju Kim <mkim@igalia.com> Reviewed-by: Alex N. Jose <alexnj@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/main@{#1607021} -- wpt-commits: be3f3ee1b16088d9d593119061578df45070a0fd wpt-pr: 58820
43 lines
1.4 KiB
HTML
43 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>Console Count - Automated Test</title>
|
|
<link rel="help" href="https://console.spec.whatwg.org/#count">
|
|
<meta name="assert" content="Console count method default parameter should work">
|
|
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/resources/testdriver.js?feature=bidi"></script>
|
|
<script src="/resources/testdriver-vendor.js"></script>
|
|
|
|
<script>
|
|
promise_test(async (t) => {
|
|
const unsubscribe = await test_driver.bidi.log.entry_added.subscribe({contexts: [window]});
|
|
t.add_cleanup(async () => await unsubscribe());
|
|
|
|
const expected = ["default: 1", "default: 2", "default: 3", "default: 4"];
|
|
|
|
const entries_promise = new Promise(resolve => {
|
|
const entries = [];
|
|
const remove_listener = test_driver.bidi.log.entry_added.on(event => {
|
|
if (event.type !== "console" || event.method !== "count") return;
|
|
if (typeof event.text !== "string") return;
|
|
|
|
entries.push(event.text);
|
|
if (entries.length === expected.length) {
|
|
remove_listener();
|
|
resolve(entries);
|
|
}
|
|
});
|
|
t.add_cleanup(remove_listener);
|
|
});
|
|
|
|
console.count();
|
|
console.count(undefined);
|
|
console.count("default");
|
|
console.count({toString() { return "default"; }});
|
|
|
|
const entries = await entries_promise;
|
|
assert_array_equals(entries, expected);
|
|
}, "Console count method default parameter should work");
|
|
</script>
|