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

Side by Side Diff: chrome/browser/rlz/rlz_unittest.cc

Issue 795343002: Omnibox Watcher: Don't Flag Incidents that are Paste+Enter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rlz unittest Created 6 years 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 (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 "chrome/browser/rlz/rlz.h" 5 #include "chrome/browser/rlz/rlz.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/autocomplete/autocomplete_controller.h" 10 #include "chrome/browser/autocomplete/autocomplete_controller.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 } 232 }
233 #endif 233 #endif
234 234
235 void RlzLibTest::SimulateOmniboxUsage() { 235 void RlzLibTest::SimulateOmniboxUsage() {
236 // Create a dummy OmniboxLog object. The 'is_popup_open' field needs to be 236 // Create a dummy OmniboxLog object. The 'is_popup_open' field needs to be
237 // true to trigger record of the first search. All other fields are passed in 237 // true to trigger record of the first search. All other fields are passed in
238 // with empty or invalid values. 238 // with empty or invalid values.
239 AutocompleteResult empty_result; 239 AutocompleteResult empty_result;
240 OmniboxLog dummy(base::string16(), false, metrics::OmniboxInputType::INVALID, 240 OmniboxLog dummy(base::string16(), false, metrics::OmniboxInputType::INVALID,
241 true, 0, false, -1, 241 true, 0, false, false, -1,
242 metrics::OmniboxEventProto::INVALID_SPEC, 242 metrics::OmniboxEventProto::INVALID_SPEC,
243 base::TimeDelta::FromSeconds(0), 0, 243 base::TimeDelta::FromSeconds(0), 0,
244 base::TimeDelta::FromSeconds(0), 244 base::TimeDelta::FromSeconds(0),
245 AutocompleteResult()); 245 AutocompleteResult());
246 246
247 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, 247 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
248 content::NotificationService::AllSources(), 248 content::NotificationService::AllSources(),
249 content::Details<OmniboxLog>(&dummy)); 249 content::Details<OmniboxLog>(&dummy));
250 } 250 }
251 251
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::ChromeOmnibox(), 887 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::ChromeOmnibox(),
888 rlz_lib::FIRST_SEARCH); 888 rlz_lib::FIRST_SEARCH);
889 889
890 ExpectEventRecorded(kOmniboxFirstSearch, true); 890 ExpectEventRecorded(kOmniboxFirstSearch, true);
891 891
892 RLZTracker::ClearRlzState(); 892 RLZTracker::ClearRlzState();
893 893
894 ExpectEventRecorded(kOmniboxFirstSearch, false); 894 ExpectEventRecorded(kOmniboxFirstSearch, false);
895 } 895 }
896 #endif // defined(OS_CHROMEOS) 896 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/omnibox/omnibox_log.cc ('k') | chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698