| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <list> | 5 #include <list> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 virtual void OnUploadedPossibleFieldTypes() OVERRIDE { | 88 virtual void OnUploadedPossibleFieldTypes() OVERRIDE { |
| 89 ResponseData response; | 89 ResponseData response; |
| 90 response.type_of_response = UPLOAD_SUCCESSFULL; | 90 response.type_of_response = UPLOAD_SUCCESSFULL; |
| 91 responses_.push_back(response); | 91 responses_.push_back(response); |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual void OnServerRequestError( | 94 virtual void OnServerRequestError( |
| 95 const std::string& form_signature, | 95 const std::string& form_signature, |
| 96 AutofillDownloadManager::AutofillRequestType request_type, | 96 AutofillDownloadManager::RequestType request_type, |
| 97 int http_error) OVERRIDE { | 97 int http_error) OVERRIDE { |
| 98 ResponseData response; | 98 ResponseData response; |
| 99 response.signature = form_signature; | 99 response.signature = form_signature; |
| 100 response.error = http_error; | 100 response.error = http_error; |
| 101 response.type_of_response = | 101 response.type_of_response = |
| 102 request_type == AutofillDownloadManager::REQUEST_QUERY ? | 102 request_type == AutofillDownloadManager::REQUEST_QUERY ? |
| 103 REQUEST_QUERY_FAILED : REQUEST_UPLOAD_FAILED; | 103 REQUEST_QUERY_FAILED : REQUEST_UPLOAD_FAILED; |
| 104 responses_.push_back(response); | 104 responses_.push_back(response); |
| 105 } | 105 } |
| 106 | 106 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 EXPECT_EQ(static_cast<size_t>(0), responses_.size()); | 489 EXPECT_EQ(static_cast<size_t>(0), responses_.size()); |
| 490 | 490 |
| 491 fetcher = factory.GetFetcherByID(3); | 491 fetcher = factory.GetFetcherByID(3); |
| 492 ASSERT_TRUE(fetcher); | 492 ASSERT_TRUE(fetcher); |
| 493 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); | 493 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); |
| 494 ASSERT_EQ(static_cast<size_t>(1), responses_.size()); | 494 ASSERT_EQ(static_cast<size_t>(1), responses_.size()); |
| 495 EXPECT_EQ(responses[0], responses_.front().response); | 495 EXPECT_EQ(responses[0], responses_.front().response); |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace autofill | 498 } // namespace autofill |
| OLD | NEW |