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

Unified Diff: base/threading/simple_thread_unittest.cc

Issue 2223433003: Revert of Add joinable option to SimpleThread::Options as was just done for Thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b1_nonjoinable_thread
Patch Set: Created 4 years, 4 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
« no previous file with comments | « base/threading/simple_thread.cc ('k') | content/renderer/categorized_worker_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/simple_thread_unittest.cc
diff --git a/base/threading/simple_thread_unittest.cc b/base/threading/simple_thread_unittest.cc
index 6c64a04f2e8bbb2e4a036e7bdd2e871fe782f9b2..14dd4591f1819d8e505911cd9f4cb9fb09cd54f2 100644
--- a/base/threading/simple_thread_unittest.cc
+++ b/base/threading/simple_thread_unittest.cc
@@ -2,28 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <memory>
-
#include "base/atomic_sequence_num.h"
#include "base/strings/string_number_conversions.h"
#include "base/synchronization/waitable_event.h"
-#include "base/test/gtest_util.h"
-#include "base/threading/platform_thread.h"
#include "base/threading/simple_thread.h"
-#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
-
-// Sleeps a tiny amount to augment chances of tests using it running in races
-// should there be any while the tested thread is alive.
-class SleepRunner : public DelegateSimpleThread::Delegate {
- void Run() override {
- PlatformThread::Sleep(TimeDelta::FromMilliseconds(20));
- }
-};
class SetIntRunner : public DelegateSimpleThread::Delegate {
public:
@@ -146,25 +133,6 @@
std::string("event_waiter/") + IntToString(thread.tid()));
}
-TEST(SimpleThreadTest, JoinNonJoinableThreadDeath) {
- SleepRunner runner;
- SimpleThread::Options options;
- options.joinable = false;
- DelegateSimpleThread thread(&runner, "noop_runner", options);
-
- thread.Start();
- EXPECT_DCHECK_DEATH(thread.Join(), "");
-}
-
-TEST(SimpleThreadTest, DeleteNonJoinableWithoutJoinIsSafe) {
- SleepRunner runner;
- SimpleThread::Options options;
- options.joinable = false;
- DelegateSimpleThread thread(&runner, "noop_runner", options);
- thread.Start();
- // Nothing blows up when |thread| goes out of scope.
-}
-
TEST(SimpleThreadTest, ThreadPool) {
AtomicSequenceNumber seq;
SeqRunner runner(&seq);
« no previous file with comments | « base/threading/simple_thread.cc ('k') | content/renderer/categorized_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698