diff options
author | lambroslambrou <lambroslambrou@chromium.org> | 2016-03-22 18:21:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 01:23:43 +0000 |
commit | e0c2d024129428c1e44fb7dfc198de7fdc427eb3 (patch) | |
tree | e0f6a023ae2b161173c2aadf4f0b6fb741bdeab3 /remoting/client/chromoting_client_runtime_unittest.cc | |
parent | 1c4eeac676562ac084da146ffad80e78d56c0b62 (diff) | |
download | chromium_src-e0c2d024129428c1e44fb7dfc198de7fdc427eb3.zip chromium_src-e0c2d024129428c1e44fb7dfc198de7fdc427eb3.tar.gz chromium_src-e0c2d024129428c1e44fb7dfc198de7fdc427eb3.tar.bz2 |
Reland: Adding container class for chromoting client runtimes.
Reland http://crrev.com/1764503002 with fixes for the Android app and
tests:
* Initialize ChromotingClientRuntime::ui_task_runner_
* Add new unittest to GN build.
* Don't call MessageLoopForUI::Start() in Android test.
TBR=nicholss
Review URL: https://codereview.chromium.org/1827573002
Cr-Commit-Position: refs/heads/master@{#382757}
Diffstat (limited to 'remoting/client/chromoting_client_runtime_unittest.cc')
-rw-r--r-- | remoting/client/chromoting_client_runtime_unittest.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/remoting/client/chromoting_client_runtime_unittest.cc b/remoting/client/chromoting_client_runtime_unittest.cc new file mode 100644 index 0000000..39f240f --- /dev/null +++ b/remoting/client/chromoting_client_runtime_unittest.cc @@ -0,0 +1,37 @@ +// 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 { + +#if defined(OS_IOS) || defined(OS_ANDROID) + +// 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) { + scoped_ptr<base::MessageLoopForUI> ui_loop; + ui_loop.reset(new base::MessageLoopForUI()); +#if defined(OS_IOS) + ui_loop->Attach(); +#endif + + scoped_ptr<ChromotingClientRuntime> runtime = + ChromotingClientRuntime::Create(ui_loop.get()); + + ASSERT_TRUE(runtime); + 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()); +} + +#endif + +} // namespace remoting |