Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: chromecast/browser/test/cast_test_launcher.cc

Issue 2502143002: Revert of [chromecast] Make testnames consistent. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromecast/browser/test/cast_test_launcher.cc
diff --git a/chromecast/browser/test/cast_test_launcher.cc b/chromecast/browser/test/cast_test_launcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2d3ae28b2a3fa703c6ba03727402bb2e257e4ae7
--- /dev/null
+++ b/chromecast/browser/test/cast_test_launcher.cc
@@ -0,0 +1,55 @@
+// Copyright 2016 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 <memory>
+
+#include "base/bind.h"
+#include "base/macros.h"
+#include "base/sys_info.h"
+#include "chromecast/app/cast_main_delegate.h"
+#include "chromecast/base/cast_paths.h"
+#include "content/public/test/content_test_suite_base.h"
+#include "content/public/test/test_launcher.h"
+#include "ipc/ipc_channel.h"
+#include "mojo/edk/embedder/embedder.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromecast {
+namespace shell {
+
+class CastTestLauncherDelegate : public content::TestLauncherDelegate {
+ public:
+ CastTestLauncherDelegate() {}
+ ~CastTestLauncherDelegate() override {}
+
+ int RunTestSuite(int argc, char** argv) override {
+ return base::TestSuite(argc, argv).Run();
+ }
+
+ bool AdjustChildProcessCommandLine(
+ base::CommandLine* command_line,
+ const base::FilePath& temp_data_dir) override {
+ return true;
+ }
+
+ protected:
+ content::ContentMainDelegate* CreateContentMainDelegate() override {
+ return new CastMainDelegate();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CastTestLauncherDelegate);
+};
+
+} // namespace shell
+} // namespace chromecast
+
+int main(int argc, char** argv) {
+ int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2);
+ chromecast::shell::CastTestLauncherDelegate launcher_delegate;
+ chromecast::RegisterPathProvider();
+ mojo::edk::SetMaxMessageSize(IPC::Channel::kMaximumMessageSize);
+ mojo::edk::Init();
+ return LaunchTests(&launcher_delegate, default_jobs, argc, argv);
+}
« no previous file with comments | « chromecast/browser/test/cast_navigation_browsertest.cc ('k') | chromecast/browser/test/chromecast_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698