OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/audio/async_socket_io_handler.h" | 5 #include "base/async_socket_io_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 const char kAsyncSocketIoTestString[] = "Hello, AsyncSocketIoHandler"; | 11 const char kAsyncSocketIoTestString[] = "Hello, AsyncSocketIoHandler"; |
12 const size_t kAsyncSocketIoTestStringLength = | 12 const size_t kAsyncSocketIoTestStringLength = |
13 arraysize(kAsyncSocketIoTestString); | 13 arraysize(kAsyncSocketIoTestString); |
14 | 14 |
15 class TestSocketReader { | 15 class TestSocketReader { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 const int kReadOperationCount = 1; | 160 const int kReadOperationCount = 1; |
161 TestSocketReader reader(&pair[0], kReadOperationCount, false, true); | 161 TestSocketReader reader(&pair[0], kReadOperationCount, false, true); |
162 EXPECT_TRUE(reader.IssueRead()); | 162 EXPECT_TRUE(reader.IssueRead()); |
163 | 163 |
164 pair[1].Close(); | 164 pair[1].Close(); |
165 | 165 |
166 base::MessageLoop::current()->Run(); | 166 base::MessageLoop::current()->Run(); |
167 EXPECT_EQ(kReadOperationCount, reader.callbacks_received()); | 167 EXPECT_EQ(kReadOperationCount, reader.callbacks_received()); |
168 } | 168 } |
OLD | NEW |