Web Inspector: didMarkDOMContentEvent() should send event of MarkDOMContent type.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 13:32:24 +0000 (13:32 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 13:32:24 +0000 (13:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=67528

Reviewed by Pavel Feldman.

Source/WebCore:

Tests: inspector/timeline/timeline-dom-content-loaded-event.html
       inspector/timeline/timeline-load-event.html

* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):

LayoutTests:

* inspector/timeline/timeline-animation-frame.html:
* inspector/timeline/timeline-dom-content-loaded-event-expected.txt: Added.
* inspector/timeline/timeline-dom-content-loaded-event.html: Added.
* inspector/timeline/timeline-load-event-expected.txt: Added.
* inspector/timeline/timeline-load-event.html: Added.
* inspector/timeline/timeline-test.js:
(initialize_Timeline.InspectorTest.waitForRecordType.addRecord):
(initialize_Timeline.InspectorTest.waitForRecordType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95410 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/timeline/timeline-animation-frame.html
LayoutTests/inspector/timeline/timeline-dom-content-loaded-event-expected.txt [new file with mode: 0644]
LayoutTests/inspector/timeline/timeline-dom-content-loaded-event.html [new file with mode: 0644]
LayoutTests/inspector/timeline/timeline-load-event-expected.txt [new file with mode: 0644]
LayoutTests/inspector/timeline/timeline-load-event.html [new file with mode: 0644]
LayoutTests/inspector/timeline/timeline-test.js
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorTimelineAgent.cpp

index 10582548e8e60702bcb0f91d586ec0eadaad9e02..38b5c3f6f2c3f50beb71e947a0f2299cd412c724 100644 (file)
@@ -1,3 +1,19 @@
+2011-09-19  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: didMarkDOMContentEvent() should send event of MarkDOMContent type.
+        https://bugs.webkit.org/show_bug.cgi?id=67528
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/timeline/timeline-animation-frame.html:
+        * inspector/timeline/timeline-dom-content-loaded-event-expected.txt: Added.
+        * inspector/timeline/timeline-dom-content-loaded-event.html: Added.
+        * inspector/timeline/timeline-load-event-expected.txt: Added.
+        * inspector/timeline/timeline-load-event.html: Added.
+        * inspector/timeline/timeline-test.js:
+        (initialize_Timeline.InspectorTest.waitForRecordType.addRecord):
+        (initialize_Timeline.InspectorTest.waitForRecordType):
+
 2011-09-19  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt] Unreviewed gardening.
index 5fdf3dbc0513d7418d557064923934c571b117ae..feeb22ce9df579f0bcd7937e4aa2bac208ad02e3 100644 (file)
@@ -23,18 +23,10 @@ function test()
         InspectorTest.evaluateInPage("performActions()");
     });
 
-    WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, function(event) {
-        addRecord(event.data);
-    });
+    InspectorTest.waitForRecordType("CancelAnimationFrameCallback", finish);
 
