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

Unified Diff: LayoutTests/virtual/implsidepainting/inspector/timeline/tracing/paint-command-log-nodes.html

Issue 477153005: DevTools: adopt existing Timeline tests for tracing based Timeline (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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: LayoutTests/virtual/implsidepainting/inspector/timeline/tracing/paint-command-log-nodes.html
diff --git a/LayoutTests/virtual/implsidepainting/inspector/timeline/tracing/paint-command-log-nodes.html b/LayoutTests/virtual/implsidepainting/inspector/timeline/tracing/paint-command-log-nodes.html
deleted file mode 100644
index a996230c067e7afc05864f3a70f4cdf286b613d2..0000000000000000000000000000000000000000
--- a/LayoutTests/virtual/implsidepainting/inspector/timeline/tracing/paint-command-log-nodes.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<html>
-<head>
-<style>
-</style>
-<script src="../../../../../http/tests/inspector/inspector-test.js"></script>
-<script src="../../../../../http/tests/inspector/timeline-test.js"></script>
-<script src="../../../../../inspector/tracing-test.js"></script>
-<script>
-
-function doActions(callback)
-{
- document.getElementById("a").style.visibility = "visible";
- requestAnimationFrame(function() {
- testRunner.displayAsyncThen(callback);
- });
-}
-
-function test()
-{
- var imageCount = 0;
-
- InspectorTest.invokeWithTracing("doActions", onTracingComplete, "disabled-by-default-blink.graphics_context_annotations");
-
- var inFlightPictures = 0;
- function onTracingComplete()
- {
- var events = InspectorTest.tracingTimelineModel.inspectedTargetEvents();
- for (var i = 0; i < events.length; ++i) {
- var event = events[i];
- if (event.name !== WebInspector.TracingTimelineModel.RecordType.Paint)
- continue;
- if (!event.picture)
- continue;
- ++inFlightPictures;
- processPicture(event.picture);
- }
- if (!inFlightPictures)
- InspectorTest.completeTest();
- }
-
- function processPicture(picture)
- {
- WebInspector.PaintProfilerSnapshot.load(WebInspector.targetManager.targets()[0], picture, onSnapshotLoaded);
- }
-
- function onSnapshotLoaded(snapshot)
- {
- snapshot.commandLog(onGotLog);
- }
-
- function onGotLog(log)
- {
- var seenNodes = {};
- for (var i = 0; i < log.length; ++i) {
- if (!log[i].annotations)
- continue;
- var nodeId = Number(log[i].annotations["INSPECTOR_ID"]);
- if (nodeId)
- seenNodes[nodeId] = true;
- }
- var requestedNodes = Object.keys(seenNodes).map(function(value) { return Number(value); });
- var domModel = WebInspector.targetManager.mainTarget().domModel;
- WebInspector.targetManager.mainTarget().domModel.pushNodesByBackendIdsToFrontend(requestedNodes, onNodesResolved.bind(this, log, requestedNodes));
- }
-
- function onNodesResolved(log, requestedNodes, resolvedNodes)
- {
- InspectorTest.assertEquals(requestedNodes.length, resolvedNodes.length);
- var nodeMap = {};
- var domModel = WebInspector.targetManager.mainTarget().domModel;
- for (var i = 0; i < requestedNodes.length; ++i) {
- if (resolvedNodes[i])
- nodeMap[requestedNodes[i]] = domModel.nodeForId(resolvedNodes[i]);
- }
- InspectorTest.addResult("Paint command log:");
- for (var i = 0; i < log.length; ++i) {
- if (!log[i].annotations)
- continue;
- if (!/^draw/.test(log[i].method))
- continue;
- var nodeId = Number(log[i].annotations["INSPECTOR_ID"]);
- if (!nodeId)
- continue;
- InspectorTest.addResult(" " + WebInspector.DOMPresentationUtils.simpleSelector(nodeMap[nodeId]) + " " + log[i].method);
- }
- if (!--inFlightPictures)
- InspectorTest.completeTest();
- }
-
-}
-
-</script>
-</head>
-
-<body onload="runTestAfterDisplay()">
-<p>
-Tests snapshot command log for trace-based Timeline paint event
-</p>
-<div id="a" style="visibility:hidden; -webkit-transform: translateZ(0px); background-color:blue; width:100px; height:100px;">
- <div id="b" style="width:50px; height:50px; background-color:red;"></div>
- <img id="c" src="../timeline/resources/test.png">
- <svg id="d">
- <rect id="e" x="0" y="0" width="10" height="10" style="opacity:0.5"/>
- </svg>
-</div>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698