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

Unified Diff: third_party/WebKit/PerformanceTests/Parser/html-parser-threaded.html

Issue 2858783003: Refactor prepareToMeasureValuesAsync to startMeasureValuesAsyn which run test through callback (Closed)
Patch Set: update Created 3 years, 8 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/PerformanceTests/Parser/html-parser-threaded.html
diff --git a/third_party/WebKit/PerformanceTests/Parser/html-parser-threaded.html b/third_party/WebKit/PerformanceTests/Parser/html-parser-threaded.html
index 6b7fe88d1662650056b61b5677306e968abbded4..9dcf7479cacecf9f9cbff1113cac081a3a090fb1 100644
--- a/third_party/WebKit/PerformanceTests/Parser/html-parser-threaded.html
+++ b/third_party/WebKit/PerformanceTests/Parser/html-parser-threaded.html
@@ -9,26 +9,29 @@ iframe.style.display = "none"; // Prevent creation of the rendering tree, so we
iframe.sandbox = ''; // Prevent external script loads which could cause write() to return before completing the parse.
document.body.appendChild(iframe);
-PerfTestRunner.prepareToMeasureValuesAsync({
- description: "Measures performance of the threaded HTML parser (if available).",
- done: onCompletedRun,
- unit: 'ms'
-});
-
-iframe.onload = function() {
- var now = PerfTestRunner.now();
- PerfTestRunner.measureValueAsync(now - then);
- then = now;
- iframe.src = specURL;
-}
-var then = PerfTestRunner.now();
-iframe.src = specURL;
-
function onCompletedRun() {
iframe.onload = null;
// FIXME: This should probably remove the iframe, but that currently
// causes the threaded-parser to never send the load event for the main page.
// document.body.removeChild(iframe);
}
+
+
+PerfTestRunner.prepareToMeasureValuesAsync({
+ description: "Measures performance of the threaded HTML parser (if available).",
+ done: onCompletedRun,
+ unit: 'ms',
+ run: function() {
+ iframe.onload = function() {
+ var now = PerfTestRunner.now();
+ PerfTestRunner.measureValueAsync(now - then);
+ then = now;
+ iframe.src = specURL;
+ }
+ var then = PerfTestRunner.now();
+ iframe.src = specURL;
+ }
+});
+
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698