Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 #include <string> | |
|
joedow
2015/06/08 17:20:04
add newline between comment and include statement.
| |
| 5 | |
| 6 #include "base/command_line.h" | |
| 7 #include "base/test/test_suite.h" | |
| 8 #include "base/test/test_switches.h" | |
| 9 #include "testing/gtest/include/gtest/gtest.h" | |
| 10 | |
| 11 namespace switches { | |
| 12 const char kSingleProcessTestsSwitchName[] = "single-process-tests"; | |
| 13 const char kUserNameSwitchName[] = "username"; | |
| 14 } | |
| 15 | |
| 16 int main(int argc, char* argv[]) { | |
| 17 testing::InitGoogleTest(&argc, argv); | |
| 18 base::TestSuite test_suite(argc, argv); | |
| 19 | |
| 20 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 21 DCHECK(command_line); | |
| 22 | |
| 23 // Do not retry if tests fails. | |
| 24 command_line->AppendSwitchASCII(switches::kTestLauncherRetryLimit, "0"); | |
| 25 | |
| 26 // Do not run tests in parallel. Interactions between the host and test | |
| 27 // client should not interfere with another test client. | |
|
joedow
2015/06/08 17:20:04
Can you reword this comment to describe the constr
| |
| 28 command_line->AppendSwitch(switches::kSingleProcessTestsSwitchName); | |
| 29 | |
| 30 std::string username( | |
| 31 command_line->GetSwitchValueASCII(switches::kUserNameSwitchName)); | |
| 32 // Verify that the username is passed in as an argument. | |
| 33 if (username.empty()) { | |
| 34 LOG(ERROR) << "No username passed in, can't authenticate without that!"; | |
| 35 return -1; | |
| 36 } else { | |
|
joedow
2015/06/08 17:20:04
no need for an else clause here.
| |
| 37 DVLOG(1) << "Running chromoting tests as: " << username; | |
| 38 } | |
| 39 | |
| 40 return 0; | |
| 41 } | |
| 42 | |
| OLD | NEW |