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

Side by Side Diff: Source/testing/runner/WebTestProxy.cpp

Issue 26770004: Add console message levels to test expectation output. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tests. Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/webexposed/global-constructors-listing-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 m_delegate->printMessage(" - didFinishLoading\n"); 1306 m_delegate->printMessage(" - didFinishLoading\n");
1307 } 1307 }
1308 m_resourceIdentifierMap.erase(identifier); 1308 m_resourceIdentifierMap.erase(identifier);
1309 } 1309 }
1310 1310
1311 void WebTestProxyBase::didAddMessageToConsole(const WebConsoleMessage& message, const WebString& sourceName, unsigned sourceLine) 1311 void WebTestProxyBase::didAddMessageToConsole(const WebConsoleMessage& message, const WebString& sourceName, unsigned sourceLine)
1312 { 1312 {
1313 // This matches win DumpRenderTree's UIDelegate.cpp. 1313 // This matches win DumpRenderTree's UIDelegate.cpp.
1314 if (!m_logConsoleOutput) 1314 if (!m_logConsoleOutput)
1315 return; 1315 return;
1316 m_delegate->printMessage(string("CONSOLE MESSAGE: ")); 1316 string level;
1317 switch (message.level) {
1318 case WebConsoleMessage::LevelDebug:
1319 level = "DEBUG";
1320 break;
1321 case WebConsoleMessage::LevelLog:
1322 level = "MESSAGE";
1323 break;
1324 case WebConsoleMessage::LevelWarning:
1325 level = "WARNING";
1326 break;
1327 case WebConsoleMessage::LevelError:
1328 level = "ERROR";
1329 break;
1330 }
1331 m_delegate->printMessage(string("CONSOLE ") + level + ": ");
1317 if (sourceLine) { 1332 if (sourceLine) {
1318 char buffer[40]; 1333 char buffer[40];
1319 snprintf(buffer, sizeof(buffer), "line %d: ", sourceLine); 1334 snprintf(buffer, sizeof(buffer), "line %d: ", sourceLine);
1320 m_delegate->printMessage(buffer); 1335 m_delegate->printMessage(buffer);
1321 } 1336 }
1322 if (!message.text.isEmpty()) { 1337 if (!message.text.isEmpty()) {
1323 string newMessage; 1338 string newMessage;
1324 newMessage = message.text.utf8(); 1339 newMessage = message.text.utf8();
1325 size_t fileProtocol = newMessage.find("file://"); 1340 size_t fileProtocol = newMessage.find("file://");
1326 if (fileProtocol != string::npos) { 1341 if (fileProtocol != string::npos) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 1406
1392 void WebTestProxyBase::resetInputMethod() 1407 void WebTestProxyBase::resetInputMethod()
1393 { 1408 {
1394 // If a composition text exists, then we need to let the browser process 1409 // If a composition text exists, then we need to let the browser process
1395 // to cancel the input method's ongoing composition session. 1410 // to cancel the input method's ongoing composition session.
1396 if (m_webWidget) 1411 if (m_webWidget)
1397 m_webWidget->confirmComposition(); 1412 m_webWidget->confirmComposition();
1398 } 1413 }
1399 1414
1400 } 1415 }
OLDNEW
« no previous file with comments | « LayoutTests/webexposed/global-constructors-listing-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698