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

Side by Side Diff: chrome/test/thread_test_helper.h

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 | « chrome/test/thread_observer_helper.h ('k') | chrome_frame/cfproxy_test.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 #ifndef CHROME_TEST_THREAD_TEST_HELPER_H_ 5 #ifndef CHROME_TEST_THREAD_TEST_HELPER_H_
6 #define CHROME_TEST_THREAD_TEST_HELPER_H_ 6 #define CHROME_TEST_THREAD_TEST_HELPER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
10 #include "base/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
11 #include "chrome/browser/browser_thread.h" 11 #include "chrome/browser/browser_thread.h"
12 12
13 // Helper class that executes code on a given thread while blocking on the 13 // Helper class that executes code on a given thread while blocking on the
14 // invoking thread (normally the UI thread). To use, derive from this class and 14 // invoking thread (normally the UI thread). To use, derive from this class and
15 // overwrite RunTest. An alternative use of this class is to use it directly. 15 // overwrite RunTest. An alternative use of this class is to use it directly.
16 // It will then block until all pending tasks on a given thread have been 16 // It will then block until all pending tasks on a given thread have been
17 // executed. 17 // executed.
18 class ThreadTestHelper : public base::RefCountedThreadSafe<ThreadTestHelper> { 18 class ThreadTestHelper : public base::RefCountedThreadSafe<ThreadTestHelper> {
19 public: 19 public:
20 explicit ThreadTestHelper(BrowserThread::ID thread_id) 20 explicit ThreadTestHelper(BrowserThread::ID thread_id)
(...skipping 29 matching lines...) Expand all
50 } 50 }
51 51
52 bool test_result_; 52 bool test_result_;
53 BrowserThread::ID thread_id_; 53 BrowserThread::ID thread_id_;
54 base::WaitableEvent done_event_; 54 base::WaitableEvent done_event_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(ThreadTestHelper); 56 DISALLOW_COPY_AND_ASSIGN(ThreadTestHelper);
57 }; 57 };
58 58
59 #endif // CHROME_TEST_THREAD_TEST_HELPER_H_ 59 #endif // CHROME_TEST_THREAD_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/test/thread_observer_helper.h ('k') | chrome_frame/cfproxy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698