Chromium Code Reviews| Index: content/public/test/test_browser_thread_bundle_unittest.cc |
| diff --git a/content/public/test/test_browser_thread_bundle_unittest.cc b/content/public/test/test_browser_thread_bundle_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..811732fc529a03d87f593c4c182812e7ae11cd15 |
| --- /dev/null |
| +++ b/content/public/test/test_browser_thread_bundle_unittest.cc |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2017 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 "content/public/test/test_browser_thread_bundle.h" |
| + |
| +#include "base/message_loop/message_loop.h" |
| +#include "base/test/gtest_util.h" |
| +#include "base/test/scoped_task_environment.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace content { |
| + |
| +TEST(TestBrowserThreadBundle, MessageLoopForUIAndTestBrowserThreadBundle) { |
| + base::MessageLoopForUI message_loop; |
| + TestBrowserThreadBundle test_browser_thread_bundle; |
|
gab
2017/05/03 15:33:10
I don't think we need to support this use case.
fdoray
2017/05/03 17:03:50
Done.
|
| +} |
| + |
| +TEST(TestBrowserThreadBundle, ScopedTaskEnvironmentAndTestBrowserThreadBundle) { |
| + base::test::ScopedTaskEnvironment scoped_task_environment( |
| + base::test::ScopedTaskEnvironment::MainThreadType::UI); |
| + TestBrowserThreadBundle test_browser_thread_bundle; |
| +} |
| + |
| +TEST(TestBrowserThreadBundleTest, MessageLoopTypeMismatch) { |
| + base::MessageLoopForUI message_loop; |
| + EXPECT_DCHECK_DEATH({ |
| + TestBrowserThreadBundle test_browser_thread_bundle( |
| + TestBrowserThreadBundle::IO_MAINLOOP); |
| + }); |
| +} |
| + |
| +TEST(TestBrowserThreadBundleTest, MultipleTestBrowserThreadBundle) { |
| + TestBrowserThreadBundle test_browser_thread_bundle; |
| + EXPECT_DCHECK_DEATH( |
| + { TestBrowserThreadBundle other_test_browser_thread_bundle; }); |
| +} |
| + |
| +} // namespace content |