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

Side by Side Diff: base/lock_unittest.cc

Issue 6001010: Move platform_thread to base/threading and put in the base namespace. I left ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/lock.cc ('k') | base/message_loop_unittest.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "base/platform_thread.h" 9 #include "base/threading/platform_thread.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 using base::kNullThreadHandle;
13 using base::PlatformThread;
14 using base::PlatformThreadHandle;
15
12 typedef testing::Test LockTest; 16 typedef testing::Test LockTest;
13 17
14 // Basic test to make sure that Acquire()/Release()/Try() don't crash ---------- 18 // Basic test to make sure that Acquire()/Release()/Try() don't crash ----------
15 19
16 class BasicLockTestThread : public PlatformThread::Delegate { 20 class BasicLockTestThread : public PlatformThread::Delegate {
17 public: 21 public:
18 BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {} 22 BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {}
19 23
20 virtual void ThreadMain() { 24 virtual void ThreadMain() {
21 for (int i = 0; i < 10; i++) { 25 for (int i = 0; i < 10; i++) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 ASSERT_TRUE(PlatformThread::Create(0, &thread3, &handle3)); 208 ASSERT_TRUE(PlatformThread::Create(0, &thread3, &handle3));
205 209
206 MutexLockTestThread::DoStuff(&lock, &value); 210 MutexLockTestThread::DoStuff(&lock, &value);
207 211
208 PlatformThread::Join(handle1); 212 PlatformThread::Join(handle1);
209 PlatformThread::Join(handle2); 213 PlatformThread::Join(handle2);
210 PlatformThread::Join(handle3); 214 PlatformThread::Join(handle3);
211 215
212 EXPECT_EQ(4 * 40, value); 216 EXPECT_EQ(4 * 40, value);
213 } 217 }
OLDNEW
« no previous file with comments | « base/lock.cc ('k') | base/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698