Skip to content

Commit 86c5843

Browse files
committed
fixed qt5 compilation error
1 parent 6b8ab60 commit 86c5843

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/chrome/test/webdriver/webdriver_server.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,23 @@ int RunChromeDriver() {
283283
base::WaitableEvent shutdown_event(false, false);
284284
CommandLine* cmd_line = CommandLine::ForCurrentProcess();
285285

286+
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
287+
// set default output mode
288+
qInstallMessageHandler(normalMessageOutput);
289+
290+
// check if verbose mode
291+
if (cmd_line->HasSwitch("verbose")) {
292+
qInstallMessageHandler(verboseMessageOutput);
293+
}
294+
295+
// check if silence mode
296+
if (cmd_line->HasSwitch("silence")) {
297+
std::ostream null_stream(0);
298+
std::cerr.rdbuf(null_stream.rdbuf());
299+
std::cout.rdbuf(null_stream.rdbuf());
300+
qInstallMessageHandler(silentMessageOutput);
301+
}
302+
#else
286303
// set default output mode
287304
qInstallMsgHandler(normalMessageOutput);
288305

@@ -298,6 +315,7 @@ int RunChromeDriver() {
298315
std::cout.rdbuf(null_stream.rdbuf());
299316
qInstallMsgHandler(silentMessageOutput);
300317
}
318+
#endif
301319

302320
//#if defined(OS_POSIX)
303321
// signal(SIGPIPE, SIG_IGN);

0 commit comments

Comments
 (0)