| OLD | NEW |
| 1 var initialize_InspectorTest = function() { | 1 var initialize_InspectorTest = function() { |
| 2 | 2 |
| 3 var results = []; | 3 var results = []; |
| 4 var resultsSynchronized = false; | 4 var resultsSynchronized = false; |
| 5 | 5 |
| 6 function consoleOutputHook(messageType) | 6 function consoleOutputHook(messageType) |
| 7 { | 7 { |
| 8 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); | 8 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 function runner() | 315 function runner() |
| 316 { | 316 { |
| 317 if (!testSuiteTests.length) { | 317 if (!testSuiteTests.length) { |
| 318 InspectorTest.completeTest(); | 318 InspectorTest.completeTest(); |
| 319 return; | 319 return; |
| 320 } | 320 } |
| 321 var nextTest = testSuiteTests.shift(); | 321 var nextTest = testSuiteTests.shift(); |
| 322 InspectorTest.addResult(""); | 322 InspectorTest.addResult(""); |
| 323 InspectorTest.addResult("Running: " + /function\s([^(]*)/.exec(nextTest)
[1]); | 323 InspectorTest.addResult("Running: " + /function\s([^(]*)/.exec(nextTest)
[1]); |
| 324 InspectorTest.safeWrap(nextTest)(runner, runner); | 324 InspectorTest.safeWrap(nextTest)(runner); |
| 325 } | 325 } |
| 326 runner(); | 326 runner(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 InspectorTest.assertEquals = function(expected, found, message) | 329 InspectorTest.assertEquals = function(expected, found, message) |
| 330 { | 330 { |
| 331 if (expected === found) | 331 if (expected === found) |
| 332 return; | 332 return; |
| 333 | 333 |
| 334 var error; | 334 var error; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 var modules = WebInspector.moduleManager._modules; | 562 var modules = WebInspector.moduleManager._modules; |
| 563 for (var i = 0; i < modules.length; ++i) { | 563 for (var i = 0; i < modules.length; ++i) { |
| 564 if (modules[i]._loaded) { | 564 if (modules[i]._loaded) { |
| 565 InspectorTest.addResult(" " + modules[i]._descriptor.name); | 565 InspectorTest.addResult(" " + modules[i]._descriptor.name); |
| 566 } | 566 } |
| 567 } | 567 } |
| 568 if (next) | 568 if (next) |
| 569 next(); | 569 next(); |
| 570 } | 570 } |
| 571 | 571 |
| 572 InspectorTest.TimeoutMock = function() |
| 573 { |
| 574 this._timeoutId = 0; |
| 575 this._timeoutIdToProcess = {}; |
| 576 this._timeoutIdToMillis = {}; |
| 577 this.setTimeout = this.setTimeout.bind(this); |
| 578 this.clearTimeout = this.clearTimeout.bind(this); |
| 579 } |
| 580 InspectorTest.TimeoutMock.prototype = { |
| 581 setTimeout: function(operation, timeout) |
| 582 { |
| 583 this._timeoutIdToProcess[++this._timeoutId] = operation; |
| 584 this._timeoutIdToMillis[this._timeoutId] = timeout; |
| 585 return this._timeoutId; |
| 586 }, |
| 587 |
| 588 clearTimeout: function(timeoutId) |
| 589 { |
| 590 delete this._timeoutIdToProcess[timeoutId]; |
| 591 delete this._timeoutIdToMillis[timeoutId]; |
| 592 }, |
| 593 |
| 594 activeTimersTimeouts: function() |
| 595 { |
| 596 return Object.values(this._timeoutIdToMillis); |
| 597 }, |
| 598 |
| 599 fireAllTimers: function() |
| 600 { |
| 601 for (var timeoutId in this._timeoutIdToProcess) |
| 602 this._timeoutIdToProcess[timeoutId].call(window); |
| 603 this._timeoutIdToProcess = {}; |
| 604 this._timeoutIdToMillis = {}; |
| 605 } |
| 606 } |
| 607 |
| 572 WebInspector.TempFile = InspectorTest.TempFileMock; | 608 WebInspector.TempFile = InspectorTest.TempFileMock; |
| 573 | 609 |
| 574 }; | 610 }; |
| 575 | 611 |
| 576 var initializeCallId = 0; | 612 var initializeCallId = 0; |
| 577 var runTestCallId = 1; | 613 var runTestCallId = 1; |
| 578 var completeTestCallId = 2; | 614 var completeTestCallId = 2; |
| 579 var evalCallbackCallId = 3; | 615 var evalCallbackCallId = 3; |
| 580 var frontendReopeningCount = 0; | 616 var frontendReopeningCount = 0; |
| 581 | 617 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 evaluateInWebInspector: function(callId, script) | 806 evaluateInWebInspector: function(callId, script) |
| 771 { | 807 { |
| 772 window.opener.postMessage(["evaluateInWebInspector", callId, script], "*
"); | 808 window.opener.postMessage(["evaluateInWebInspector", callId, script], "*
"); |
| 773 }, | 809 }, |
| 774 | 810 |
| 775 display: function() { } | 811 display: function() { } |
| 776 } | 812 } |
| 777 | 813 |
| 778 if (!window.testRunner && window.opener) | 814 if (!window.testRunner && window.opener) |
| 779 window.testRunner = new StandaloneTestRunnerStub(); | 815 window.testRunner = new StandaloneTestRunnerStub(); |
| OLD | NEW |