| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 // Global Values | 7 // Global Values |
| 8 var globals = []; | 8 var globals = []; |
| 9 | 9 |
| 10 function log(current) | 10 function log(current) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 console.log("%%%%% self-escape5", "dummy"); | 34 console.log("%%%%% self-escape5", "dummy"); |
| 35 console.log("%%%s self-escape6", "dummy"); | 35 console.log("%%%s self-escape6", "dummy"); |
| 36 | 36 |
| 37 // Populate Globals | 37 // Populate Globals |
| 38 var regex1 = /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\
\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*
\)/i; | 38 var regex1 = /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\
\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*
\)/i; |
| 39 var regex2 = new RegExp("foo\\\\bar\\sbaz", "i"); | 39 var regex2 = new RegExp("foo\\\\bar\\sbaz", "i"); |
| 40 var str = "test"; | 40 var str = "test"; |
| 41 var str2 = "test named \"test\""; | 41 var str2 = "test named \"test\""; |
| 42 var error = new Error; | 42 var error = new Error; |
| 43 var errorWithMessage = new Error("my error message"); | 43 var errorWithMessage = new Error("my error message"); |
| 44 var errorWithMultilineMessage = new Error("my multiline\nerror message"); |
| 44 var node = document.getElementById("p"); | 45 var node = document.getElementById("p"); |
| 45 var func = function() { return 1; }; | 46 var func = function() { return 1; }; |
| 46 var multilinefunc = function() { | 47 var multilinefunc = function() { |
| 47 return 2; | 48 return 2; |
| 48 }; | 49 }; |
| 49 var num = 1.2e-1; | 50 var num = 1.2e-1; |
| 50 var linkify = "http://webkit.org/"; | 51 var linkify = "http://webkit.org/"; |
| 51 var valuelessAttribute = document.createAttribute("attr"); | 52 var valuelessAttribute = document.createAttribute("attr"); |
| 52 var valuedAttribute = document.createAttribute("attr"); | 53 var valuedAttribute = document.createAttribute("attr"); |
| 53 valuedAttribute.value = "value"; | 54 valuedAttribute.value = "value"; |
| 54 var existingAttribute = document.getElementById("x").attributes[0]; | 55 var existingAttribute = document.getElementById("x").attributes[0]; |
| 55 var throwingLengthGetter = {get length() { throw "Length called"; }}; | 56 var throwingLengthGetter = {get length() { throw "Length called"; }}; |
| 56 var objectWithNonEnumerables = Object.create({ foo: 1 }, { | 57 var objectWithNonEnumerables = Object.create({ foo: 1 }, { |
| 57 getFoo: { value: function() { return this.foo; } }, | 58 getFoo: { value: function() { return this.foo; } }, |
| 58 bar: { get: function() { return this.bar; }, set: function(x) { this.bar
= x; } } | 59 bar: { get: function() { return this.bar; }, set: function(x) { this.bar
= x; } } |
| 59 }); | 60 }); |
| 60 var negZero = 1 / Number.NEGATIVE_INFINITY; | 61 var negZero = 1 / Number.NEGATIVE_INFINITY; |
| 61 var textNode = document.getElementById("x").nextSibling; | 62 var textNode = document.getElementById("x").nextSibling; |
| 62 var arrayLikeFunction = function( /**/ foo/**/, /*/**/bar, | 63 var arrayLikeFunction = function( /**/ foo/**/, /*/**/bar, |
| 63 /**/baz) {}; | 64 /**/baz) {}; |
| 64 arrayLikeFunction.splice = function() {}; | 65 arrayLikeFunction.splice = function() {}; |
| 65 var smallTypedArray = new Uint8Array(new ArrayBuffer(400)); | 66 var smallTypedArray = new Uint8Array(new ArrayBuffer(400)); |
| 66 smallTypedArray["foo"] = "bar"; | 67 smallTypedArray["foo"] = "bar"; |
| 67 var bigTypedArray = new Uint8Array(new ArrayBuffer(400 * 1000 * 1000)); | 68 var bigTypedArray = new Uint8Array(new ArrayBuffer(400 * 1000 * 1000)); |
| 68 bigTypedArray["FAIL"] = "FAIL: Object.getOwnPropertyNames() should not have
been run"; | 69 bigTypedArray["FAIL"] = "FAIL: Object.getOwnPropertyNames() should not have
been run"; |
| 69 globals = [ | 70 globals = [ |
| 70 regex1, regex2, str, str2, error, errorWithMessage, node, func, multilin
efunc, num, linkify, | 71 regex1, regex2, str, str2, error, errorWithMessage, errorWithMultilineMe
ssage, node, func, multilinefunc, |
| 71 null, undefined, valuelessAttribute, valuedAttribute, existingAttribute,
throwingLengthGetter, | 72 num, linkify, null, undefined, valuelessAttribute, valuedAttribute, exis
tingAttribute, throwingLengthGetter, |
| 72 NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array, {}, [fun
ction() {}], bar, svg, | 73 NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array, {}, [fun
ction() {}], bar, svg, |
| 73 objectWithNonEnumerables, negZero, Object.create(null), Object, Object.p
rototype, arrayLikeFunction, | 74 objectWithNonEnumerables, negZero, Object.create(null), Object, Object.p
rototype, arrayLikeFunction, |
| 74 new Number(42), new String("abc"), new Uint16Array([1, 2, 3]), textNode,
domException(), | 75 new Number(42), new String("abc"), new Uint16Array([1, 2, 3]), textNode,
domException(), |
| 75 smallTypedArray, bigTypedArray | 76 smallTypedArray, bigTypedArray |
| 76 ]; | 77 ]; |
| 77 | 78 |
| 78 runTest(); | 79 runTest(); |
| 79 } | 80 } |
| 80 | 81 |
| 81 function domException() | 82 function domException() |
| (...skipping 21 matching lines...) Expand all Loading... |
| 103 { | 104 { |
| 104 var next = current + 1; | 105 var next = current + 1; |
| 105 if (next == total.description) | 106 if (next == total.description) |
| 106 InspectorTest.waitForRemoteObjectsConsoleMessages(onRemoteObject
sLoaded); | 107 InspectorTest.waitForRemoteObjectsConsoleMessages(onRemoteObject
sLoaded); |
| 107 else | 108 else |
| 108 loopOverGlobals(next, total); | 109 loopOverGlobals(next, total); |
| 109 } | 110 } |
| 110 | 111 |
| 111 function onRemoteObjectsLoaded() | 112 function onRemoteObjectsLoaded() |
| 112 { | 113 { |
| 113 InspectorTest.expandConsoleMessages(finish, undefined, function(sect
ion) { return section.element.firstChild.textContent !== "#text"; }); | 114 InspectorTest.expandConsoleMessages(InspectorTest.expandConsoleMessa
gesErrorParameters.bind(this, finish), undefined, function(section) { return sec
tion.element.firstChild.textContent !== "#text"; }); |
| 114 } | 115 } |
| 115 | 116 |
| 116 function finish() | 117 function finish() |
| 117 { | 118 { |
| 118 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames(); | 119 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames(); |
| 119 InspectorTest.completeTest(); | 120 InspectorTest.completeTest(); |
| 120 } | 121 } |
| 121 | 122 |
| 122 InspectorTest.evaluateInPage("log(" + current + ")"); | 123 InspectorTest.evaluateInPage("log(" + current + ")"); |
| 123 InspectorTest.runAfterPendingDispatches(evalInConsole); | 124 InspectorTest.runAfterPendingDispatches(evalInConsole); |
| 124 function evalInConsole() | 125 function evalInConsole() |
| 125 { | 126 { |
| 126 InspectorTest.evaluateInConsole("globals[" + current + "]"); | 127 InspectorTest.evaluateInConsole("globals[" + current + "]"); |
| 127 InspectorTest.runAfterPendingDispatches(advance); | 128 InspectorTest.runAfterPendingDispatches(advance); |
| 128 } | 129 } |
| 129 } | 130 } |
| 130 } | 131 } |
| 131 </script> | 132 </script> |
| 132 </head> | 133 </head> |
| 133 | 134 |
| 134 <body onload="onload()"> | 135 <body onload="onload()"> |
| 135 <div id="x"></div> | 136 <div id="x"></div> |
| 136 <p id="p">Tests that console logging dumps proper messages.</p> | 137 <p id="p">Tests that console logging dumps proper messages.</p> |
| 137 </body> | 138 </body> |
| 138 <svg id="svg-node"></svg> | 139 <svg id="svg-node"></svg> |
| 139 </html> | 140 </html> |
| OLD | NEW |