Title: [117454] trunk
Revision
117454
Author
yu...@chromium.org
Date
2012-05-17 09:00:36 -0700 (Thu, 17 May 2012)

Log Message

Web Inspector: error when expanding an HTMLAllCollection object in the console
https://bugs.webkit.org/show_bug.cgi?id=86741

Reviewed by Pavel Feldman.

Source/WebCore:

Test: inspector/console/inspect-html-all-collection.html

* inspector/InjectedScriptSource.js: take into account that typeof HTMLAllCollection is "undefined"
when checking if object resolved by id is valid.

LayoutTests:

Test that RemoteObject.callFunctionOn can be successfully invoked on a
remote object representing HTMLAllCollection instance.

* inspector/console/inspect-html-all-collection-expected.txt: Added.
* inspector/console/inspect-html-all-collection.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (117453 => 117454)


--- trunk/LayoutTests/ChangeLog	2012-05-17 15:57:40 UTC (rev 117453)
+++ trunk/LayoutTests/ChangeLog	2012-05-17 16:00:36 UTC (rev 117454)
@@ -1,3 +1,16 @@
+2012-05-17  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: error when expanding an HTMLAllCollection object in the console
+        https://bugs.webkit.org/show_bug.cgi?id=86741
+
+        Reviewed by Pavel Feldman.
+
+        Test that RemoteObject.callFunctionOn can be successfully invoked on a
+        remote object representing HTMLAllCollection instance.
+
+        * inspector/console/inspect-html-all-collection-expected.txt: Added.
+        * inspector/console/inspect-html-all-collection.html: Added.
+
 2012-05-17  Antti Koivisto  <an...@apple.com>
 
         Frame flattening should not expand tiny frames

Added: trunk/LayoutTests/inspector/console/inspect-html-all-collection-expected.txt (0 => 117454)


--- trunk/LayoutTests/inspector/console/inspect-html-all-collection-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/console/inspect-html-all-collection-expected.txt	2012-05-17 16:00:36 UTC (rev 117454)
@@ -0,0 +1,4 @@
+Tests that HTMLAllCollection properties can be inspected.
+
+PASSED: retrieved length of document.all
+
Property changes on: trunk/LayoutTests/inspector/console/inspect-html-all-collection-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/console/inspect-html-all-collection.html (0 => 117454)


--- trunk/LayoutTests/inspector/console/inspect-html-all-collection.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/console/inspect-html-all-collection.html	2012-05-17 16:00:36 UTC (rev 117454)
@@ -0,0 +1,39 @@
+<html>
+<head>
+<script src=""
+<script>
+
+function test()
+{
+    RuntimeAgent.evaluate("document.all", "console", false, didGetHTMLAllCollection.bind(this));
+    function didGetHTMLAllCollection(error, result, wasThrown)
+    {
+        if (error || wasThrown) {
+            InspectorTest.addResult("FAILED: " + error);
+            InspectorTest.completeTest();
+            return;
+        }
+        var htmlAllCollection = WebInspector.RemoteObject.fromPayload(result);
+        htmlAllCollection.callFunctionJSON("function() { return this.length; }", [], didGetLength.bind(this));
+    }
+
+    function didGetLength(len)
+    {
+        if (!len || typeof len !== "number")
+            InspectorTest.addResult("FAILED: unexpected document.all.length: " + len);
+        else
+            InspectorTest.addResult("PASSED: retrieved length of document.all");
+        InspectorTest.completeTest();
+    }
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>
+Tests that HTMLAllCollection properties can be inspected.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/console/inspect-html-all-collection.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (117453 => 117454)


--- trunk/Source/WebCore/ChangeLog	2012-05-17 15:57:40 UTC (rev 117453)
+++ trunk/Source/WebCore/ChangeLog	2012-05-17 16:00:36 UTC (rev 117454)
@@ -1,3 +1,15 @@
+2012-05-17  Yury Semikhatsky  <yu...@chromium.org>
+
+        Web Inspector: error when expanding an HTMLAllCollection object in the console
+        https://bugs.webkit.org/show_bug.cgi?id=86741
+
+        Reviewed by Pavel Feldman.
+
+        Test: inspector/console/inspect-html-all-collection.html
+
+        * inspector/InjectedScriptSource.js: take into account that typeof HTMLAllCollection is "undefined"
+        when checking if object resolved by id is valid.
+
 2012-05-17  Kinuko Yasuda  <kin...@chromium.org>
 
         Unreviewed build fix attempt. Changing class to struct in forward declaration.

Modified: trunk/Source/WebCore/inspector/InjectedScriptSource.js (117453 => 117454)


--- trunk/Source/WebCore/inspector/InjectedScriptSource.js	2012-05-17 15:57:40 UTC (rev 117453)
+++ trunk/Source/WebCore/inspector/InjectedScriptSource.js	2012-05-17 16:00:36 UTC (rev 117454)
@@ -271,7 +271,7 @@
     {
         var parsedObjectId = this._parseObjectId(objectId);
         var object = this._objectForId(parsedObjectId);
-        if (!object)
+        if (!this._isDefined(object))
             return "Could not find object with given id";
 
         if (args) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to