Skip to content

Commit a344ed6

Browse files
Andrii MorozAndrii Moroz
authored andcommitted
added vnc command line option for WD
1 parent 674e0f5 commit a344ed6

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

inc/webdriver_switches.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ class Switches {
6767
/// Web inspector listening port (by default - 9222)
6868
static const char kWIPort[];
6969

70+
/// \page page_webdriver_switches WD Server switches
71+
/// - <b>vnc</b><br>
72+
/// Enabling VNC support (by default - false)
73+
static const char kVNCEnabled[];
74+
7075
};
7176

7277
} // namespace webdriver

src/Test/main.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#include "extension_qt/vnc_event_dispatcher.h"
5454

5555
#include "vnc/vncclient.h"
56+
#include "webdriver_switches.h"
5657

5758
void setQtSettings();
5859
void PrintVersion();
@@ -143,7 +144,13 @@ int main(int argc, char *argv[])
143144
VNCClient *client = new VNCClient();
144145
client->Init("http://127.0.0.1", 5900);
145146

146-
WDEventDispatcher::getInstance()->add(new VNCEventDispatcher(client));
147+
148+
CommandLine cmdLine = webdriver::Server::GetInstance()->GetCommandLine();
149+
150+
if (cmdLine.HasSwitch(webdriver::Switches::kVNCEnabled))
151+
{
152+
WDEventDispatcher::getInstance()->add(new VNCEventDispatcher(client));
153+
}
147154

148155
setQtSettings();
149156
wd_server->Start();

src/webdriver/webdriver_switches.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ const char Switches::kWIServer[] = "wi-server";
2222

2323
const char Switches::kWIPort[] = "wi-port";
2424

25+
const char Switches::kVNCEnabled[] = "vnc";
26+
2527
} // namespace webdriver

0 commit comments

Comments
 (0)