Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Unified Diff: webkit/glue/devtools/js/tests.js

Issue 212047: DevTools: Add more console tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/devtools/console_test_page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/js/tests.js
===================================================================
--- webkit/glue/devtools/js/tests.js (revision 26800)
+++ webkit/glue/devtools/js/tests.js (working copy)
@@ -619,6 +619,9 @@
assertNext('29', 'group', 'group-title');
index++;
assertNext('33', 'timer:', 'log-level', '', true);
+ assertNext('35', '1 2 3', 'log-level');
+ assertNext('37', 'HTMLDocument', 'log-level');
+ assertNext('39', '<html>', 'log-level', '', true);
};
@@ -627,18 +630,36 @@
*/
TestSuite.prototype.testEvalGlobal = function() {
WebInspector.console.visible = true;
- WebInspector.console.prompt.text = 'foo';
- WebInspector.console.promptElement.handleKeyEvent(
- new TestSuite.KeyEvent('Enter'));
+ var inputs = ['foo', 'foobar'];
+ var expectations = ['foo', 'fooValue',
+ 'foobar', 'ReferenceError: foobar is not defined'];
+
+ // Do not change code below - simply add inputs and expectations above.
+ var initEval = function(input) {
+ WebInspector.console.prompt.text = input;
+ WebInspector.console.promptElement.handleKeyEvent(
+ new TestSuite.KeyEvent('Enter'));
+ };
var test = this;
+ var messagesCount = 0;
+ var inputIndex = 0;
this.addSniffer(WebInspector.ConsoleView.prototype, 'addMessage',
function(commandResult) {
- test.assertEquals('fooValue',
- commandResult.toMessageElement().textContent);
- test.releaseControl();
- });
+ messagesCount++;
+ if (messagesCount == expectations.length) {
+ var messages = WebInspector.console.messages;
+ for (var i = 0; i < expectations; ++i) {
+ var elem = messages[i++].toMessageElement();
+ test.assertEquals(elem.textContent, expectations[i]);
+ }
+ test.releaseControl();
+ } else if (messagesCount % 2 == 0) {
+ initEval(inputs[inputIndex++]);
+ }
+ }, true);
+ initEval(inputs[inputIndex++]);
this.takeControl();
};
« no previous file with comments | « chrome/test/data/devtools/console_test_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698