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

Side by Side Diff: components/autofill/browser/autofill_metrics_unittest.cc

Issue 13973004: Convert string16 -> base::string16 in components/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return static_cast<MockAutofillMetrics*>(const_cast<AutofillMetrics*>( 206 return static_cast<MockAutofillMetrics*>(const_cast<AutofillMetrics*>(
207 AutofillManager::metric_logger())); 207 AutofillManager::metric_logger()));
208 } 208 }
209 209
210 void AddSeenForm(const FormData& form, 210 void AddSeenForm(const FormData& form,
211 const std::vector<AutofillFieldType>& heuristic_types, 211 const std::vector<AutofillFieldType>& heuristic_types,
212 const std::vector<AutofillFieldType>& server_types, 212 const std::vector<AutofillFieldType>& server_types,
213 const std::string& experiment_id) { 213 const std::string& experiment_id) {
214 FormData empty_form = form; 214 FormData empty_form = form;
215 for (size_t i = 0; i < empty_form.fields.size(); ++i) { 215 for (size_t i = 0; i < empty_form.fields.size(); ++i) {
216 empty_form.fields[i].value = string16(); 216 empty_form.fields[i].value = base::string16();
217 } 217 }
218 218
219 // |form_structure| will be owned by |form_structures()|. 219 // |form_structure| will be owned by |form_structures()|.
220 TestFormStructure* form_structure = new TestFormStructure(empty_form); 220 TestFormStructure* form_structure = new TestFormStructure(empty_form);
221 form_structure->SetFieldTypes(heuristic_types, server_types); 221 form_structure->SetFieldTypes(heuristic_types, server_types);
222 form_structure->set_server_experiment_id(experiment_id); 222 form_structure->set_server_experiment_id(experiment_id);
223 form_structures()->push_back(form_structure); 223 form_structures()->push_back(form_structure);
224 } 224 }
225 225
226 void FormSubmitted(const FormData& form, const TimeTicks& timestamp) { 226 void FormSubmitted(const FormData& form, const TimeTicks& timestamp) {
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 1338
1339 // Expect notifications when the form is submitted. 1339 // Expect notifications when the form is submitted.
1340 { 1340 {
1341 EXPECT_CALL(*autofill_manager_->metric_logger(), 1341 EXPECT_CALL(*autofill_manager_->metric_logger(),
1342 LogUserHappinessMetric( 1342 LogUserHappinessMetric(
1343 AutofillMetrics::SUBMITTED_FILLABLE_FORM_AUTOFILLED_ALL)); 1343 AutofillMetrics::SUBMITTED_FILLABLE_FORM_AUTOFILLED_ALL));
1344 autofill_manager_->FormSubmitted(form, TimeTicks::Now()); 1344 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
1345 } 1345 }
1346 1346
1347 // Clear out the third field's value. 1347 // Clear out the third field's value.
1348 form.fields[2].value = string16(); 1348 form.fields[2].value = base::string16();
1349 forms.front() = form; 1349 forms.front() = form;
1350 1350
1351 // Expect notifications when the form is submitted. 1351 // Expect notifications when the form is submitted.
1352 { 1352 {
1353 EXPECT_CALL(*autofill_manager_->metric_logger(), 1353 EXPECT_CALL(*autofill_manager_->metric_logger(),
1354 LogUserHappinessMetric( 1354 LogUserHappinessMetric(
1355 AutofillMetrics::SUBMITTED_NON_FILLABLE_FORM)); 1355 AutofillMetrics::SUBMITTED_NON_FILLABLE_FORM));
1356 autofill_manager_->FormSubmitted(form, TimeTicks::Now()); 1356 autofill_manager_->FormSubmitted(form, TimeTicks::Now());
1357 } 1357 }
1358 } 1358 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1569 forms, TimeTicks::FromInternalValue(1), false); 1569 forms, TimeTicks::FromInternalValue(1), false);
1570 autofill_manager_->OnDidFillAutofillFormData( 1570 autofill_manager_->OnDidFillAutofillFormData(
1571 TimeTicks::FromInternalValue(5)); 1571 TimeTicks::FromInternalValue(5));
1572 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), 1572 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
1573 TimeTicks::FromInternalValue(3)); 1573 TimeTicks::FromInternalValue(3));
1574 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); 1574 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17));
1575 autofill_manager_->Reset(); 1575 autofill_manager_->Reset();
1576 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); 1576 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger());
1577 } 1577 }
1578 } 1578 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698