| OLD | NEW |
| 1 function trimURL(url) | 1 function trimURL(url) |
| 2 { | 2 { |
| 3 if (!url) | 3 if (!url) |
| 4 return; | 4 return; |
| 5 if (/^data:/.test(url)) | 5 if (/^data:/.test(url)) |
| 6 return url.replace(/,.*$/, "..."); | 6 return url.replace(/,.*$/, "..."); |
| 7 return url.replace(/.*\//, ".../"); | 7 return url.replace(/.*\//, ".../"); |
| 8 } | 8 } |
| 9 | 9 |
| 10 function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix) | 10 function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 function runTests() | 75 function runTests() |
| 76 { | 76 { |
| 77 output("Running tests..."); | 77 output("Running tests..."); |
| 78 var tests = []; | 78 var tests = []; |
| 79 for (var symbol in this) { | 79 for (var symbol in this) { |
| 80 if (/^extension_test/.test(symbol) && typeof this[symbol] === "function"
) | 80 if (/^extension_test/.test(symbol) && typeof this[symbol] === "function"
) |
| 81 tests.push(symbol); | 81 tests.push(symbol); |
| 82 } | 82 } |
| 83 tests = tests.sort(); | 83 tests = tests.sort(); |
| 84 var testChain = onTestsDone; | 84 var testChain = extension_onTestsDone; |
| 85 for (var test = tests.pop(); test; test = tests.pop()) | 85 for (var test = tests.pop(); test; test = tests.pop()) |
| 86 testChain = bind(runTest, this, bind(this[test], this, testChain), test)
; | 86 testChain = bind(runTest, this, bind(this[test], this, testChain), test)
; |
| 87 testChain(); | 87 testChain(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 function onTestsDone() | 90 function extension_onTestsDone() |
| 91 { | 91 { |
| 92 output("All tests done."); | 92 output("All tests done."); |
| 93 evaluateOnFrontend("InspectorTest.completeTest();"); | 93 evaluateOnFrontend("InspectorTest.completeTest();"); |
| 94 } | 94 } |
| 95 | 95 |
| 96 function runTest(test, name) | 96 function runTest(test, name) |
| 97 { | 97 { |
| 98 output("RUNNING TEST: " + name); | 98 output("RUNNING TEST: " + name); |
| 99 try { | 99 try { |
| 100 test(); | 100 test(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 111 nextTest.call(this); | 111 nextTest.call(this); |
| 112 } | 112 } |
| 113 return callbackWrapper; | 113 return callbackWrapper; |
| 114 } | 114 } |
| 115 | 115 |
| 116 function bind(func, thisObject) | 116 function bind(func, thisObject) |
| 117 { | 117 { |
| 118 var args = Array.prototype.slice.call(arguments, 2); | 118 var args = Array.prototype.slice.call(arguments, 2); |
| 119 return function() { return func.apply(thisObject, args.concat(Array.prototyp
e.slice.call(arguments, 0))); }; | 119 return function() { return func.apply(thisObject, args.concat(Array.prototyp
e.slice.call(arguments, 0))); }; |
| 120 } | 120 } |
| OLD | NEW |