Commit 3fcd47cf authored by Pavel Feldman's avatar Pavel Feldman Committed by Commit Bot

Unflake http/tests/devtools/oopif/oopif-cookies-refresh.js

Change-Id: I00e8c2f3a14e6adec6a85ccff2d68adcf41f1d6a
Reviewed-on: https://chromium-review.googlesource.com/953964Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541694}
parent b60fec24
...@@ -43,11 +43,14 @@ ElementsTestRunner.findNode = async function(matchFunction, callback) { ...@@ -43,11 +43,14 @@ ElementsTestRunner.findNode = async function(matchFunction, callback) {
callback = TestRunner.safeWrap(callback); callback = TestRunner.safeWrap(callback);
let result = null; let result = null;
let pendingRequests = 0; let pendingRequests = 0;
function processChildren(node) { async function processChildren(node) {
try { try {
if (result) if (result)
return; return;
if (node._childDocumentPromiseForTesting)
await node._childDocumentPromiseForTesting;
const pseudoElementsMap = node.pseudoElements(); const pseudoElementsMap = node.pseudoElements();
const pseudoElements = pseudoElementsMap ? pseudoElementsMap.valuesArray() : []; const pseudoElements = pseudoElementsMap ? pseudoElementsMap.valuesArray() : [];
const children = (node.children() || []).concat(node.shadowRoots()).concat(pseudoElements); const children = (node.children() || []).concat(node.shadowRoots()).concat(pseudoElements);
......
...@@ -119,7 +119,7 @@ SDK.DOMNode = class { ...@@ -119,7 +119,7 @@ SDK.DOMNode = class {
const childTarget = SDK.targetManager.targetById(payload.frameId); const childTarget = SDK.targetManager.targetById(payload.frameId);
const childModel = childTarget ? childTarget.model(SDK.DOMModel) : null; const childModel = childTarget ? childTarget.model(SDK.DOMModel) : null;
if (childModel) if (childModel)
childModel.requestDocument(); this._childDocumentPromiseForTesting = childModel.requestDocument();
this._children = []; this._children = [];
} }
...@@ -1346,8 +1346,9 @@ SDK.DOMModel = class extends SDK.SDKModel { ...@@ -1346,8 +1346,9 @@ SDK.DOMModel = class extends SDK.SDKModel {
_documentUpdated() { _documentUpdated() {
// If we have this._pendingDocumentRequestPromise in flight, // If we have this._pendingDocumentRequestPromise in flight,
// if it hits backend post document update, it will contain most recent result. // if it hits backend post document update, it will contain most recent result.
const documentWasRequested = this._document || this._pendingDocumentRequestPromise;
this._setDocument(null); this._setDocument(null);
if (this.parentModel()) if (this.parentModel() && documentWasRequested)
this.requestDocument(); this.requestDocument();
} }
......
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