OLD | NEW |
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 "net/base/chunked_upload_data_stream.h" | 5 #include "net/base/chunked_upload_data_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/base/test_completion_callback.h" | 12 #include "net/base/test_completion_callback.h" |
13 #include "net/base/upload_data_stream.h" | 13 #include "net/base/upload_data_stream.h" |
| 14 #include "net/log/net_log_with_source.h" |
14 #include "net/test/gtest_util.h" | 15 #include "net/test/gtest_util.h" |
15 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 | 18 |
18 using net::test::IsError; | 19 using net::test::IsError; |
19 using net::test::IsOk; | 20 using net::test::IsOk; |
20 | 21 |
21 namespace net { | 22 namespace net { |
22 | 23 |
23 namespace { | 24 namespace { |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 std::string data = ReadSync(stream.get(), kTestBufferSize); | 357 std::string data = ReadSync(stream.get(), kTestBufferSize); |
357 EXPECT_EQ(kTestData, data); | 358 EXPECT_EQ(kTestData, data); |
358 | 359 |
359 // Writing data should gracefully fail if the stream is deleted while still | 360 // Writing data should gracefully fail if the stream is deleted while still |
360 // appending data to it. | 361 // appending data to it. |
361 stream.reset(); | 362 stream.reset(); |
362 EXPECT_FALSE(writer->AppendData(kTestData, kTestDataSize, true)); | 363 EXPECT_FALSE(writer->AppendData(kTestData, kTestDataSize, true)); |
363 } | 364 } |
364 | 365 |
365 } // namespace net | 366 } // namespace net |
OLD | NEW |