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..c47cb58f3dca1f07e2653dea2d3408f73907a210 |
--- /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> |
+ |
+#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 18:35:20
Can you make this comment more clear about why you
tonychun
2015/06/08 20:35:58
This is an old comment. I should have changed it.
|
+ 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; |
+ } |
+ DVLOG(1) << "Running chromoting tests as: " << username; |
+ |
+ return 0; |
Sergey Ulanov
2015/06/08 18:57:37
This doesn't actually run any tests. Is this inten
tonychun
2015/06/08 20:35:58
Yes. My first step was to just have a driver up an
|
+} |
+ |