Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/autofill/core/browser/autofill_download_manager.h" | 5 #include "components/autofill/core/browser/autofill_download_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
|
Mathieu
2016/04/04 13:36:17
#include <memory>
vabr (Chromium)
2016/04/04 14:29:04
Done.
| |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/test/histogram_tester.h" | 15 #include "base/test/histogram_tester.h" |
| 16 #include "base/test/test_timeouts.h" | 16 #include "base/test/test_timeouts.h" |
| 17 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 field.label = ASCIIToUTF16("city"); | 394 field.label = ASCIIToUTF16("city"); |
| 395 field.name = ASCIIToUTF16("city"); | 395 field.name = ASCIIToUTF16("city"); |
| 396 field.form_control_type = "text"; | 396 field.form_control_type = "text"; |
| 397 form.fields.push_back(field); | 397 form.fields.push_back(field); |
| 398 | 398 |
| 399 field.label = base::string16(); | 399 field.label = base::string16(); |
| 400 field.name = ASCIIToUTF16("Submit"); | 400 field.name = ASCIIToUTF16("Submit"); |
| 401 field.form_control_type = "submit"; | 401 field.form_control_type = "submit"; |
| 402 form.fields.push_back(field); | 402 form.fields.push_back(field); |
| 403 | 403 |
| 404 scoped_ptr<FormStructure> form_structure(new FormStructure(form)); | 404 std::unique_ptr<FormStructure> form_structure(new FormStructure(form)); |
| 405 | 405 |
| 406 // Request with id 0. | 406 // Request with id 0. |
| 407 EXPECT_TRUE(download_manager_.StartUploadRequest( | 407 EXPECT_TRUE(download_manager_.StartUploadRequest( |
| 408 *form_structure, true, ServerFieldTypeSet(), std::string(), true)); | 408 *form_structure, true, ServerFieldTypeSet(), std::string(), true)); |
| 409 | 409 |
| 410 net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); | 410 net::TestURLFetcher* fetcher = factory.GetFetcherByID(0); |
| 411 ASSERT_TRUE(fetcher); | 411 ASSERT_TRUE(fetcher); |
| 412 | 412 |
| 413 // Error incurs a retry after 1 second. | 413 // Error incurs a retry after 1 second. |
| 414 FakeOnURLFetchComplete(fetcher, net::HTTP_NOT_FOUND, "<html></html>"); | 414 FakeOnURLFetchComplete(fetcher, net::HTTP_NOT_FOUND, "<html></html>"); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 634 EXPECT_EQ(0U, responses_.size()); | 634 EXPECT_EQ(0U, responses_.size()); |
| 635 | 635 |
| 636 fetcher = factory.GetFetcherByID(3); | 636 fetcher = factory.GetFetcherByID(3); |
| 637 ASSERT_TRUE(fetcher); | 637 ASSERT_TRUE(fetcher); |
| 638 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); | 638 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); |
| 639 ASSERT_EQ(1U, responses_.size()); | 639 ASSERT_EQ(1U, responses_.size()); |
| 640 EXPECT_EQ(responses[0], responses_.front().response); | 640 EXPECT_EQ(responses[0], responses_.front().response); |
| 641 } | 641 } |
| 642 | 642 |
| 643 } // namespace autofill | 643 } // namespace autofill |
| OLD | NEW |