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

Unified Diff: base/synchronization/waitable_event_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, 12 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/synchronization/waitable_event_posix.cc ('k') | base/synchronization/waitable_event_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/waitable_event_unittest.cc
===================================================================
--- base/synchronization/waitable_event_unittest.cc (revision 70363)
+++ base/synchronization/waitable_event_unittest.cc (working copy)
@@ -1,19 +1,14 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/time.h"
-#include "base/waitable_event.h"
+#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
-using base::TimeDelta;
-using base::WaitableEvent;
+namespace base {
-namespace {
-typedef testing::Test WaitableEventTest;
-}
-
TEST(WaitableEventTest, ManualBasics) {
WaitableEvent event(true, false);
@@ -74,7 +69,7 @@
delete ev[i];
}
-class WaitableEventSignaler : public base::PlatformThread::Delegate {
+class WaitableEventSignaler : public PlatformThread::Delegate {
public:
WaitableEventSignaler(double seconds, WaitableEvent* ev)
: seconds_(seconds),
@@ -82,7 +77,7 @@
}
void ThreadMain() {
- base::PlatformThread::Sleep(static_cast<int>(seconds_ * 1000));
+ PlatformThread::Sleep(static_cast<int>(seconds_ * 1000));
ev_->Signal();
}
@@ -97,13 +92,15 @@
ev[i] = new WaitableEvent(false, false);
WaitableEventSignaler signaler(0.1, ev[2]);
- base::PlatformThreadHandle thread;
- base::PlatformThread::Create(0, &signaler, &thread);
+ PlatformThreadHandle thread;
+ PlatformThread::Create(0, &signaler, &thread);
EXPECT_EQ(WaitableEvent::WaitMany(ev, 5), 2u);
- base::PlatformThread::Join(thread);
+ PlatformThread::Join(thread);
for (unsigned i = 0; i < 5; ++i)
delete ev[i];
}
+
+} // namespace base
« no previous file with comments | « base/synchronization/waitable_event_posix.cc ('k') | base/synchronization/waitable_event_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698