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

Side by Side Diff: components/autofill/core/browser/autofill_download_manager_unittest.cc

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 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 <list> 7 #include <list>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 base::MessageLoopProxy::current())), 71 base::MessageLoopProxy::current())),
72 download_manager_(&driver_, prefs_.get(), this) { 72 download_manager_(&driver_, prefs_.get(), this) {
73 driver_.SetURLRequestContext(request_context_.get()); 73 driver_.SetURLRequestContext(request_context_.get());
74 } 74 }
75 75
76 void LimitCache(size_t cache_size) { 76 void LimitCache(size_t cache_size) {
77 download_manager_.set_max_form_cache_size(cache_size); 77 download_manager_.set_max_form_cache_size(cache_size);
78 } 78 }
79 79
80 // AutofillDownloadManager::Observer implementation. 80 // AutofillDownloadManager::Observer implementation.
81 virtual void OnLoadedServerPredictions( 81 void OnLoadedServerPredictions(const std::string& response_xml) override {
82 const std::string& response_xml) override {
83 ResponseData response; 82 ResponseData response;
84 response.response = response_xml; 83 response.response = response_xml;
85 response.type_of_response = QUERY_SUCCESSFULL; 84 response.type_of_response = QUERY_SUCCESSFULL;
86 responses_.push_back(response); 85 responses_.push_back(response);
87 } 86 }
88 87
89 virtual void OnUploadedPossibleFieldTypes() override { 88 void OnUploadedPossibleFieldTypes() override {
90 ResponseData response; 89 ResponseData response;
91 response.type_of_response = UPLOAD_SUCCESSFULL; 90 response.type_of_response = UPLOAD_SUCCESSFULL;
92 responses_.push_back(response); 91 responses_.push_back(response);
93 } 92 }
94 93
95 virtual void OnServerRequestError( 94 void OnServerRequestError(const std::string& form_signature,
96 const std::string& form_signature, 95 AutofillDownloadManager::RequestType request_type,
97 AutofillDownloadManager::RequestType request_type, 96 int http_error) override {
98 int http_error) override {
99 ResponseData response; 97 ResponseData response;
100 response.signature = form_signature; 98 response.signature = form_signature;
101 response.error = http_error; 99 response.error = http_error;
102 response.type_of_response = 100 response.type_of_response =
103 request_type == AutofillDownloadManager::REQUEST_QUERY ? 101 request_type == AutofillDownloadManager::REQUEST_QUERY ?
104 REQUEST_QUERY_FAILED : REQUEST_UPLOAD_FAILED; 102 REQUEST_QUERY_FAILED : REQUEST_UPLOAD_FAILED;
105 responses_.push_back(response); 103 responses_.push_back(response);
106 } 104 }
107 105
108 enum ResponseType { 106 enum ResponseType {
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 EXPECT_EQ(static_cast<size_t>(0), responses_.size()); 486 EXPECT_EQ(static_cast<size_t>(0), responses_.size());
489 487
490 fetcher = factory.GetFetcherByID(3); 488 fetcher = factory.GetFetcherByID(3);
491 ASSERT_TRUE(fetcher); 489 ASSERT_TRUE(fetcher);
492 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0])); 490 FakeOnURLFetchComplete(fetcher, 200, std::string(responses[0]));
493 ASSERT_EQ(static_cast<size_t>(1), responses_.size()); 491 ASSERT_EQ(static_cast<size_t>(1), responses_.size());
494 EXPECT_EQ(responses[0], responses_.front().response); 492 EXPECT_EQ(responses[0], responses_.front().response);
495 } 493 }
496 494
497 } // namespace autofill 495 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698