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

Unified Diff: remoting/client/chromoting_client_runtime_unittest.cc

Issue 1764503002: Adding container class for chromoting client runtimes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jni runtime now holds a scoped_ptr<ChromotingClientRuntime>. Created 4 years, 9 months 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: remoting/client/chromoting_client_runtime_unittest.cc
diff --git a/remoting/client/chromoting_client_runtime_unittest.cc b/remoting/client/chromoting_client_runtime_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..45609e65fdb152a2bc2f2a067e61604ee3f441a1
--- /dev/null
+++ b/remoting/client/chromoting_client_runtime_unittest.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 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 "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "remoting/base/auto_thread_task_runner.h"
+#include "remoting/client/chromoting_client_runtime.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace remoting {
+
+// A simple test that starts and stop the runtime. This tests the runtime
+// operates properly and all threads and message loops are valid.
+TEST(ChromotingClientRuntimeTest, StartAndStop) {
+ base::MessageLoopForUI message_loop;
+ base::RunLoop run_loop;
+
+ scoped_ptr<ChromotingClientRuntime> runtime =
+ ChromotingClientRuntime::Create();
+
+ EXPECT_TRUE(runtime);
Lambros 2016/03/09 00:06:18 EXPECT_TRUE(x); if (!x) return; can be replaced wi
nicholss 2016/03/09 16:54:27 Done.
+ if (!runtime)
+ return;
+ EXPECT_TRUE(runtime->network_task_runner().get());
+ EXPECT_TRUE(runtime->ui_task_runner().get());
+ EXPECT_TRUE(runtime->display_task_runner().get());
+ EXPECT_TRUE(runtime->file_task_runner().get());
+ EXPECT_TRUE(runtime->url_requester().get());
+
+ runtime.reset();
Lambros 2016/03/09 00:06:18 This line is a no-op, |runtime| goes out of scope
nicholss 2016/03/09 16:54:28 Done.
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698