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

Unified Diff: LayoutTests/inspector/timeline/tracing/decode-resize.html

Issue 308123008: DevTools: added support for image url & node in tracing-based timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: skip check for presence of endData in Layout Created 6 years, 7 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
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/tracing/decode-resize-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/timeline/tracing/decode-resize.html
diff --git a/LayoutTests/inspector/timeline/tracing/decode-resize.html b/LayoutTests/inspector/timeline/tracing/decode-resize.html
new file mode 100644
index 0000000000000000000000000000000000000000..81333bf39c5278426420bc64d1e2e9cd057d9ff3
--- /dev/null
+++ b/LayoutTests/inspector/timeline/tracing/decode-resize.html
@@ -0,0 +1,87 @@
+<html>
+<head>
+<style>
+div#img-container {
+ position: relative;
+ width: 99px;
+ height: 99px;
+ overflow: clip;
+}
+</style>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../../http/tests/inspector/timeline-test.js"></script>
+<script src="../../tracing-test.js"></script>
+<script>
+
+var images = [
+ ["../resources/test.bmp", "25", "25"],
+ ["../resources/test.gif", "25", "25"],
+ ["../resources/test.ico", "25", "25"],
+ ["../resources/test.jpg", "25", "25"],
+ ["../resources/test.png", "25", "25"],
+ ["../resources/test.webp", "25", "25"],
+ ["../resources/big.png", "150", "150"]
+];
+
+function showImages(callback)
+{
+ var nextImageIndex = 0;
+ var imgElement = document.getElementById("img-container").firstElementChild;
+
+ imgElement.addEventListener("load", imageLoaded);
+ addImages();
+
+ function addImages()
+ {
+ if (nextImageIndex >= images.length) {
+ imgElement.removeEventListener("load", imageLoaded);
+ callback();
+ return;
+ }
+
+ var image = images[nextImageIndex++];
+
+ imgElement.width = image[1];
+ imgElement.height = image[2];
+ imgElement.src = image[0];
+ }
+
+ function imageLoaded()
+ {
+ requestAnimationFrame(function() { testRunner.displayAsyncThen(addImages); } );
+ }
+}
+
+
+function test()
+{
+ var imageCount = 0;
+
+ InspectorTest.invokeWithTracing("-*,devtools,disabled-by-default-devtools.timeline*", "showImages", onTracingComplete);
+ function onTracingComplete()
+ {
+ var traceEventBindings = new WebInspector.TimelineTraceEventBindings();
+ var events = InspectorTest.tracingModel.inspectedTargetEvents();
+ traceEventBindings.setEvents(events);
+ for (var i = 0; i < events.length; ++i) {
+ var event = events[i];
+ if (events[i].name !== WebInspector.TimelineTraceEventBindings.RecordType.DecodeImage)
+ continue;
+ InspectorTest.addResult("event: " + event.name);
+ InspectorTest.addResult("imageURL: " + InspectorTest.formatters.formatAsURL(event.imageURL));
+ InspectorTest.addResult("backendNodeId: " + (event.backendNodeId > 0 ? "present" : "absent"));
+ }
+ InspectorTest.completeTest();
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests the instrumentation of a DecodeImage and ResizeImage events
+</p>
+<div id="img-container"><img></div>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/tracing/decode-resize-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698