OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
8 extern "C" { | 8 extern "C" { |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 } | 10 } |
11 #endif // !defined(OS_WIN) | 11 #endif // !defined(OS_WIN) |
12 | 12 |
13 #include <iostream> | 13 #include <iostream> |
14 #include <list> | 14 #include <list> |
15 | 15 |
16 #include "base/at_exit.h" | 16 #include "base/at_exit.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/nss_util.h" | 18 #include "base/nss_util.h" |
| 19 #include "base/test/mock_chrome_application_mac.h" |
19 #include "base/time.h" | 20 #include "base/time.h" |
20 #include "net/base/completion_callback.h" | 21 #include "net/base/completion_callback.h" |
21 #include "net/base/io_buffer.h" | 22 #include "net/base/io_buffer.h" |
22 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
23 #include "net/socket/socket.h" | 24 #include "net/socket/socket.h" |
24 #include "remoting/base/constants.h" | 25 #include "remoting/base/constants.h" |
25 #include "remoting/jingle_glue/jingle_client.h" | 26 #include "remoting/jingle_glue/jingle_client.h" |
26 #include "remoting/jingle_glue/jingle_thread.h" | 27 #include "remoting/jingle_glue/jingle_thread.h" |
27 #include "remoting/protocol/jingle_session_manager.h" | 28 #include "remoting/protocol/jingle_session_manager.h" |
28 | 29 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 348 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
348 | 349 |
349 if (!cmd_line->args().empty() || cmd_line->HasSwitch("help")) | 350 if (!cmd_line->args().empty() || cmd_line->HasSwitch("help")) |
350 usage(argv[0]); | 351 usage(argv[0]); |
351 | 352 |
352 base::AtExitManager exit_manager; | 353 base::AtExitManager exit_manager; |
353 | 354 |
354 base::EnsureNSPRInit(); | 355 base::EnsureNSPRInit(); |
355 base::EnsureNSSInit(); | 356 base::EnsureNSSInit(); |
356 | 357 |
| 358 #if defined(OS_MACOSX) |
| 359 mock_cr_app::RegisterMockCrApp(); |
| 360 #endif // OS_MACOSX |
| 361 |
357 std::string host_jid(cmd_line->GetSwitchValueASCII("host_jid")); | 362 std::string host_jid(cmd_line->GetSwitchValueASCII("host_jid")); |
358 | 363 |
359 if (!cmd_line->HasSwitch("username")) | 364 if (!cmd_line->HasSwitch("username")) |
360 usage(argv[0]); | 365 usage(argv[0]); |
361 std::string username(cmd_line->GetSwitchValueASCII("username")); | 366 std::string username(cmd_line->GetSwitchValueASCII("username")); |
362 | 367 |
363 if (!cmd_line->HasSwitch("auth_token")) | 368 if (!cmd_line->HasSwitch("auth_token")) |
364 usage(argv[0]); | 369 usage(argv[0]); |
365 std::string auth_token(cmd_line->GetSwitchValueASCII("auth_token")); | 370 std::string auth_token(cmd_line->GetSwitchValueASCII("auth_token")); |
366 | 371 |
367 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); | 372 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); |
368 | 373 |
369 client->Run(username, auth_token, host_jid); | 374 client->Run(username, auth_token, host_jid); |
370 | 375 |
371 return 0; | 376 return 0; |
372 } | 377 } |
OLD | NEW |