| 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 <queue> | 7 #include <queue> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const char kTokenValid[] = "VALID_TOKEN"; | 41 const char kTokenValid[] = "VALID_TOKEN"; |
| 42 | 42 |
| 43 class RepeatingMimeBoundaryGenerator | 43 class RepeatingMimeBoundaryGenerator |
| 44 : public UploadJobImpl::MimeBoundaryGenerator { | 44 : public UploadJobImpl::MimeBoundaryGenerator { |
| 45 public: | 45 public: |
| 46 explicit RepeatingMimeBoundaryGenerator(char character) | 46 explicit RepeatingMimeBoundaryGenerator(char character) |
| 47 : character_(character) {} | 47 : character_(character) {} |
| 48 ~RepeatingMimeBoundaryGenerator() override {} | 48 ~RepeatingMimeBoundaryGenerator() override {} |
| 49 | 49 |
| 50 // MimeBoundaryGenerator: | 50 // MimeBoundaryGenerator: |
| 51 std::string GenerateBoundary(size_t length) const override { | 51 std::string GenerateBoundary() const override { |
| 52 return std::string(length, character_); | 52 const int kMimeBoundarySize = 32; |
| 53 return std::string(kMimeBoundarySize, character_); |
| 53 } | 54 } |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 const char character_; | 57 const char character_; |
| 57 | 58 |
| 58 DISALLOW_COPY_AND_ASSIGN(RepeatingMimeBoundaryGenerator); | 59 DISALLOW_COPY_AND_ASSIGN(RepeatingMimeBoundaryGenerator); |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 class MockOAuth2TokenService : public FakeOAuth2TokenService { | 62 class MockOAuth2TokenService : public FakeOAuth2TokenService { |
| 62 public: | 63 public: |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 "customfield2: CUSTOM2\r\n" | 334 "customfield2: CUSTOM2\r\n" |
| 334 "\r\n" | 335 "\r\n" |
| 335 "**||--||PAYLOAD2||--||**\r\n--" | 336 "**||--||PAYLOAD2||--||**\r\n--" |
| 336 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA--\r\n"); | 337 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA--\r\n"); |
| 337 | 338 |
| 338 upload_job->Start(); | 339 upload_job->Start(); |
| 339 run_loop_.Run(); | 340 run_loop_.Run(); |
| 340 } | 341 } |
| 341 | 342 |
| 342 } // namespace policy | 343 } // namespace policy |
| OLD | NEW |