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 "net/base/upload_data_stream.h" | 5 #include "net/base/upload_data_stream.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/files/scoped_temp_dir.h" | 14 #include "base/files/scoped_temp_dir.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
17 #include "base/time.h" | 17 #include "base/time/time.h" |
18 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
19 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
20 #include "net/base/test_completion_callback.h" | 20 #include "net/base/test_completion_callback.h" |
21 #include "net/base/upload_bytes_element_reader.h" | 21 #include "net/base/upload_bytes_element_reader.h" |
22 #include "net/base/upload_file_element_reader.h" | 22 #include "net/base/upload_file_element_reader.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 #include "testing/platform_test.h" | 25 #include "testing/platform_test.h" |
26 | 26 |
27 using ::testing::DoAll; | 27 using ::testing::DoAll; |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 wrapped_buffer2.get(), buf2.size(), read_callback2.callback())); | 805 wrapped_buffer2.get(), buf2.size(), read_callback2.callback())); |
806 EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult()); | 806 EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult()); |
807 EXPECT_EQ(expected_data, buf2); | 807 EXPECT_EQ(expected_data, buf2); |
808 EXPECT_TRUE(stream.IsEOF()); | 808 EXPECT_TRUE(stream.IsEOF()); |
809 | 809 |
810 // Make sure callbacks are not called for cancelled operations. | 810 // Make sure callbacks are not called for cancelled operations. |
811 EXPECT_FALSE(read_callback1.have_result()); | 811 EXPECT_FALSE(read_callback1.have_result()); |
812 } | 812 } |
813 | 813 |
814 } // namespace net | 814 } // namespace net |
OLD | NEW |