OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 492 matching lines...) Loading... |
503 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.M
essageAdded, firstConsoleMessageReceived, this); | 503 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.M
essageAdded, firstConsoleMessageReceived, this); |
504 | 504 |
505 function firstConsoleMessageReceived() { | 505 function firstConsoleMessageReceived() { |
506 WebInspector.console.removeEventListener(WebInspector.ConsoleModel.Event
s.MessageAdded, firstConsoleMessageReceived, this); | 506 WebInspector.console.removeEventListener(WebInspector.ConsoleModel.Event
s.MessageAdded, firstConsoleMessageReceived, this); |
507 this.evaluateInConsole_("clickLink();", didClickLink.bind(this)); | 507 this.evaluateInConsole_("clickLink();", didClickLink.bind(this)); |
508 } | 508 } |
509 | 509 |
510 function didClickLink() { | 510 function didClickLink() { |
511 // Check that there are no new messages(command is not a message). | 511 // Check that there are no new messages(command is not a message). |
512 this.assertEquals(3, WebInspector.console.messages.length); | 512 this.assertEquals(3, WebInspector.console.messages.length); |
513 this.assertEquals(1, WebInspector.console.messages[0].totalRepeatCount); | 513 this.assertEquals(1, WebInspector.console.messages[0].repeatCount); |
514 this.evaluateInConsole_("history.back();", didNavigateBack.bind(this)); | 514 this.evaluateInConsole_("history.back();", didNavigateBack.bind(this)); |
515 } | 515 } |
516 | 516 |
517 function didNavigateBack() | 517 function didNavigateBack() |
518 { | 518 { |
519 // Make sure navigation completed and possible console messages were pus
hed. | 519 // Make sure navigation completed and possible console messages were pus
hed. |
520 this.evaluateInConsole_("void 0;", didCompleteNavigation.bind(this)); | 520 this.evaluateInConsole_("void 0;", didCompleteNavigation.bind(this)); |
521 } | 521 } |
522 | 522 |
523 function didCompleteNavigation() { | 523 function didCompleteNavigation() { |
524 this.assertEquals(7, WebInspector.console.messages.length); | 524 this.assertEquals(7, WebInspector.console.messages.length); |
525 this.assertEquals(1, WebInspector.console.messages[0].totalRepeatCount); | 525 this.assertEquals(1, WebInspector.console.messages[0].repeatCount); |
526 this.releaseControl(); | 526 this.releaseControl(); |
527 } | 527 } |
528 | 528 |
529 this.takeControl(); | 529 this.takeControl(); |
530 }; | 530 }; |
531 | 531 |
532 | 532 |
533 TestSuite.prototype.testReattachAfterCrash = function() | 533 TestSuite.prototype.testReattachAfterCrash = function() |
534 { | 534 { |
535 this.evaluateInConsole_("1+1;", this.releaseControl.bind(this)); | 535 this.evaluateInConsole_("1+1;", this.releaseControl.bind(this)); |
(...skipping 425 matching lines...) Loading... |
961 var oldLoadCompleted = InspectorFrontendAPI.loadCompleted; | 961 var oldLoadCompleted = InspectorFrontendAPI.loadCompleted; |
962 InspectorFrontendAPI.loadCompleted = function() | 962 InspectorFrontendAPI.loadCompleted = function() |
963 { | 963 { |
964 oldLoadCompleted.call(InspectorFrontendAPI); | 964 oldLoadCompleted.call(InspectorFrontendAPI); |
965 runTests(); | 965 runTests(); |
966 } | 966 } |
967 | 967 |
968 })(); | 968 })(); |
969 | 969 |
970 } | 970 } |
OLD | NEW |