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

Side by Side Diff: base/synchronization/cancellation_flag_unittest.cc

Issue 5977010: Move CancellationFlag and WaitableEvent to the synchronization subdirectory.... (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/synchronization/cancellation_flag.cc ('k') | base/synchronization/waitable_event.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Tests of CancellationFlag class. 5 // Tests of CancellationFlag class.
6 6
7 #include "base/cancellation_flag.h" 7 #include "base/synchronization/cancellation_flag.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
11 #include "base/spin_wait.h" 11 #include "base/spin_wait.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "testing/platform_test.h" 15 #include "testing/platform_test.h"
16 16
17 using base::CancellationFlag; 17 namespace base {
18 using base::TimeDelta;
19 using base::Thread;
20 18
21 namespace { 19 namespace {
22 20
23 //------------------------------------------------------------------------------ 21 //------------------------------------------------------------------------------
24 // Define our test class. 22 // Define our test class.
25 //------------------------------------------------------------------------------ 23 //------------------------------------------------------------------------------
26 24
27 class CancelTask : public Task { 25 class CancelTask : public Task {
28 public: 26 public:
29 explicit CancelTask(CancellationFlag* flag) : flag_(flag) {} 27 explicit CancelTask(CancellationFlag* flag) : flag_(flag) {}
(...skipping 28 matching lines...) Expand all
58 Thread t("CancellationFlagTest.SetOnDifferentThreadDeathTest"); 56 Thread t("CancellationFlagTest.SetOnDifferentThreadDeathTest");
59 ASSERT_TRUE(t.Start()); 57 ASSERT_TRUE(t.Start());
60 ASSERT_TRUE(t.message_loop()); 58 ASSERT_TRUE(t.message_loop());
61 ASSERT_TRUE(t.IsRunning()); 59 ASSERT_TRUE(t.IsRunning());
62 60
63 CancellationFlag flag; 61 CancellationFlag flag;
64 t.message_loop()->PostTask(FROM_HERE, new CancelTask(&flag)); 62 t.message_loop()->PostTask(FROM_HERE, new CancelTask(&flag));
65 } 63 }
66 64
67 } // namespace 65 } // namespace
66
67 } // namespace base
OLDNEW
« no previous file with comments | « base/synchronization/cancellation_flag.cc ('k') | base/synchronization/waitable_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698