-    function addRecord(record)
+    function finish()
     {
-        if (record.type !== WebInspector.TimelineAgent.RecordType["CancelAnimationFrameCallback"]) {
-            for (var i = 0; record.children && i < record.children.length; ++i)
-                addRecord(record.children[i]);
-            return ;
-        }
-
         InspectorTest.printTimelineRecords("RegisterAnimationFrameCallback");
         InspectorTest.printTimelineRecords("FireAnimationFrameEvent");
         InspectorTest.printTimelineRecords("CancelAnimationFrameCallback");
diff --git a/LayoutTests/inspector/timeline/timeline-dom-content-loaded-event-expected.txt b/LayoutTests/inspector/timeline/timeline-dom-content-loaded-event-expected.txt
new file mode 100644 (file)
index 0000000..6ea7dea
--- /dev/null
@@ -0,0 +1,12 @@
+Tests the DOM content loaded event.
+
+MarkDOMContent Properties:
+{
+    startTime : <number>
+    data : {
+    }
+    type : "MarkDOMContent"
+    usedHeapSize : <number>
+    totalHeapSize : <number>
+}
+
diff --git a/LayoutTests/inspector/timeline/timeline-dom-content-loaded-event.html b/LayoutTests/inspector/timeline/timeline-dom-content-loaded-event.html
new file mode 100644 (file)
index 0000000..0cf3172
--- /dev/null
@@ -0,0 +1,29 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="timeline-test.js"></script>
+<script>
+
+function test()
+{
+    WebInspector.showPanel("timeline");
+
+    InspectorTest.startTimeline(function() { InspectorTest.reloadPage(); });
+    InspectorTest.waitForRecordType("MarkDOMContent", finish);
+    function finish()
+    {
+        InspectorTest.printTimelineRecords("MarkDOMContent");
+        InspectorTest.completeTest();
+    }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests the DOM content loaded event.
+</p>
+
+</body>
+</html>
diff --git a/LayoutTests/inspector/timeline/timeline-load-event-expected.txt b/LayoutTests/inspector/timeline/timeline-load-event-expected.txt
new file mode 100644 (file)
index 0000000..fc79756
--- /dev/null
@@ -0,0 +1,12 @@
+Tests the load event.
+
+MarkLoad Properties:
+{
+    startTime : <number>
+    data : {
+    }
+    type : "MarkLoad"
+    usedHeapSize : <number>
+    totalHeapSize : <number>
+}
+
diff --git a/LayoutTests/inspector/timeline/timeline-load-event.html b/LayoutTests/inspector/timeline/timeline-load-event.html
new file mode 100644 (file)
index 0000000..106020f
--- /dev/null
@@ -0,0 +1,29 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="timeline-test.js"></script>
+<script>
+
+function test()
+{
+    WebInspector.showPanel("timeline");
+
+    InspectorTest.startTimeline(function() { InspectorTest.reloadPage(); });
+    InspectorTest.waitForRecordType("MarkLoad", finish);
+    function finish()
+    {
+        InspectorTest.printTimelineRecords("MarkLoad");
+        InspectorTest.completeTest();
+    }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests the load event.
+</p>
+
+</body>
+</html>
index d20a54a27955c8b081846128c7f82cd46f333f34..2fc237ee3418b0671def0c110b684b1ecde4ffd9 100644 (file)
@@ -32,6 +32,24 @@ InspectorTest.startTimeline = function(callback)
     });
 };
 
+
+InspectorTest.waitForRecordType = function(recordType, callback)
+{
+    WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, function(event) {
+            addRecord(event.data);
+    });
+
+    function addRecord(record)
+    {
+        if (record.type !== WebInspector.TimelineAgent.RecordType[recordType]) {
+            for (var i = 0; record.children && i < record.children.length; ++i)
+                addRecord(record.children[i]);
+            return ;
+        }
+        callback(record);
+    }
+}
+
 InspectorTest.stopTimeline = function(callback)
 {
     function didStop()
index 609075ec371af772925856e1c36ce4fe6b9ef8d6..9ffa036e4c8d53cb4938811df70ed9594b4bc6fb 100644 (file)
@@ -1,3 +1,16 @@
+2011-09-19  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: didMarkDOMContentEvent() should send event of MarkDOMContent type.
+        https://bugs.webkit.org/show_bug.cgi?id=67528
+
+        Reviewed by Pavel Feldman.
+
+        Tests: inspector/timeline/timeline-dom-content-loaded-event.html
+               inspector/timeline/timeline-load-event.html
+
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
+
 2011-09-19  Shawn Singh  <shawnsingh@chromium.org>
 
         Re-name LayerChromium border functions to reflect that
index 861df149ed3923367f95327e453b0f4ebc0f24ec..dd2936a288e15cbe05bb4072463900316d6dba8d 100644 (file)
@@ -336,7 +336,7 @@ void InspectorTimelineAgent::didTimeStamp(const String& message)
 
 void InspectorTimelineAgent::didMarkDOMContentEvent()
 {
-    appendRecord(InspectorObject::create(), TimelineRecordType::TimeStamp);
+    appendRecord(InspectorObject::create(), TimelineRecordType::MarkDOMContent);
 }
 
 void InspectorTimelineAgent::didMarkLoadEvent()