| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 /** | 478 /** |
| 479 * Tests console eval. | 479 * Tests console eval. |
| 480 */ | 480 */ |
| 481 TestSuite.prototype.testConsoleEval = function() { | 481 TestSuite.prototype.testConsoleEval = function() { |
| 482 WebInspector.console.visible = true; | 482 WebInspector.console.visible = true; |
| 483 WebInspector.console.prompt.text = '123'; | 483 WebInspector.console.prompt.text = '123'; |
| 484 WebInspector.console.promptElement.handleKeyEvent( | 484 WebInspector.console.promptElement.handleKeyEvent( |
| 485 new TestSuite.KeyEvent('Enter')); | 485 new TestSuite.KeyEvent('Enter')); |
| 486 | 486 |
| 487 var test = this; | 487 var test = this; |
| 488 this.addSniffer(WebInspector.Console.prototype, 'addMessage', | 488 this.addSniffer(WebInspector.ConsoleView.prototype, 'addMessage', |
| 489 function(commandResult) { | 489 function(commandResult) { |
| 490 test.assertEquals('123', commandResult.toMessageElement().textContent); | 490 test.assertEquals('123', commandResult.toMessageElement().textContent); |
| 491 test.releaseControl(); | 491 test.releaseControl(); |
| 492 }); | 492 }); |
| 493 | 493 |
| 494 this.takeControl(); | 494 this.takeControl(); |
| 495 }; | 495 }; |
| 496 | 496 |
| 497 | 497 |
| 498 /** | 498 /** |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 /** | 539 /** |
| 540 * Tests eval of global objects. | 540 * Tests eval of global objects. |
| 541 */ | 541 */ |
| 542 TestSuite.prototype.testEvalGlobal = function() { | 542 TestSuite.prototype.testEvalGlobal = function() { |
| 543 WebInspector.console.visible = true; | 543 WebInspector.console.visible = true; |
| 544 WebInspector.console.prompt.text = 'foo'; | 544 WebInspector.console.prompt.text = 'foo'; |
| 545 WebInspector.console.promptElement.handleKeyEvent( | 545 WebInspector.console.promptElement.handleKeyEvent( |
| 546 new TestSuite.KeyEvent('Enter')); | 546 new TestSuite.KeyEvent('Enter')); |
| 547 | 547 |
| 548 var test = this; | 548 var test = this; |
| 549 this.addSniffer(WebInspector.Console.prototype, 'addMessage', | 549 this.addSniffer(WebInspector.ConsoleView.prototype, 'addMessage', |
| 550 function(commandResult) { | 550 function(commandResult) { |
| 551 test.assertEquals('fooValue', | 551 test.assertEquals('fooValue', |
| 552 commandResult.toMessageElement().textContent); | 552 commandResult.toMessageElement().textContent); |
| 553 test.releaseControl(); | 553 test.releaseControl(); |
| 554 }); | 554 }); |
| 555 | 555 |
| 556 this.takeControl(); | 556 this.takeControl(); |
| 557 }; | 557 }; |
| 558 | 558 |
| 559 | 559 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 587 /** | 587 /** |
| 588 * Run specified test on a fresh instance of the test suite. | 588 * Run specified test on a fresh instance of the test suite. |
| 589 * @param {string} name Name of a test method from TestSuite class. | 589 * @param {string} name Name of a test method from TestSuite class. |
| 590 */ | 590 */ |
| 591 uiTests.runTest = function(name) { | 591 uiTests.runTest = function(name) { |
| 592 new TestSuite().runTest(name); | 592 new TestSuite().runTest(name); |
| 593 }; | 593 }; |
| 594 | 594 |
| 595 | 595 |
| 596 } | 596 } |
| OLD | NEW |