Commit 0d23e678 authored by Alex Rudenko's avatar Alex Rudenko Committed by Commit Bot

Fix flakiness in http/tests/devtools/elements/styles-1/dynamic-style-tag.js

The order in which stylesheets are added can be arbitrary. This CL
sorts stylesheets by the content to avoid flakiness.

Fixed: 1104260
Change-Id: I4b57e588374bc14ae3d6dd1ee8f5644e12eac093
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299719Reviewed-by: default avatarMathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788544}
parent 4a55c5ad
...@@ -6858,7 +6858,6 @@ crbug.com/1104910 [ Mac ] external/wpt/webaudio/the-audio-api/the-oscillatornode ...@@ -6858,7 +6858,6 @@ crbug.com/1104910 [ Mac ] external/wpt/webaudio/the-audio-api/the-oscillatornode
crbug.com/1104910 fast/dom/cssTarget-crash.html [ Pass Timeout Failure ] crbug.com/1104910 fast/dom/cssTarget-crash.html [ Pass Timeout Failure ]
crbug.com/1104910 fast/peerconnection/RTCPeerConnection-reload-interesting-usage.html [ Pass Failure ] crbug.com/1104910 fast/peerconnection/RTCPeerConnection-reload-interesting-usage.html [ Pass Failure ]
crbug.com/1104910 [ Win ] virtual/cache-storage-eager-reading/external/wpt/service-workers/service-worker/registration-updateviacache.https.html [ Pass Failure ] crbug.com/1104910 [ Win ] virtual/cache-storage-eager-reading/external/wpt/service-workers/service-worker/registration-updateviacache.https.html [ Pass Failure ]
crbug.com/1104910 [ Win ] http/tests/devtools/elements/styles-1/dynamic-style-tag.js [ Pass Failure ]
crbug.com/1104910 [ Mac10.15 ] editing/selection/selection-background.html [ Pass Failure ] crbug.com/1104910 [ Mac10.15 ] editing/selection/selection-background.html [ Pass Failure ]
crbug.com/1104910 [ Linux ] external/wpt/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-classic.http.html [ Pass Failure ] crbug.com/1104910 [ Linux ] external/wpt/referrer-policy/gen/worker-module.http-rp/unsafe-url/worker-classic.http.html [ Pass Failure ]
crbug.com/1104910 [ Linux ] external/wpt/referrer-policy/gen/worker-module.http-rp/unset/worker-module.http.html [ Pass Failure ] crbug.com/1104910 [ Linux ] external/wpt/referrer-policy/gen/worker-module.http-rp/unset/worker-module.http.html [ Pass Failure ]
......
Tests that different types of inline styles are correctly disambiguated and their sourceURL is correct. Tests that different types of inline styles are correctly disambiguated and their sourceURL is correct.
Stylesheet added:
- isInline: false
- sourceURL: inlineStyleAddedByDocumentWrite.css
- hasSourceURL: true
- contents:
.inline-style-added-by-document-write-with-source-url {
color: yellow;
}
/*# sourceURL=inlineStyleAddedByDocumentWrite.css*/
Stylesheet added: Stylesheet added:
- isInline: false - isInline: false
- sourceURL: - sourceURL:
...@@ -10,12 +20,15 @@ Stylesheet added: ...@@ -10,12 +20,15 @@ Stylesheet added:
} }
Stylesheet added: Stylesheet added:
- isInline: false - isInline: true
- sourceURL: - sourceURL: inlineStyleAddedByParser.css
- hasSourceURL: false - hasSourceURL: true
- contents: .inline-style-created-by-script { - contents:
color: orange; .inline-style-added-by-parser-with-source-url {
color: green;
} }
/*# sourceURL=inlineStyleAddedByParser.css*/
Stylesheet added: Stylesheet added:
- isInline: true - isInline: true
- sourceURL: dynamic-style-tag.html - sourceURL: dynamic-style-tag.html
...@@ -27,24 +40,11 @@ Stylesheet added: ...@@ -27,24 +40,11 @@ Stylesheet added:
Stylesheet added: Stylesheet added:
- isInline: false - isInline: false
- sourceURL: inlineStyleAddedByDocumentWrite.css - sourceURL:
- hasSourceURL: true - hasSourceURL: false
- contents: - contents: .inline-style-created-by-script {
.inline-style-added-by-document-write-with-source-url { color: orange;
color: yellow;
}
/*# sourceURL=inlineStyleAddedByDocumentWrite.css*/
Stylesheet added:
- isInline: true
- sourceURL: inlineStyleAddedByParser.css
- hasSourceURL: true
- contents:
.inline-style-added-by-parser-with-source-url {
color: green;
} }
/*# sourceURL=inlineStyleAddedByParser.css*/
Stylesheet added: Stylesheet added:
- isInline: false - isInline: false
- sourceURL: inlineStyleCreatedByScript.css - sourceURL: inlineStyleCreatedByScript.css
......
...@@ -12,11 +12,16 @@ ...@@ -12,11 +12,16 @@
ElementsTestRunner.selectNodeAndWaitForStyles('inspected', step1); ElementsTestRunner.selectNodeAndWaitForStyles('inspected', step1);
async function step1() { async function step1() {
var styleSheets = TestRunner.cssModel.allStyleSheets(); const styleSheets = TestRunner.cssModel.allStyleSheets();
styleSheets.sort(); const styleSheetsWithContent = [];
for (var header of styleSheets) { for (const header of styleSheets) {
var content = await TestRunner.CSSAgent.getStyleSheetText(header.id); styleSheetsWithContent.push({
header,
content: await TestRunner.CSSAgent.getStyleSheetText(header.id),
});
}
styleSheetsWithContent.sort((a, b) => a.content.localeCompare(b.content));
for (const {header, content} of styleSheetsWithContent) {
TestRunner.addResult('Stylesheet added:'); TestRunner.addResult('Stylesheet added:');
TestRunner.addResult(' - isInline: ' + header.isInline); TestRunner.addResult(' - isInline: ' + header.isInline);
TestRunner.addResult(' - sourceURL: ' + header.sourceURL.substring(header.sourceURL.lastIndexOf('/') + 1)); TestRunner.addResult(' - sourceURL: ' + header.sourceURL.substring(header.sourceURL.lastIndexOf('/') + 1));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment