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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images.html

Issue 2592113003: Load data URI images in an async way according to spec (take 3) (Closed)
Patch Set: Fixed more devtools reliance on sync loading Created 3 years, 12 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/http/tests/inspector/network/waterfall-images.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images.html b/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images.html
index 8eb0f946d9c7fed702adeb85a480ff1468e2a361..eb029afc69068abfd1c5554575095641b24bdc91 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images.html
@@ -5,19 +5,20 @@
<script>
// TODO(allada) Move much of this canvas code to a canvas-test.js file.
var images = [];
-var sumWidth = 0;
-var maxHeight = 0;
function receiveImage(imageUrl) {
var image = new Image();
image.src = imageUrl;
images.push(image);
-
- sumWidth += image.width;
- maxHeight = Math.max(image.height, maxHeight);
}
function done() {
+ var sumWidth = 0;
+ var maxHeight = 0;
+ for (var image of images) {
+ sumWidth += image.width;
+ maxHeight = Math.max(image.height, maxHeight);
+ }
var canvas = document.getElementById("outputCanvas");
canvas.height = maxHeight;
canvas.width = sumWidth;
@@ -268,15 +269,15 @@ function test()
if (numDraws > 2)
return;
if (numDraws === 2) {
- sendData(waterfall._canvas, true);
+ sendData(true);
return;
}
- sendData(waterfall._canvas, false);
+ sendData(false);
// This makes sure we test both old bars and new bars with same data.
Common.moduleSetting('networkColorCodeResourceTypes').set(true);
}
- function sendData(canvas, done) {
+ function sendData(done) {
var imageData = waterfall._canvas.toDataURL();
var height = waterfall._canvas.height;
var width = waterfall._canvas.width;

Powered by Google App Engine
This is Rietveld 408576698