Closed Bug 1900664 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 46620 - Use base::span_from_cstring() in HTMLDocumentParserTest

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 46620 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/46620
Details from upstream follow.

Fredrik Söderquist <fs@opera.com> wrote:

Use base::span_from_cstring() in HTMLDocumentParserTest

Many of the tests use sizeof(\<string literal>) to determine the size of
the input. In some cases the trailing NUL is excluded and in some cases
it isn't. In the latter cases not subtracting seems like an oversight,
and the test themselves doesn't appear to test anything regarding NULs.

Convert all instances to use base::span_from_cstring(), which will
account for (remove) the trailing NUL.

Add a testcase that covers this properly to
html/syntax/parsing/zero.html.

Change-Id: I791a9d452c84f324d178586ca3924a39b938c525

Reviewed-on: https://chromium-review.googlesource.com/5594069
WPT-Export-Revision: 5e39aac2bc90d0c487b4f552817c030a2350e4cf

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 14 subtests

Status Summary

Firefox

OK : 1
PASS: 14

Chrome

OK : 1
PASS: 14

Safari

OK : 1
PASS: 14

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/56f5fdce89fc [wpt PR 46620] - Use base::span_from_cstring() in HTMLDocumentParserTest, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.