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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 var test = this; | 313 var test = this; |
314 this.addSniffer(WebInspector, 'addProfile', | 314 this.addSniffer(WebInspector, 'addProfile', |
315 function(profile) { | 315 function(profile) { |
316 var panel = WebInspector.panels.profiles; | 316 var panel = WebInspector.panels.profiles; |
317 panel.showProfile(profile); | 317 panel.showProfile(profile); |
318 var node = panel.visibleView.profileDataGridTree.children[0]; | 318 var node = panel.visibleView.profileDataGridTree.children[0]; |
319 // Iterate over displayed functions and search for a function | 319 // Iterate over displayed functions and search for a function |
320 // that is called 'fib' or 'eternal_fib'. If found, it will mean | 320 // that is called 'fib' or 'eternal_fib'. If found, it will mean |
321 // that we actually have profiled page's code. | 321 // that we actually have profiled page's code. |
322 while (node) { | 322 while (node) { |
323 if (node.functionName.indexOf("fib") != -1) { | 323 if (node.functionName.indexOf('fib') != -1) { |
324 test.releaseControl(); | 324 test.releaseControl(); |
325 } | 325 } |
326 node = node.traverseNextNode(true, null, true); | 326 node = node.traverseNextNode(true, null, true); |
327 } | 327 } |
328 | 328 |
329 test.fail(); | 329 test.fail(); |
330 }); | 330 }); |
| 331 var ticksCount = 0; |
| 332 var tickRecord = '\nt,'; |
| 333 this.addSniffer(RemoteDebuggerAgent, 'DidGetNextLogLines', |
| 334 function(log) { |
| 335 var pos = 0; |
| 336 while ((pos = log.indexOf(tickRecord, pos)) != -1) { |
| 337 pos += tickRecord.length; |
| 338 ticksCount++; |
| 339 } |
| 340 if (ticksCount > 100) { |
| 341 InspectorController.stopProfiling(); |
| 342 } |
| 343 }, true); |
331 | 344 |
332 InspectorController.startProfiling(); | 345 InspectorController.startProfiling(); |
333 window.setTimeout('InspectorController.stopProfiling();', 1000); | |
334 this.takeControl(); | 346 this.takeControl(); |
335 }; | 347 }; |
336 | 348 |
337 | 349 |
338 /** | 350 /** |
339 * Tests that scripts tab can be open and populated with inspected scripts. | 351 * Tests that scripts tab can be open and populated with inspected scripts. |
340 */ | 352 */ |
341 TestSuite.prototype.testShowScriptsTab = function() { | 353 TestSuite.prototype.testShowScriptsTab = function() { |
342 var parsedDebuggerTestPageHtml = false; | 354 var parsedDebuggerTestPageHtml = false; |
343 | 355 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 /** | 619 /** |
608 * Run specified test on a fresh instance of the test suite. | 620 * Run specified test on a fresh instance of the test suite. |
609 * @param {string} name Name of a test method from TestSuite class. | 621 * @param {string} name Name of a test method from TestSuite class. |
610 */ | 622 */ |
611 uiTests.runTest = function(name) { | 623 uiTests.runTest = function(name) { |
612 new TestSuite().runTest(name); | 624 new TestSuite().runTest(name); |
613 }; | 625 }; |
614 | 626 |
615 | 627 |
616 } | 628 } |
OLD | NEW |