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

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

Issue 10185008: Taking over issue 10006037: Moved WebDataService to ProfileKeyedService (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 LogStoredProfileCount(::testing::_)).Times(0); 923 LogStoredProfileCount(::testing::_)).Times(0);
924 personal_data_.LoadProfiles(); 924 personal_data_.LoadProfiles();
925 } 925 }
926 926
927 // Test that we correctly log whether Autofill is enabled. 927 // Test that we correctly log whether Autofill is enabled.
928 TEST_F(AutofillMetricsTest, AutofillIsEnabledAtStartup) { 928 TEST_F(AutofillMetricsTest, AutofillIsEnabledAtStartup) {
929 personal_data_.set_autofill_enabled(true); 929 personal_data_.set_autofill_enabled(true);
930 EXPECT_CALL(*personal_data_.metric_logger(), 930 EXPECT_CALL(*personal_data_.metric_logger(),
931 LogIsAutofillEnabledAtStartup(true)).Times(1); 931 LogIsAutofillEnabledAtStartup(true)).Times(1);
932 personal_data_.Init(profile()); 932 personal_data_.Init(profile());
933 personal_data_.Shutdown();
933 934
934 personal_data_.set_autofill_enabled(false); 935 personal_data_.set_autofill_enabled(false);
935 EXPECT_CALL(*personal_data_.metric_logger(), 936 EXPECT_CALL(*personal_data_.metric_logger(),
936 LogIsAutofillEnabledAtStartup(false)).Times(1); 937 LogIsAutofillEnabledAtStartup(false)).Times(1);
937 personal_data_.Init(profile()); 938 personal_data_.Init(profile());
938 } 939 }
939 940
940 // Test that we log the number of Autofill suggestions when filling a form. 941 // Test that we log the number of Autofill suggestions when filling a form.
941 TEST_F(AutofillMetricsTest, AddressSuggestionsCount) { 942 TEST_F(AutofillMetricsTest, AddressSuggestionsCount) {
942 // Set up our form data. 943 // Set up our form data.
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), 1460 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(),
1460 TimeTicks::FromInternalValue(3)); 1461 TimeTicks::FromInternalValue(3));
1461 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); 1462 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17));
1462 autofill_manager_->Reset(); 1463 autofill_manager_->Reset();
1463 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); 1464 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger());
1464 } 1465 }
1465 1466
1466 // Restore the global Gmock verbosity level to its default value. 1467 // Restore the global Gmock verbosity level to its default value.
1467 ::testing::FLAGS_gmock_verbose = "warning"; 1468 ::testing::FLAGS_gmock_verbose = "warning";
1468 } 1469 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete_history_manager_unittest.cc ('k') | chrome/browser/autofill/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698