| 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); |
| 233 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, | 236 tracker_.Observe(chrome::NOTIFICATION_OMNIBOX_OPENED_URL, |
| 234 content::NotificationService::AllSources(), | 237 content::NotificationService::AllSources(), |
| 235 content::Details<OmniboxLog>(NULL)); | 238 content::Details<OmniboxLog>(dummy)); |
| 236 } | 239 } |
| 237 | 240 |
| 238 void RlzLibTest::SimulateHomepageUsage() { | 241 void RlzLibTest::SimulateHomepageUsage() { |
| 239 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); | 242 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); |
| 240 entry->SetPageID(0); | 243 entry->SetPageID(0); |
| 241 entry->SetTransitionType(content::PAGE_TRANSITION_HOME_PAGE); | 244 entry->SetTransitionType(content::PAGE_TRANSITION_HOME_PAGE); |
| 242 tracker_.Observe(content::NOTIFICATION_NAV_ENTRY_PENDING, | 245 tracker_.Observe(content::NOTIFICATION_NAV_ENTRY_PENDING, |
| 243 content::NotificationService::AllSources(), | 246 content::NotificationService::AllSources(), |
| 244 content::Details<NavigationEntry>(entry.get())); | 247 content::Details<NavigationEntry>(entry.get())); |
| 245 } | 248 } |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::CHROME_OMNIBOX, | 874 RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::CHROME_OMNIBOX, |
| 872 rlz_lib::FIRST_SEARCH); | 875 rlz_lib::FIRST_SEARCH); |
| 873 | 876 |
| 874 ExpectEventRecorded(kOmniboxFirstSearch, true); | 877 ExpectEventRecorded(kOmniboxFirstSearch, true); |
| 875 | 878 |
| 876 RLZTracker::ClearRlzState(); | 879 RLZTracker::ClearRlzState(); |
| 877 | 880 |
| 878 ExpectEventRecorded(kOmniboxFirstSearch, false); | 881 ExpectEventRecorded(kOmniboxFirstSearch, false); |
| 879 } | 882 } |
| 880 #endif // defined(OS_CHROMEOS) | 883 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |