| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @fileoverview This file contains small testing framework along with the | 7 * @fileoverview This file contains small testing framework along with the |
| 8 * test suite for the frontend. These tests are a part of the continues build | 8 * test suite for the frontend. These tests are a part of the continues build |
| 9 * and are executed by the devtools_sanity_unittest.cc as a part of the | 9 * and are executed by the devtools_sanity_unittest.cc as a part of the |
| 10 * Interactive UI Test suite. | 10 * Interactive UI Test suite. |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 window.setTimeout('InspectorController.stopProfiling();', 1000); | 333 window.setTimeout('InspectorController.stopProfiling();', 1000); |
| 334 this.takeControl(); | 334 this.takeControl(); |
| 335 }; | 335 }; |
| 336 | 336 |
| 337 | 337 |
| 338 /** | 338 /** |
| 339 * Tests that scripts tab can be open and populated with inspected scripts. | 339 * Tests that scripts tab can be open and populated with inspected scripts. |
| 340 */ | 340 */ |
| 341 TestSuite.prototype.testShowScriptsTab = function() { | 341 TestSuite.prototype.testShowScriptsTab = function() { |
| 342 var parsedDebuggerTestPageHtml = false; | 342 var parsedDebuggerTestPageHtml = false; |
| 343 var parsedDebuggerTestJs = false; | |
| 344 | 343 |
| 345 // Intercept parsedScriptSource calls to check that all expected scripts are | 344 // Intercept parsedScriptSource calls to check that all expected scripts are |
| 346 // added to the debugger. | 345 // added to the debugger. |
| 347 var test = this; | 346 var test = this; |
| 348 this.addSniffer(WebInspector, 'parsedScriptSource', | 347 this.addSniffer(WebInspector, 'parsedScriptSource', |
| 349 function(sourceID, sourceURL, source, startingLine) { | 348 function(sourceID, sourceURL, source, startingLine) { |
| 350 if (sourceURL.search(/debugger_test_page.html$/) != -1) { | 349 if (sourceURL.search(/debugger_test_page.html$/) != -1) { |
| 351 if (parsedDebuggerTestPageHtml) { | 350 if (parsedDebuggerTestPageHtml) { |
| 352 test.fail('Unexpected parse event: ' + sourceURL); | 351 test.fail('Unexpected parse event: ' + sourceURL); |
| 353 } | 352 } |
| 354 parsedDebuggerTestPageHtml = true; | 353 parsedDebuggerTestPageHtml = true; |
| 355 } else if (sourceURL.search(/debugger_test.js$/) != -1) { | |
| 356 if (parsedDebuggerTestJs) { | |
| 357 test.fail('Unexpected parse event: ' + sourceURL); | |
| 358 } | |
| 359 parsedDebuggerTestJs = true; | |
| 360 } else { | 354 } else { |
| 361 test.fail('Unexpected script URL: ' + sourceURL); | 355 test.fail('Unexpected script URL: ' + sourceURL); |
| 362 } | 356 } |
| 363 | 357 |
| 364 if (!WebInspector.panels.scripts.visibleView) { | 358 if (!WebInspector.panels.scripts.visibleView) { |
| 365 test.fail('No visible script view: ' + sourceURL); | 359 test.fail('No visible script view: ' + sourceURL); |
| 366 } | 360 } |
| 367 | 361 |
| 368 if (parsedDebuggerTestJs && parsedDebuggerTestPageHtml) { | 362 if (parsedDebuggerTestPageHtml) { |
| 369 test.releaseControl(); | 363 test.releaseControl(); |
| 370 } | 364 } |
| 371 }, true /* sticky */); | 365 }, true /* sticky */); |
| 372 | 366 |
| 373 this.showPanel('scripts'); | 367 this.showPanel('scripts'); |
| 374 | 368 |
| 375 // Wait until all scripts are added to the debugger. | 369 // Wait until all scripts are added to the debugger. |
| 376 this.takeControl(); | 370 this.takeControl(); |
| 377 }; | 371 }; |
| 378 | 372 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 /** | 578 /** |
| 585 * Run specified test on a fresh instance of the test suite. | 579 * Run specified test on a fresh instance of the test suite. |
| 586 * @param {string} name Name of a test method from TestSuite class. | 580 * @param {string} name Name of a test method from TestSuite class. |
| 587 */ | 581 */ |
| 588 uiTests.runTest = function(name) { | 582 uiTests.runTest = function(name) { |
| 589 new TestSuite().runTest(name); | 583 new TestSuite().runTest(name); |
| 590 }; | 584 }; |
| 591 | 585 |
| 592 | 586 |
| 593 } | 587 } |
| OLD | NEW |