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/elements_upload_data_stream.h" | 5 #include "net/base/elements_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" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 int init_result_; | 118 int init_result_; |
119 | 119 |
120 // Result value returned from Read(). | 120 // Result value returned from Read(). |
121 int read_result_; | 121 int read_result_; |
122 }; | 122 }; |
123 | 123 |
124 } // namespace | 124 } // namespace |
125 | 125 |
126 class ElementsUploadDataStreamTest : public PlatformTest { | 126 class ElementsUploadDataStreamTest : public PlatformTest { |
127 public: | 127 public: |
128 virtual void SetUp() { | 128 void SetUp() override { |
129 PlatformTest::SetUp(); | 129 PlatformTest::SetUp(); |
130 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 130 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
131 } | 131 } |
132 virtual ~ElementsUploadDataStreamTest() { | 132 ~ElementsUploadDataStreamTest() override { |
133 element_readers_.clear(); | 133 element_readers_.clear(); |
134 base::RunLoop().RunUntilIdle(); | 134 base::RunLoop().RunUntilIdle(); |
135 } | 135 } |
136 | 136 |
137 void FileChangedHelper(const base::FilePath& file_path, | 137 void FileChangedHelper(const base::FilePath& file_path, |
138 const base::Time& time, | 138 const base::Time& time, |
139 bool error_expected); | 139 bool error_expected); |
140 | 140 |
141 base::ScopedTempDir temp_dir_; | 141 base::ScopedTempDir temp_dir_; |
142 ScopedVector<UploadElementReader> element_readers_; | 142 ScopedVector<UploadElementReader> element_readers_; |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 wrapped_buffer2.get(), buf2.size(), read_callback2.callback())); | 812 wrapped_buffer2.get(), buf2.size(), read_callback2.callback())); |
813 EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult()); | 813 EXPECT_EQ(static_cast<int>(buf2.size()), read_callback2.WaitForResult()); |
814 EXPECT_EQ(expected_data, buf2); | 814 EXPECT_EQ(expected_data, buf2); |
815 EXPECT_TRUE(stream->IsEOF()); | 815 EXPECT_TRUE(stream->IsEOF()); |
816 | 816 |
817 // Make sure callbacks are not called for cancelled operations. | 817 // Make sure callbacks are not called for cancelled operations. |
818 EXPECT_FALSE(read_callback1.have_result()); | 818 EXPECT_FALSE(read_callback1.have_result()); |
819 } | 819 } |
820 | 820 |
821 } // namespace net | 821 } // namespace net |
OLD | NEW |