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

Side by Side Diff: net/base/listen_socket_unittest.cc

Issue 6142009: Upating the app, ceee, chrome, ipc, media, and net directories to use the correct lock.h file. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Unified patch updating all references to the new base/synchronization/lock.h 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 | « net/base/keygen_handler_mac.cc ('k') | net/base/net_util.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 "net/base/listen_socket_unittest.h" 5 #include "net/base/listen_socket_unittest.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 9
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 loop_->PostTask(FROM_HERE, NewRunnableMethod( 66 loop_->PostTask(FROM_HERE, NewRunnableMethod(
67 this, &ListenSocketTester::Shutdown)); 67 this, &ListenSocketTester::Shutdown));
68 NextAction(); 68 NextAction();
69 ASSERT_EQ(ACTION_SHUTDOWN, last_action_.type()); 69 ASSERT_EQ(ACTION_SHUTDOWN, last_action_.type());
70 70
71 thread_.reset(); 71 thread_.reset();
72 loop_ = NULL; 72 loop_ = NULL;
73 } 73 }
74 74
75 void ListenSocketTester::ReportAction(const ListenSocketTestAction& action) { 75 void ListenSocketTester::ReportAction(const ListenSocketTestAction& action) {
76 AutoLock locked(lock_); 76 base::AutoLock locked(lock_);
77 queue_.push_back(action); 77 queue_.push_back(action);
78 cv_.Broadcast(); 78 cv_.Broadcast();
79 } 79 }
80 80
81 void ListenSocketTester::NextAction() { 81 void ListenSocketTester::NextAction() {
82 AutoLock locked(lock_); 82 base::AutoLock locked(lock_);
83 while (queue_.empty()) 83 while (queue_.empty())
84 cv_.Wait(); 84 cv_.Wait();
85 last_action_ = queue_.front(); 85 last_action_ = queue_.front();
86 queue_.pop_front(); 86 queue_.pop_front();
87 } 87 }
88 88
89 int ListenSocketTester::ClearTestSocket() { 89 int ListenSocketTester::ClearTestSocket() {
90 char buf[kReadBufSize]; 90 char buf[kReadBufSize];
91 int len_ret = 0; 91 int len_ret = 0;
92 do { 92 do {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 tester_->TestClientSend(); 226 tester_->TestClientSend();
227 } 227 }
228 228
229 TEST_F(ListenSocketTest, ClientSendLong) { 229 TEST_F(ListenSocketTest, ClientSendLong) {
230 tester_->TestClientSendLong(); 230 tester_->TestClientSendLong();
231 } 231 }
232 232
233 TEST_F(ListenSocketTest, ServerSend) { 233 TEST_F(ListenSocketTest, ServerSend) {
234 tester_->TestServerSend(); 234 tester_->TestServerSend();
235 } 235 }
OLDNEW
« no previous file with comments | « net/base/keygen_handler_mac.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698