Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/WebKit/LayoutTests/resources/js-test.js

Issue 1772853002: Block the HTML parser on external stylesheets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplified parser blocking logic Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/resources/js-test.js
diff --git a/third_party/WebKit/LayoutTests/resources/js-test.js b/third_party/WebKit/LayoutTests/resources/js-test.js
index d94f49b5a8af1e54bbd6284b97eadf2e163d6c50..06fe7606cdbdf9e7b16b316793f20a317fbc2a3d 100644
--- a/third_party/WebKit/LayoutTests/resources/js-test.js
+++ b/third_party/WebKit/LayoutTests/resources/js-test.js
@@ -44,17 +44,19 @@ var unexpectedErrorMessage; // set by onerror when expectingError is not true
description = function description(msg, quiet)
{
// For MSIE 6 compatibility
- var span = document.createElement("span");
+ var mgsHTML = '';
if (quiet)
- span.innerHTML = '<p>' + msg + '</p><p>On success, you will see no "<span class="fail">FAIL</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
+ mgsHTML = '<p>' + msg + '</p><p>On success, you will see no "<span class="fail">FAIL</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
else
- span.innerHTML = '<p>' + msg + '</p><p>On success, you will see a series of "<span class="pass">PASS</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
+ mgsHTML = '<p>' + msg + '</p><p>On success, you will see a series of "<span class="pass">PASS</span>" messages, followed by "<span class="pass">TEST COMPLETE</span>".</p>';
- if (_lazyTestResults) {
- _lazyDescription = span;
+ if (self._lazyTestResults) {
+ self._lazyDescription = mgsHTML;
return;
}
+ var span = document.createElement("span");
+ span.innerHTML = mgsHTML;
var description = getOrCreateTestElement("description", "p");
if (description.firstChild)
description.replaceChild(span, description.firstChild);
@@ -818,8 +820,13 @@ function finishJSTest()
return;
isSuccessfullyParsed();
- if (self._lazyDescription)
- getOrCreateTestElement("description", "p").appendChild(self._lazyDescription);
+ if (self._lazyDescription) {
+ var descriptionElement = getOrCreateTestElement("description", "p");
+ var span = document.createElement("span");
+ descriptionElement.appendChild(span);
+ span.innerHTML = self._lazyDescription;
+ self._lazyDescription = undefined;
+ }
if (self._lazyTestResults && self._lazyTestResults.length > 0) {
var consoleElement = getOrCreateTestElement("console", "div");
@@ -828,6 +835,7 @@ function finishJSTest()
consoleElement.appendChild(span);
span.innerHTML = msg + '<br />';
});
+ self._lazyTestResults = [];
}
if (self.jsTestIsAsync && self.testRunner)

Powered by Google App Engine
This is Rietveld 408576698