OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 } |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 std::cerr << "Usage: " << command << "--username=<username>" << std::endl | 321 std::cerr << "Usage: " << command << "--username=<username>" << std::endl |
322 << "\t--auth_token=<auth_token>" << std::endl | 322 << "\t--auth_token=<auth_token>" << std::endl |
323 << "\t[--host_jid=<host_jid>]" << std::endl; | 323 << "\t[--host_jid=<host_jid>]" << std::endl; |
324 exit(1); | 324 exit(1); |
325 } | 325 } |
326 | 326 |
327 int main(int argc, char** argv) { | 327 int main(int argc, char** argv) { |
328 CommandLine::Init(argc, argv); | 328 CommandLine::Init(argc, argv); |
329 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 329 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
330 | 330 |
331 if (!cmd_line->args().empty() || cmd_line->HasSwitch("help")) | 331 if (!cmd_line->GetArgs().empty() || cmd_line->HasSwitch("help")) |
332 usage(argv[0]); | 332 usage(argv[0]); |
333 | 333 |
334 base::AtExitManager exit_manager; | 334 base::AtExitManager exit_manager; |
335 | 335 |
336 crypto::EnsureNSPRInit(); | 336 crypto::EnsureNSPRInit(); |
337 crypto::EnsureNSSInit(); | 337 crypto::EnsureNSSInit(); |
338 | 338 |
339 #if defined(OS_MACOSX) | 339 #if defined(OS_MACOSX) |
340 mock_cr_app::RegisterMockCrApp(); | 340 mock_cr_app::RegisterMockCrApp(); |
341 #endif // OS_MACOSX | 341 #endif // OS_MACOSX |
(...skipping 12 matching lines...) Expand all Loading... |
354 std::string auth_service("oauth2"); | 354 std::string auth_service("oauth2"); |
355 if (cmd_line->HasSwitch("auth_service")) | 355 if (cmd_line->HasSwitch("auth_service")) |
356 auth_service = cmd_line->GetSwitchValueASCII("auth_service"); | 356 auth_service = cmd_line->GetSwitchValueASCII("auth_service"); |
357 | 357 |
358 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); | 358 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); |
359 | 359 |
360 client->Run(username, auth_token, host_jid, auth_service); | 360 client->Run(username, auth_token, host_jid, auth_service); |
361 | 361 |
362 return 0; | 362 return 0; |
363 } | 363 } |
OLD | NEW |