OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 const int kCropSizes[] = {1, -1}; | 29 const int kCropSizes[] = {1, -1}; |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 class CompoundBufferTest : public testing::Test { | 33 class CompoundBufferTest : public testing::Test { |
34 public: | 34 public: |
35 | 35 |
36 // Following 5 methods are used with IterateOverPieces(). | 36 // Following 5 methods are used with IterateOverPieces(). |
37 void Append(int pos, int size) { | 37 void Append(int pos, int size) { |
38 target_.Append(data_, data_->data() + pos, size); | 38 target_.Append(data_.get(), data_->data() + pos, size); |
39 } | 39 } |
40 | 40 |
41 void AppendCopyOf(int pos, int size) { | 41 void AppendCopyOf(int pos, int size) { |
42 target_.AppendCopyOf(data_->data() + pos, size); | 42 target_.AppendCopyOf(data_->data() + pos, size); |
43 } | 43 } |
44 | 44 |
45 void Prepend(int pos, int size) { | 45 void Prepend(int pos, int size) { |
46 target_.Prepend(data_, data_->data() + kDataSize - pos - size, size); | 46 target_.Prepend(data_.get(), data_->data() + kDataSize - pos - size, size); |
47 } | 47 } |
48 | 48 |
49 void PrependCopyOf(int pos, int size) { | 49 void PrependCopyOf(int pos, int size) { |
50 target_.PrependCopyOf(data_->data() + (kDataSize - pos - size), size); | 50 target_.PrependCopyOf(data_->data() + (kDataSize - pos - size), size); |
51 } | 51 } |
52 | 52 |
53 void TestCopyFrom(int pos, int size) { | 53 void TestCopyFrom(int pos, int size) { |
54 CompoundBuffer copy; | 54 CompoundBuffer copy; |
55 copy.CopyFrom(target_, pos, pos + size); | 55 copy.CopyFrom(target_, pos, pos + size); |
56 EXPECT_TRUE(CompareData(copy, data_->data() + pos, size)); | 56 EXPECT_TRUE(CompareData(copy, data_->data() + pos, size)); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 ReadString(&stream, "MultipleArrayInput"); | 269 ReadString(&stream, "MultipleArrayInput"); |
270 EXPECT_TRUE(stream.Skip(6)); | 270 EXPECT_TRUE(stream.Skip(6)); |
271 ReadString(&stream, "f"); | 271 ReadString(&stream, "f"); |
272 ReadString(&stream, "o"); | 272 ReadString(&stream, "o"); |
273 ReadString(&stream, "r"); | 273 ReadString(&stream, "r"); |
274 ReadString(&stream, " "); | 274 ReadString(&stream, " "); |
275 ReadString(&stream, "Chromoting"); | 275 ReadString(&stream, "Chromoting"); |
276 } | 276 } |
277 | 277 |
278 } // namespace remoting | 278 } // namespace remoting |
OLD | NEW |