Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / profiler / heap-snapshot-inspect-dom-wrapper.html
index ea6c6e4..35ad658 100644 (file)
@@ -14,8 +14,7 @@ function handleLoad()
 function test()
 {
     WebInspector.showPanel("profiles");
-    WebInspector.panels.profiles._createTemporaryProfile("HEAP");
-    var heapProfileType =  WebInspector.panels.profiles.getProfileType("HEAP");
+    var heapProfileType =  WebInspector.ProfileTypeRegistry.instance.heapSnapshotProfileType;
     heapProfileType.addEventListener(WebInspector.HeapSnapshotProfileType.SnapshotReceived, finishHeapSnapshot);
     InspectorTest.addSniffer(heapProfileType, "_snapshotReceived", snapshotReceived);
     heapProfileType._takeHeapSnapshot(function() {});
@@ -32,21 +31,18 @@ function test()
             return clear("FAILED: wrong number of recorded profiles was found. profiles.length = " + profiles.length);
 
         var profile = profiles[profiles.length - 1];
-        WebInspector.panels.profiles._showProfile(profile);
+        WebInspector.panels.profiles.showProfile(profile);
     }
 
     function snapshotReceived(profile)
     {
         InspectorTest.addResult("PASS: snapshot was received");
         var snapshotProxy = profile._snapshotProxy;
-        var snapshot = snapshotProxy._worker._worker._dispatcher._objects[snapshotProxy._objectId];
-
-        var bodyWrapperIds = [];
-        for (var it = snapshot._allNodes(); it.hasNext(); it.next()) {
-            if (it.item().name() === "HTMLBodyElement")
-                bodyWrapperIds.push(it.item().id());
-        }
+        snapshotProxy.callMethod(didGetBodyWrapperIds, "idsOfObjectsWithName", "HTMLBodyElement");
+    }
 
+    function didGetBodyWrapperIds(bodyWrapperIds)
+    {
         if (bodyWrapperIds.length < 3)
             return clear("FAILED: less than 3 HTMLBodyElement objects were detected");
 
@@ -92,7 +88,7 @@ function test()
     {
         if (errorMessage)
             InspectorTest.addResult(errorMessage);
-        HeapProfilerAgent.clearProfiles(done);
+        setTimeout(done, 0);
         WebInspector.panels.profiles._reset();
         return !errorMessage;
     }