| 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/io_buffer.h" | 5 #include "net/base/io_buffer.h" |
| 6 #include "net/filter/filter.h" | 6 #include "net/filter/filter.h" |
| 7 #include "net/filter/mock_filter_context.h" | 7 #include "net/filter/mock_filter_context.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 class PassThroughFilter : public Filter { | 14 class PassThroughFilter : public Filter { |
| 15 public: | 15 public: |
| 16 PassThroughFilter() {} | 16 PassThroughFilter() : Filter(FILTER_TYPE_UNSUPPORTED) {} |
| 17 | 17 |
| 18 FilterStatus ReadFilteredData(char* dest_buffer, int* dest_len) override { | 18 FilterStatus ReadFilteredData(char* dest_buffer, int* dest_len) override { |
| 19 return CopyOut(dest_buffer, dest_len); | 19 return CopyOut(dest_buffer, dest_len); |
| 20 } | 20 } |
| 21 | 21 |
| 22 DISALLOW_COPY_AND_ASSIGN(PassThroughFilter); | 22 DISALLOW_COPY_AND_ASSIGN(PassThroughFilter); |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 amount_to_copy); | 438 amount_to_copy); |
| 439 filter1->FlushStreamBuffer(amount_to_copy); | 439 filter1->FlushStreamBuffer(amount_to_copy); |
| 440 read_array_index += amount_to_copy; | 440 read_array_index += amount_to_copy; |
| 441 } while (true); | 441 } while (true); |
| 442 | 442 |
| 443 EXPECT_EQ(read_array_index, input_array_size); | 443 EXPECT_EQ(read_array_index, input_array_size); |
| 444 EXPECT_EQ(compare_array_index, input_array_size); | 444 EXPECT_EQ(compare_array_index, input_array_size); |
| 445 } | 445 } |
| 446 | 446 |
| 447 } // Namespace net | 447 } // Namespace net |
| OLD | NEW |