Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: chrome/browser/chromeos/policy/upload_job_unittest.cc

Issue 1547593002: Introducing a net::GenerateMimeMultipartBoundary helper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698