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

Unified Diff: chrome/browser/rlz/rlz_unittest.cc

Issue 291303007: Fix RlzLibTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set back enable_rlz Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/rlz/rlz_unittest.cc
diff --git a/chrome/browser/rlz/rlz_unittest.cc b/chrome/browser/rlz/rlz_unittest.cc
index 025622790c290853458b3b96f33001ce671ad1da..5a12d12e53331e6428b7acbc2f8c34ca3c2512b5 100644
--- a/chrome/browser/rlz/rlz_unittest.cc
+++ b/chrome/browser/rlz/rlz_unittest.cc
@@ -6,6 +6,9 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
+#include "chrome/browser/autocomplete/autocomplete_controller.h"
+#include "chrome/browser/autocomplete/autocomplete_input.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/omnibox/omnibox_log.h"
@@ -230,9 +233,20 @@ void RlzLibTest::SetRegistryBrandValue(const wchar_t* name,
#endif
void RlzLibTest::SimulateOmniboxUsage() {
+ // Create a dummy OmniboxLog object. The 'is_popup_open' field needs to be
+ // true to trigger record of the first search. All other fields are passed in
+ // with empty or invalid values.
+ AutocompleteResult empty_result;
+ OmniboxLog dummy(base::string16(), false, AutocompleteInput::INVALID,
+ true, 0, false, -1,
+ AutocompleteInput::INVALID_SPEC,
+ base::TimeDelta::FromSeconds(0), 0,
+ base::TimeDelta::FromSeconds(0),
+ AutocompleteResult());
+
tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL,
content::NotificationService::AllSources(),
- content::Details<OmniboxLog>(NULL));
+ content::Details<OmniboxLog>(&dummy));
}
void RlzLibTest::SimulateHomepageUsage() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698