Commit c6b3953d authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Fix test inspector-protocol/stylesheet-tracking-restart.html flakiness

The flakiness is caused by unpredictable order of stylesheets binding in InspectorCSSAgent.
This patch replaces HashSet with Vector to make sure the order is maintained.

R=lushnikov

Review URL: https://codereview.chromium.org/339133002

git-svn-id: svn://svn.chromium.org/blink/trunk@176301 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 241bb158
...@@ -1122,9 +1122,6 @@ crbug.com/384566 svg/custom/textPath-change-reference2.svg [ ImageOnlyFailure Pa ...@@ -1122,9 +1122,6 @@ crbug.com/384566 svg/custom/textPath-change-reference2.svg [ ImageOnlyFailure Pa
crbug.com/384396 [ Win ] battery-status/page-visibility.html [ Pass Failure Timeout ] crbug.com/384396 [ Win ] battery-status/page-visibility.html [ Pass Failure Timeout ]
# Made substantially flakier in r176213
crbug.com/354447 inspector-protocol/stylesheet-tracking-restart.html [ Pass Failure Timeout ]
Bug(eae) fast/text/justify-ideograph-complex.html [ NeedsRebaseline ] Bug(eae) fast/text/justify-ideograph-complex.html [ NeedsRebaseline ]
Bug(eae) fast/text/justify-ideograph-simple.html [ NeedsRebaseline ] Bug(eae) fast/text/justify-ideograph-simple.html [ NeedsRebaseline ]
Bug(eae) media/track/track-cue-rendering-vertical.html [ NeedsRebaseline ] Bug(eae) media/track/track-cue-rendering-vertical.html [ NeedsRebaseline ]
......
...@@ -517,16 +517,15 @@ void InspectorCSSAgent::setActiveStyleSheets(Document* document, const Vector<CS ...@@ -517,16 +517,15 @@ void InspectorCSSAgent::setActiveStyleSheets(Document* document, const Vector<CS
} }
HashSet<CSSStyleSheet*> removedSheets(*documentCSSStyleSheets); HashSet<CSSStyleSheet*> removedSheets(*documentCSSStyleSheets);
Vector<CSSStyleSheet*> addedSheets;
HashSet<CSSStyleSheet*> addedSheets;
for (Vector<CSSStyleSheet*>::const_iterator it = allSheetsVector.begin(); it != allSheetsVector.end(); ++it) { for (Vector<CSSStyleSheet*>::const_iterator it = allSheetsVector.begin(); it != allSheetsVector.end(); ++it) {
CSSStyleSheet* cssStyleSheet = *it; CSSStyleSheet* cssStyleSheet = *it;
if (removedSheets.contains(cssStyleSheet)) { if (removedSheets.contains(cssStyleSheet)) {
removedSheets.remove(cssStyleSheet); removedSheets.remove(cssStyleSheet);
if (isInitialFrontendLoad) if (isInitialFrontendLoad)
addedSheets.add(cssStyleSheet); addedSheets.append(cssStyleSheet);
} else { } else {
addedSheets.add(cssStyleSheet); addedSheets.append(cssStyleSheet);
} }
} }
...@@ -543,7 +542,7 @@ void InspectorCSSAgent::setActiveStyleSheets(Document* document, const Vector<CS ...@@ -543,7 +542,7 @@ void InspectorCSSAgent::setActiveStyleSheets(Document* document, const Vector<CS
} }
} }
for (HashSet<CSSStyleSheet*>::iterator it = addedSheets.begin(); it != addedSheets.end(); ++it) { for (Vector<CSSStyleSheet*>::iterator it = addedSheets.begin(); it != addedSheets.end(); ++it) {
CSSStyleSheet* cssStyleSheet = *it; CSSStyleSheet* cssStyleSheet = *it;
bool isNew = isInitialFrontendLoad || !m_cssStyleSheetToInspectorStyleSheet.contains(cssStyleSheet); bool isNew = isInitialFrontendLoad || !m_cssStyleSheetToInspectorStyleSheet.contains(cssStyleSheet);
if (isNew) { if (isNew) {
......
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