| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 expected_content_ = expected_content; | 367 expected_content_ = expected_content; |
| 368 } | 368 } |
| 369 | 369 |
| 370 protected: | 370 protected: |
| 371 std::string expected_content_; | 371 std::string expected_content_; |
| 372 }; | 372 }; |
| 373 | 373 |
| 374 TEST_F(UploadRequestTest, TestRequestStructure) { | 374 TEST_F(UploadRequestTest, TestRequestStructure) { |
| 375 oauth2_service_.SetTokenValid(kTokenValid); | 375 oauth2_service_.SetTokenValid(kTokenValid); |
| 376 oauth2_service_.AddTokenToQueue(kTokenValid); | 376 oauth2_service_.AddTokenToQueue(kTokenValid); |
| 377 std::unique_ptr<UploadJob> upload_job = PrepareUploadJob( | 377 std::unique_ptr<UploadJob> upload_job = |
| 378 base::WrapUnique(new RepeatingMimeBoundaryGenerator('A'))); | 378 PrepareUploadJob(base::MakeUnique<RepeatingMimeBoundaryGenerator>('A')); |
| 379 SetExpectedRequestContent( | 379 SetExpectedRequestContent( |
| 380 "--AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n" | 380 "--AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n" |
| 381 "Content-Disposition: form-data; " | 381 "Content-Disposition: form-data; " |
| 382 "name=\"Name1\"; filename=\"file1.ext\"\r\n" | 382 "name=\"Name1\"; filename=\"file1.ext\"\r\n" |
| 383 "customfield1: CUSTOM1\r\n" | 383 "customfield1: CUSTOM1\r\n" |
| 384 "\r\n" | 384 "\r\n" |
| 385 "**||--||PAYLOAD1||--||**\r\n" | 385 "**||--||PAYLOAD1||--||**\r\n" |
| 386 "--AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n" | 386 "--AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\r\n" |
| 387 "Content-Disposition: form-data; name=\"Name2\"\r\n" | 387 "Content-Disposition: form-data; name=\"Name2\"\r\n" |
| 388 "customfield1: CUSTOM1\r\n" | 388 "customfield1: CUSTOM1\r\n" |
| 389 "customfield2: CUSTOM2\r\n" | 389 "customfield2: CUSTOM2\r\n" |
| 390 "\r\n" | 390 "\r\n" |
| 391 "**||--||PAYLOAD2||--||**\r\n--" | 391 "**||--||PAYLOAD2||--||**\r\n--" |
| 392 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA--\r\n"); | 392 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA--\r\n"); |
| 393 | 393 |
| 394 upload_job->Start(); | 394 upload_job->Start(); |
| 395 run_loop_.Run(); | 395 run_loop_.Run(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 } // namespace policy | 398 } // namespace policy |
| OLD | NEW |