|
36 | 36 | #include "webdriver_server.h" |
37 | 37 | #include "webdriver_view_transitions.h" |
38 | 38 | #include "versioninfo.h" |
| 39 | +#include "webdriver_route_table.h" |
| 40 | +#include "shutdown_command.h" |
39 | 41 |
|
40 | 42 | #if (WD_TEST_ENABLE_WEB_VIEW == 1) |
41 | 43 | #include "extension_qt/web_view_creator.h" |
@@ -141,16 +143,11 @@ int main(int argc, char *argv[]) |
141 | 143 | return 1; |
142 | 144 | } |
143 | 145 |
|
144 | | - VNCClient *client = new VNCClient(); |
145 | | - client->Init("http://127.0.0.1", 5900); |
| 146 | + webdriver::RouteTable *routeTableWithShutdownCommand = new webdriver::RouteTable(wd_server->GetRouteTable()); |
| 147 | + const char shutdownCommandRoute[] = "/-CISCO-shutdown"; |
| 148 | + routeTableWithShutdownCommand->Add<webdriver::ShutdownCommand>(shutdownCommandRoute); |
| 149 | + wd_server->SetRouteTable(routeTableWithShutdownCommand); |
146 | 150 |
|
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 | | - } |
154 | 151 |
|
155 | 152 | setQtSettings(); |
156 | 153 | wd_server->Start(); |
@@ -207,7 +204,9 @@ void PrintHelp() { |
207 | 204 | << " described above (port, root, etc.)" << std::endl |
208 | 205 | << "wi-server false If true, web inspector will be enabled" << std::endl |
209 | 206 | << "wi-port 9222 Web inspector listening port" << std::endl |
210 | | - << "version Print version information to stdout and exit" << std::endl; |
| 207 | + << "version Print version information to stdout and exit" << std::endl |
| 208 | + << "vnc-port 5900 VNC server listening port" << std::endl |
| 209 | + << "vnc-server 127.0.0.1 VNC server IP address" << std::endl; |
211 | 210 | } |
212 | 211 |
|
213 | 212 |
|
|
0 commit comments