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

Side by Side Diff: device/serial/data_sink_unittest.cc

Issue 507053002: Remove implicit conversions from scoped_refptr to T* in device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Regenerate Created 6 years, 3 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
« no previous file with comments | « device/serial/data_sink_receiver.cc ('k') | device/serial/data_source_sender.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/string_piece.h" 8 #include "base/strings/string_piece.h"
9 #include "device/serial/async_waiter.h" 9 #include "device/serial/async_waiter.h"
10 #include "device/serial/data_sender.h" 10 #include "device/serial/data_sender.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 base::Bind(&DataSinkTest::OnDataToRead, base::Unretained(this)), 43 base::Bind(&DataSinkTest::OnDataToRead, base::Unretained(this)),
44 base::Bind(&DataSinkTest::OnCancel, base::Unretained(this)), 44 base::Bind(&DataSinkTest::OnCancel, base::Unretained(this)),
45 base::Bind(&DataSinkTest::OnError, base::Unretained(this))), 45 base::Bind(&DataSinkTest::OnError, base::Unretained(this))),
46 &sink_handle); 46 &sink_handle);
47 sender_.reset(new DataSender(sink_handle.Pass(), kBufferSize, kFatalError)); 47 sender_.reset(new DataSender(sink_handle.Pass(), kBufferSize, kFatalError));
48 } 48 }
49 49
50 virtual void TearDown() OVERRIDE { 50 virtual void TearDown() OVERRIDE {
51 read_buffer_.reset(); 51 read_buffer_.reset();
52 message_loop_.reset(); 52 message_loop_.reset();
53 if (sink_receiver_) 53 if (sink_receiver_.get())
54 EXPECT_TRUE(sink_receiver_->HasOneRef()); 54 EXPECT_TRUE(sink_receiver_->HasOneRef());
55 } 55 }
56 56
57 void WaitForEvent(Event event) { 57 void WaitForEvent(Event event) {
58 expected_event_ = event; 58 expected_event_ = event;
59 base::RunLoop run_loop; 59 base::RunLoop run_loop;
60 stop_run_loop_ = run_loop.QuitClosure(); 60 stop_run_loop_ = run_loop.QuitClosure();
61 run_loop.Run(); 61 run_loop.Run();
62 } 62 }
63 63
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 sender_.reset(); 404 sender_.reset();
405 ExpectSendError(0, kFatalError); 405 ExpectSendError(0, kFatalError);
406 ExpectSendError(0, kFatalError); 406 ExpectSendError(0, kFatalError);
407 ExpectCancelResult(); 407 ExpectCancelResult();
408 if (!seen_connection_error_) 408 if (!seen_connection_error_)
409 WaitForEvent(EVENT_ERROR); 409 WaitForEvent(EVENT_ERROR);
410 EXPECT_TRUE(seen_connection_error_); 410 EXPECT_TRUE(seen_connection_error_);
411 } 411 }
412 412
413 } // namespace device 413 } // namespace device
OLDNEW
« no previous file with comments | « device/serial/data_sink_receiver.cc ('k') | device/serial/data_source_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698