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

Side by Side Diff: base/thread_unittest.cc

Issue 12474: Reverting 5974. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 12 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/thread.cc ('k') | chrome/browser/printing/print_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/lock.h" 5 #include "base/lock.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/platform_test.h" 7 #include "base/platform_test.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/thread.h" 9 #include "base/thread.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 a.message_loop()->PostTask(FROM_HERE, new ToggleValue(&was_invoked)); 90 a.message_loop()->PostTask(FROM_HERE, new ToggleValue(&was_invoked));
91 } 91 }
92 EXPECT_TRUE(was_invoked); 92 EXPECT_TRUE(was_invoked);
93 } 93 }
94 94
95 TEST_F(ThreadTest, StopSoon) { 95 TEST_F(ThreadTest, StopSoon) {
96 Thread a("StopSoon"); 96 Thread a("StopSoon");
97 EXPECT_TRUE(a.Start()); 97 EXPECT_TRUE(a.Start());
98 EXPECT_TRUE(a.message_loop()); 98 EXPECT_TRUE(a.message_loop());
99 a.StopSoon(); 99 a.StopSoon();
100 EXPECT_FALSE(a.message_loop());
101 a.StopSoon(); 100 a.StopSoon();
101 a.Stop();
102 EXPECT_FALSE(a.message_loop()); 102 EXPECT_FALSE(a.message_loop());
103 } 103 }
104 104
105 TEST_F(ThreadTest, ThreadName) { 105 TEST_F(ThreadTest, ThreadName) {
106 Thread a("ThreadName"); 106 Thread a("ThreadName");
107 EXPECT_TRUE(a.Start()); 107 EXPECT_TRUE(a.Start());
108 EXPECT_EQ("ThreadName", a.thread_name()); 108 EXPECT_EQ("ThreadName", a.thread_name());
109 } 109 }
OLDNEW
« no previous file with comments | « base/thread.cc ('k') | chrome/browser/printing/print_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698