[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
eric at webkit.org
eric at webkit.org
Thu Dec 3 13:32:35 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit e009e3741d4f5653cb7ff93e6d3df699615bcd9e
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 11 19:51:11 2009 +0000
2009-11-11 Eric Z. Ayers <zundel at google.com>
Reviewed by Pavel Feldman.
Added a test of an externally loaded script tag for Inspector
timeline records.
Fixed identity comparisons.
https://bugs.webkit.org/show_bug.cgi?id=31365
* inspector/timeline-script-tag-1.html:
* inspector/timeline-script-tag-2-expected.txt: Added.
* inspector/timeline-script-tag-2.html: Added.
* inspector/timeline-script-tag-2.js: Added.
* inspector/timeline-test.js:
():
(timelineAgentTypeToString):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8bbe97d..f584cb6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2009-11-11 Eric Z. Ayers <zundel at google.com>
+
+ Reviewed by Pavel Feldman.
+
+ Added a test of an externally loaded script tag for Inspector
+ timeline records.
+ Fixed identity comparisons.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31365
+
+ * inspector/timeline-script-tag-1.html:
+ * inspector/timeline-script-tag-2-expected.txt: Added.
+ * inspector/timeline-script-tag-2.html: Added.
+ * inspector/timeline-script-tag-2.js: Added.
+ * inspector/timeline-test.js:
+ ():
+ (timelineAgentTypeToString):
+
2009-11-11 Antonio Gomes <tonikitoo at webkit.org>
Rubber-stamped by Kenneth Christiansen.
diff --git a/LayoutTests/inspector/timeline-script-tag-1.html b/LayoutTests/inspector/timeline-script-tag-1.html
index 9828f7f..f8ef7b7 100644
--- a/LayoutTests/inspector/timeline-script-tag-1.html
+++ b/LayoutTests/inspector/timeline-script-tag-1.html
@@ -10,8 +10,8 @@ function analyzeEvaluateScript(record)
var numChildren = record.children ? record.children.length : 0;
for (var i = 0; i < numChildren; ++i) {
var child = record.children[i];
- if (child.type == timelineAgentRecordType.MarkTimeline
- && child.data.message == timelineMark
+ if (child.type === timelineAgentRecordType.MarkTimeline
+ && child.data.message === timelineMark
&& record.data.url.indexOf("timeline-script-tag-1.html") !== -1) {
// Finish printing the record as a tree
@@ -32,7 +32,7 @@ function analyzeParseHTML(record)
var numChildren = record.children ? record.children.length : 0;
for (var i = 0; i < numChildren; ++i) {
var child = record.children[i];
- if (child.type == timelineAgentRecordType.EvaluateScript)
+ if (child.type === timelineAgentRecordType.EvaluateScript)
if (analyzeEvaluateScript(child))
return true;
}
@@ -50,7 +50,7 @@ function analyzeTimelineData(timelineRecords)
var numRecords = timelineRecords.length;
for (var i = 0 ; i < numRecords; ++i) {
var record = timelineRecords[i];
- if (record.type == timelineAgentRecordType.ParseHTML) {
+ if (record.type === timelineAgentRecordType.ParseHTML) {
// Uncomment to debug the ParseHTML data record
// dumpTimelineRecord(record, 0);
output("ParseHTML");
diff --git a/LayoutTests/inspector/timeline-script-tag-2-expected.txt b/LayoutTests/inspector/timeline-script-tag-2-expected.txt
new file mode 100644
index 0000000..1d21537
--- /dev/null
+++ b/LayoutTests/inspector/timeline-script-tag-2-expected.txt
@@ -0,0 +1,16 @@
+Tests the Timeline API instrumentation of a script tag with an external script.
+
+ParseHTML
+----> EvaluateScript
+--------> MarkTimeline : SCRIPT TAG
+
+EvaluateScript Properties:
++ startTime : * DEFINED *
++ data : {
++- url : * DEFINED *
++- lineNumber : 1
++ }
++ children : * DEFINED *
++ endTime : * DEFINED *
++ type : 10
+
diff --git a/LayoutTests/inspector/timeline-script-tag-2.html b/LayoutTests/inspector/timeline-script-tag-2.html
new file mode 100644
index 0000000..196b65f
--- /dev/null
+++ b/LayoutTests/inspector/timeline-script-tag-2.html
@@ -0,0 +1,77 @@
+<html>
+<head>
+<script src="inspector-test.js"></script>
+<script src="timeline-test.js"></script>
+<script>
+var timelineMark = "SCRIPT TAG";
+
+function analyzeEvaluateScript(record)
+{
+ var numChildren = record.children ? record.children.length : 0;
+ for (var i = 0; i < numChildren; ++i) {
+ var child = record.children[i];
+ if (child.type === timelineAgentRecordType.MarkTimeline
+ && child.data.message === timelineMark
+ && record.data.url.indexOf("timeline-script-tag-2.js") !== -1) {
+
+ // Finish printing the record as a tree
+ dumpTimelineRecord(record, 1);
+ output("");
+
+ // Now print the important fields of the record
+ printTimelineRecordProperties(record);
+ return true;
+ }
+ }
+ return false;
+}
+
+function analyzeParseHTML(record)
+{
+ var numChildren = record.children ? record.children.length : 0;
+ for (var i = 0; i < numChildren; ++i) {
+ var child = record.children[i];
+ if (child.type === timelineAgentRecordType.EvaluateScript)
+ if (analyzeEvaluateScript(child))
+ return true;
+ }
+ return false;
+}
+
+// Look for the ParseHtml->EvaluateScript->MarkTimeline that correlates
+// to the <script> tag below.
+function analyzeTimelineData(timelineRecords)
+{
+ // Uncomment to debugging the list of data returned.
+ // dumpTimelineRecords(timelineRecords);
+
+ // Search for a ParseHTML record
+ var numRecords = timelineRecords.length;
+ for (var i = 0 ; i < numRecords; ++i) {
+ var record = timelineRecords[i];
+ if (record.type === timelineAgentRecordType.ParseHTML) {
+ // Uncomment to debug the ParseHTML data record
+ // dumpTimelineRecord(record, 0);
+ output("ParseHTML");
+ if (!analyzeParseHTML(record))
+ output("Failed to find timeline mark: " + timelineMark);
+ }
+ }
+}
+
+function doit()
+{
+ retrieveTimelineData(analyzeTimelineData);
+}
+
+</script>
+</head>
+
+<body onload="onload()">
+<p>
+Tests the Timeline API instrumentation of a script tag with an external script.
+</p>
+
+<script src="timeline-script-tag-2.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/inspector/timeline-script-tag-2.js b/LayoutTests/inspector/timeline-script-tag-2.js
new file mode 100644
index 0000000..0fb273f
--- /dev/null
+++ b/LayoutTests/inspector/timeline-script-tag-2.js
@@ -0,0 +1 @@
+console.markTimeline(timelineMark);
\ No newline at end of file
diff --git a/LayoutTests/inspector/timeline-test.js b/LayoutTests/inspector/timeline-test.js
index 7d040fc..19865b2 100644
--- a/LayoutTests/inspector/timeline-test.js
+++ b/LayoutTests/inspector/timeline-test.js
@@ -39,7 +39,7 @@ function dumpTimelineRecord(record, level)
prefix = "----" + prefix;
if (level > 0)
prefix = prefix + "> ";
- if (record.type == timelineAgentRecordType.MarkTimeline) {
+ if (record.type === timelineAgentRecordType.MarkTimeline) {
suffix = " : " + record.data.message;
}
output(prefix + timelineAgentTypeToString(record.type) + suffix);
@@ -127,7 +127,7 @@ function markTimelineRecordAsOverhead(arg)
function timelineAgentTypeToString(numericType)
{
for (var prop in timelineAgentRecordType) {
- if (timelineAgentRecordType[prop] == numericType)
+ if (timelineAgentRecordType[prop] === numericType)
return prop;
}
return undefined;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list