Chromium Code Reviews| Index: remoting/test/chromoting_test_driver.cc |
| diff --git a/remoting/test/chromoting_test_driver.cc b/remoting/test/chromoting_test_driver.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d976593c6c1f2189a53c2585a7d269fb9b703b46 |
| --- /dev/null |
| +++ b/remoting/test/chromoting_test_driver.cc |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +#include <string> |
|
joedow
2015/06/08 17:20:04
add newline between comment and include statement.
|
| + |
| +#include "base/command_line.h" |
| +#include "base/test/test_suite.h" |
| +#include "base/test/test_switches.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace switches { |
| +const char kSingleProcessTestsSwitchName[] = "single-process-tests"; |
| +const char kUserNameSwitchName[] = "username"; |
| +} |
| + |
| +int main(int argc, char* argv[]) { |
| + testing::InitGoogleTest(&argc, argv); |
| + base::TestSuite test_suite(argc, argv); |
| + |
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| + DCHECK(command_line); |
| + |
| + // Do not retry if tests fails. |
| + command_line->AppendSwitchASCII(switches::kTestLauncherRetryLimit, "0"); |
| + |
| + // Do not run tests in parallel. Interactions between the host and test |
| + // client should not interfere with another test client. |
|
joedow
2015/06/08 17:20:04
Can you reword this comment to describe the constr
|
| + command_line->AppendSwitch(switches::kSingleProcessTestsSwitchName); |
| + |
| + std::string username( |
| + command_line->GetSwitchValueASCII(switches::kUserNameSwitchName)); |
| + // Verify that the username is passed in as an argument. |
| + if (username.empty()) { |
| + LOG(ERROR) << "No username passed in, can't authenticate without that!"; |
| + return -1; |
| + } else { |
|
joedow
2015/06/08 17:20:04
no need for an else clause here.
|
| + DVLOG(1) << "Running chromoting tests as: " << username; |
| + } |
| + |
| + return 0; |
| +} |
| + |