[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:07:14 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 0f5ad84b178a82579d9404f29033a718c0848bba
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 1 16:19:23 2009 +0000

    2009-12-01  Eric Z. Ayers  <zundel at google.com>
    
            Reviewed by Pavel Feldman.
    
            Adds test for Timeline network resource records.
    
            https://bugs.webkit.org/show_bug.cgi?id=31378
    
            * inspector/timeline-network-resource-expected.txt: Added.
            * inspector/timeline-network-resource.html: Added.
            * inspector/timeline-network-resource.js: Added.
            * inspector/timeline-test.js:
            (printTimelineRecords):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51539 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 95c13c6..0398781 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-01  Eric Z. Ayers  <zundel at google.com>
+
+        Reviewed by Pavel Feldman.
+
+        Adds test for Timeline network resource records.
+ 
+        https://bugs.webkit.org/show_bug.cgi?id=31378
+
+        * inspector/timeline-network-resource-expected.txt: Added.
+        * inspector/timeline-network-resource.html: Added.
+        * inspector/timeline-network-resource.js: Added.
+        * inspector/timeline-test.js:
+        (printTimelineRecords):
+
 2009-12-01  Chris Marrin  <cmarrin at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/LayoutTests/inspector/timeline-network-resource-expected.txt b/LayoutTests/inspector/timeline-network-resource-expected.txt
new file mode 100644
index 0000000..8bce236
--- /dev/null
+++ b/LayoutTests/inspector/timeline-network-resource-expected.txt
@@ -0,0 +1,31 @@
+Tests the Timeline API instrumentation of a network resource load
+
+
+ResourceSendRequest Properties:
++ startTime : * DEFINED *
++ data : {
++- identifier : * DEFINED *
++- url : * DEFINED *
++- requestMethod : GET
++- isMainResource : false
++ }
++ type : 12
+
+ResourceReceiveResponse Properties:
++ startTime : * DEFINED *
++ data : {
++- identifier : * DEFINED *
++- statusCode : 0
++- mimeType : application/x-javascript
++- expectedContentLength : 210
++ }
++ type : 13
+
+ResourceFinish Properties:
++ startTime : * DEFINED *
++ data : {
++- identifier : * DEFINED *
++- didFail : false
++ }
++ type : 14
+Script resource loaded
diff --git a/LayoutTests/inspector/timeline-network-resource.html b/LayoutTests/inspector/timeline-network-resource.html
new file mode 100644
index 0000000..ae46d2e
--- /dev/null
+++ b/LayoutTests/inspector/timeline-network-resource.html
@@ -0,0 +1,84 @@
+<html>
+<head>
+<script src="inspector-test.js"></script>
+<script src="timeline-test.js"></script>
+<script>
+
+var scriptUrl = "timeline-network-resource.js";
+
+function runAfterScriptIsEvaluated(continuation)
+{
+    function step()
+    {
+        if (!window.scriptEvaluated)
+            setTimeout(step, 100);
+        else
+            continuation();
+    }
+    setTimeout(step, 100);
+}
+
+function printRecord(record)
+{
+    output("");
+    printTimelineRecordProperties(record);
+}
+
+function printSend(record)
+{
+    printRecord(record);
+    window.resourceId = record.data.identifier;
+    if (record.data.url === undefined) 
+        output("* No 'url' property in record");
+    else if (record.data.url.indexOf(scriptUrl) === -1)
+        output("* Didn't find URL: " + scriptUrl);
+}
+
+function printReceive(record)
+{
+    printRecord(record);
+    if (window.resourceId !== record.data.identifier)
+        output("Didn't find matching resourceId: " + window.resourceId);
+    if (record.data.statusCode !== 0)
+        output("Response received status: " + record.data.statusCode);
+}
+
+function printFinish(record)
+{
+    printRecord(record);
+    if (window.resourceId !== record.data.identifier)
+        output("Didn't find matching resourceId: " + window.resourceId);
+    if (record.data.didFail)
+        output("Request failed.");
+}
+
+function doit() 
+{
+    if (window.layoutTestController)
+        layoutTestController.setTimelineProfilingEnabled(true);
+
+    var script = document.createElement("script");
+    script.src = scriptUrl;
+    document.body.appendChild(script);
+    runAfterScriptIsEvaluated(function() {
+        printTimelineRecords(null, null, function(record) {
+            if (record.type === timelineAgentRecordType["ResourceSendRequest"])
+                printSend(record);
+     
+            else if (record.type === timelineAgentRecordType["ResourceReceiveResponse"])
+                printReceive(record);
+            else if (record.type === timelineAgentRecordType["ResourceFinish"])
+                printFinish(record);
+        });
+    });
+}
+
+</script>
+</head>
+
+<body onload="onload()">
+<p>
+Tests the Timeline API instrumentation of a network resource load
+</p>
+</body>
+</html>
diff --git a/LayoutTests/inspector/timeline-network-resource.js b/LayoutTests/inspector/timeline-network-resource.js
new file mode 100644
index 0000000..6fe0d18
--- /dev/null
+++ b/LayoutTests/inspector/timeline-network-resource.js
@@ -0,0 +1,6 @@
+// Sample script resource to find in timeline data
+
+var element = document.createElement("div");
+element.innerHTML = "Script resource loaded";
+document.body.appendChild(element);
+window.scriptEvaluated = true;
diff --git a/LayoutTests/inspector/timeline-test.js b/LayoutTests/inspector/timeline-test.js
index 45bcadc..bf159ce 100644
--- a/LayoutTests/inspector/timeline-test.js
+++ b/LayoutTests/inspector/timeline-test.js
@@ -5,6 +5,7 @@ var timelineNonDeterministicProps = {
     children : 1,
     endTime : 1, 
     height : 1,
+    identifier : 1,
     startTime : 1,
     width : 1,
     url : 1
@@ -27,10 +28,11 @@ function printTimelineRecords(performActions, typeName, formatter)
             output("Error fetching Timeline results: " + timelineRecords);
         else {
             for (var i = 0; i < timelineRecords.length; ++i) {
-                if (typeName && timelineRecords[i].type === timelineAgentRecordType[typeName])
-                    printTimelineRecordProperties(timelineRecords[i]);
+                var record = timelineRecords[i];
+                if (typeName && record.type === timelineAgentRecordType[typeName])
+                    printTimelineRecordProperties(record);
                 if (formatter)
-                    formatter(timelineRecords[i]);
+                    formatter(record);
             }
         }
         if (window.layoutTestController)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list