OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "chrome/browser/chromeos/policy/upload_job.h" | 5 #include "chrome/browser/chromeos/policy/upload_job.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 const char kTokenValid[] = "VALID_TOKEN"; | 44 const char kTokenValid[] = "VALID_TOKEN"; |
45 | 45 |
46 class RepeatingMimeBoundaryGenerator | 46 class RepeatingMimeBoundaryGenerator |
47 : public UploadJobImpl::MimeBoundaryGenerator { | 47 : public UploadJobImpl::MimeBoundaryGenerator { |
48 public: | 48 public: |
49 explicit RepeatingMimeBoundaryGenerator(char character) | 49 explicit RepeatingMimeBoundaryGenerator(char character) |
50 : character_(character) {} | 50 : character_(character) {} |
51 ~RepeatingMimeBoundaryGenerator() override {} | 51 ~RepeatingMimeBoundaryGenerator() override {} |
52 | 52 |
53 // MimeBoundaryGenerator: | 53 // MimeBoundaryGenerator: |
54 std::string GenerateBoundary(size_t length) const override { | 54 std::string GenerateBoundary() const override { |
55 return std::string(length, character_); | 55 const int kMimeBoundarySize = 32; |
| 56 return std::string(kMimeBoundarySize, character_); |
56 } | 57 } |
57 | 58 |
58 private: | 59 private: |
59 const char character_; | 60 const char character_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(RepeatingMimeBoundaryGenerator); | 62 DISALLOW_COPY_AND_ASSIGN(RepeatingMimeBoundaryGenerator); |
62 }; | 63 }; |
63 | 64 |
64 class MockOAuth2TokenService : public FakeOAuth2TokenService { | 65 class MockOAuth2TokenService : public FakeOAuth2TokenService { |
65 public: | 66 public: |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 "customfield2: CUSTOM2\r\n" | 338 "customfield2: CUSTOM2\r\n" |
338 "\r\n" | 339 "\r\n" |
339 "**||--||PAYLOAD2||--||**\r\n--" | 340 "**||--||PAYLOAD2||--||**\r\n--" |
340 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA--\r\n"); | 341 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA--\r\n"); |
341 | 342 |
342 upload_job->Start(); | 343 upload_job->Start(); |
343 run_loop_.Run(); | 344 run_loop_.Run(); |
344 } | 345 } |
345 | 346 |
346 } // namespace policy | 347 } // namespace policy |
OLD | NEW |