| OLD | NEW |
| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 AutofillCCInfoBarDelegate* AutofillMetricsTest::CreateDelegate( | 315 AutofillCCInfoBarDelegate* AutofillMetricsTest::CreateDelegate( |
| 316 MockAutofillMetrics* metric_logger, | 316 MockAutofillMetrics* metric_logger, |
| 317 CreditCard** created_card) { | 317 CreditCard** created_card) { |
| 318 EXPECT_CALL(*metric_logger, | 318 EXPECT_CALL(*metric_logger, |
| 319 LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_SHOWN)); | 319 LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_SHOWN)); |
| 320 // The delegate created below will take ownership of this object. | 320 // The delegate created below will take ownership of this object. |
| 321 CreditCard* credit_card = new CreditCard(); | 321 CreditCard* credit_card = new CreditCard(); |
| 322 if (created_card) | 322 if (created_card) |
| 323 *created_card = credit_card; | 323 *created_card = credit_card; |
| 324 return new AutofillCCInfoBarDelegate( | 324 return new AutofillCCInfoBarDelegate( |
| 325 InfoBarService::ForTab(tab_contents()), | 325 InfoBarService::FromTabContents(tab_contents()), |
| 326 credit_card, | 326 credit_card, |
| 327 &personal_data_, | 327 &personal_data_, |
| 328 metric_logger); | 328 metric_logger); |
| 329 } | 329 } |
| 330 | 330 |
| 331 // Test that we log quality metrics appropriately. | 331 // Test that we log quality metrics appropriately. |
| 332 TEST_F(AutofillMetricsTest, QualityMetrics) { | 332 TEST_F(AutofillMetricsTest, QualityMetrics) { |
| 333 // Set up our form data. | 333 // Set up our form data. |
| 334 FormData form; | 334 FormData form; |
| 335 form.name = ASCIIToUTF16("TestForm"); | 335 form.name = ASCIIToUTF16("TestForm"); |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), | 1468 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), |
| 1469 TimeTicks::FromInternalValue(3)); | 1469 TimeTicks::FromInternalValue(3)); |
| 1470 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); | 1470 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); |
| 1471 autofill_manager_->Reset(); | 1471 autofill_manager_->Reset(); |
| 1472 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); | 1472 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); |
| 1473 } | 1473 } |
| 1474 | 1474 |
| 1475 // Restore the global Gmock verbosity level to its default value. | 1475 // Restore the global Gmock verbosity level to its default value. |
| 1476 ::testing::FLAGS_gmock_verbose = "warning"; | 1476 ::testing::FLAGS_gmock_verbose = "warning"; |
| 1477 } | 1477 } |
| OLD | NEW |