diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /testing/web-platform/tests/css/css-paint-api | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-paint-api')
-rw-r--r-- | testing/web-platform/tests/css/css-paint-api/parse-input-arguments-018.https.html | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/testing/web-platform/tests/css/css-paint-api/parse-input-arguments-018.https.html b/testing/web-platform/tests/css/css-paint-api/parse-input-arguments-018.https.html index 1554cc6445..a07bb2d619 100644 --- a/testing/web-platform/tests/css/css-paint-api/parse-input-arguments-018.https.html +++ b/testing/web-platform/tests/css/css-paint-api/parse-input-arguments-018.https.html @@ -22,11 +22,15 @@ should never be called. In other words, there should be no red painted in the re <div id="canvas-geometry" class="container"></div> <script id="code" type="text/worklet"> -function generateRandString(length) { - var text = ""; - var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - for (var i = 0; i < length; i++) - text += possible.charAt(Math.floor(Math.random() * possible.length)); +function generateRandomIdentifier(length) { + const firstChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + const nthChars = firstChars + "0123456789"; + // Pick a letter for the first character so that the string is a valid + // identifier. + var text = firstChars.charAt(Math.floor(Math.random() * firstChars.length)); + for (var i = 0; i < length - 1; i++) { + text += nthChars.charAt(Math.floor(Math.random() * nthChars.length)); + } return text; } @@ -39,7 +43,7 @@ try { // the input properties here. We make the string length 100 to make sure // that it is veryyyyyyyyyyyy unlikely that two strings will be the same // when running this test. - var current_str = generateRandString(100); + var current_str = generateRandomIdentifier(100); return [current_str]; } // The paint function here should never be called because the inputArguments |