| 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 "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 "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 LONG result = key.DeleteValue(name); | 223 LONG result = key.DeleteValue(name); |
| 224 ASSERT_TRUE(ERROR_SUCCESS == result || ERROR_FILE_NOT_FOUND == result); | 224 ASSERT_TRUE(ERROR_SUCCESS == result || ERROR_FILE_NOT_FOUND == result); |
| 225 } else { | 225 } else { |
| 226 base::string16 brand16 = base::ASCIIToUTF16(brand); | 226 base::string16 brand16 = base::ASCIIToUTF16(brand); |
| 227 ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(name, brand16.c_str())); | 227 ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(name, brand16.c_str())); |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 #endif | 230 #endif |
| 231 | 231 |
| 232 void RlzLibTest::SimulateOmniboxUsage() { | 232 void RlzLibTest::SimulateOmniboxUsage() { |
| 233 // Set is_popup_open for the OmniboxLog to be true. | |
| 234 OmniboxLog dummy = OmniboxLog(NULL, false, NULL, true, NULL, NULL, NULL, NULL, | |
| 235 NULL, NULL, NULL, NULL); | |
| 236 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, | 233 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, |
| 237 content::NotificationService::AllSources(), | 234 content::NotificationService::AllSources(), |
| 238 content::Details<OmniboxLog>(dummy)); | 235 content::Details<OmniboxLog>(NULL)); |
| 239 } | 236 } |
| 240 | 237 |
| 241 void RlzLibTest::SimulateHomepageUsage() { | 238 void RlzLibTest::SimulateHomepageUsage() { |
| 242 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); | 239 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); |
| 243 entry->SetPageID(0); | 240 entry->SetPageID(0); |
| 244 entry->SetTransitionType(content::PAGE_TRANSITION_HOME_PAGE); | 241 entry->SetTransitionType(content::PAGE_TRANSITION_HOME_PAGE); |
| 245 tracker_.Observe(content::NOTIFICATION_NAV_ENTRY_PENDING, | 242 tracker_.Observe(content::NOTIFICATION_NAV_ENTRY_PENDING, |
| 246 content::NotificationService::AllSources(), | 243 content::NotificationService::AllSources(), |
| 247 content::Details<NavigationEntry>(entry.get())); | 244 content::Details<NavigationEntry>(entry.get())); |
| 248 } | 245 } |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::CHROME_OMNIBOX, | 871 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::CHROME_OMNIBOX, |
| 875 rlz_lib::FIRST_SEARCH); | 872 rlz_lib::FIRST_SEARCH); |
| 876 | 873 |
| 877 ExpectEventRecorded(kOmniboxFirstSearch, true); | 874 ExpectEventRecorded(kOmniboxFirstSearch, true); |
| 878 | 875 |
| 879 RLZTracker::ClearRlzState(); | 876 RLZTracker::ClearRlzState(); |
| 880 | 877 |
| 881 ExpectEventRecorded(kOmniboxFirstSearch, false); | 878 ExpectEventRecorded(kOmniboxFirstSearch, false); |
| 882 } | 879 } |
| 883 #endif // defined(OS_CHROMEOS) | 880 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |