summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-03 18:35:53 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-03 18:35:53 +0000
commitb935e7a86084ba9109b84e7a52adc22f24752fd1 (patch)
treed6fee120f271a558b175ca797ee3e87a05c2f835
parent60263c7c1dc2a91a8a4cab8b92ae9f184f8176fa (diff)
downloadchromium_src-b935e7a86084ba9109b84e7a52adc22f24752fd1.zip
chromium_src-b935e7a86084ba9109b84e7a52adc22f24752fd1.tar.gz
chromium_src-b935e7a86084ba9109b84e7a52adc22f24752fd1.tar.bz2
rlz: Change omnibox / homepage access points from C1/C2 to C5/C6 on mac
BUG=134939 TEST=none Review URL: https://chromiumcodereview.appspot.com/10698024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145337 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/rlz/rlz.cc46
-rw-r--r--chrome/browser/rlz/rlz.h4
-rw-r--r--chrome/browser/rlz/rlz_unittest.cc210
-rw-r--r--rlz/lib/lib_values.cc4
-rw-r--r--rlz/lib/rlz_enums.h5
5 files changed, 157 insertions, 112 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 8cb9304..c46fcf6 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -61,17 +61,17 @@ void RecordProductEvents(bool first_run, bool google_default_search,
// Record the installation of chrome. We call this all the time but the rlz
// lib should ingore all but the first one.
rlz_lib::RecordProductEvent(rlz_lib::CHROME,
- rlz_lib::CHROME_OMNIBOX,
+ RLZTracker::CHROME_OMNIBOX,
rlz_lib::INSTALL);
rlz_lib::RecordProductEvent(rlz_lib::CHROME,
- rlz_lib::CHROME_HOME_PAGE,
+ RLZTracker::CHROME_HOME_PAGE,
rlz_lib::INSTALL);
if (!already_ran) {
// Do the initial event recording if is the first run or if we have an
// empty rlz which means we haven't got a chance to do it.
char omnibox_rlz[rlz_lib::kMaxRlzLength + 1];
- if (!rlz_lib::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, omnibox_rlz,
+ if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, omnibox_rlz,
rlz_lib::kMaxRlzLength)) {
omnibox_rlz[0] = 0;
}
@@ -79,19 +79,19 @@ void RecordProductEvents(bool first_run, bool google_default_search,
// Record if google is the initial search provider and/or home page.
if ((first_run || omnibox_rlz[0] == 0) && google_default_search) {
rlz_lib::RecordProductEvent(rlz_lib::CHROME,
- rlz_lib::CHROME_OMNIBOX,
+ RLZTracker::CHROME_OMNIBOX,
rlz_lib::SET_TO_GOOGLE);
}
char homepage_rlz[rlz_lib::kMaxRlzLength + 1];
- if (!rlz_lib::GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, homepage_rlz,
+ if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, homepage_rlz,
rlz_lib::kMaxRlzLength)) {
homepage_rlz[0] = 0;
}
if ((first_run || homepage_rlz[0] == 0) && google_default_homepage) {
rlz_lib::RecordProductEvent(rlz_lib::CHROME,
- rlz_lib::CHROME_HOME_PAGE,
+ RLZTracker::CHROME_HOME_PAGE,
rlz_lib::SET_TO_GOOGLE);
}
}
@@ -100,7 +100,7 @@ void RecordProductEvents(bool first_run, bool google_default_search,
// time but the rlz lib should ingore all but the first one.
if (omnibox_used) {
rlz_lib::RecordProductEvent(rlz_lib::CHROME,
- rlz_lib::CHROME_OMNIBOX,
+ RLZTracker::CHROME_OMNIBOX,
rlz_lib::FIRST_SEARCH);
}
@@ -108,7 +108,7 @@ void RecordProductEvents(bool first_run, bool google_default_search,
// time but the rlz lib should ingore all but the first one.
if (homepage_used) {
rlz_lib::RecordProductEvent(rlz_lib::CHROME,
- rlz_lib::CHROME_HOME_PAGE,
+ RLZTracker::CHROME_HOME_PAGE,
rlz_lib::FIRST_SEARCH);
}
}
@@ -116,8 +116,8 @@ void RecordProductEvents(bool first_run, bool google_default_search,
bool SendFinancialPing(const std::string& brand,
const string16& lang,
const string16& referral) {
- rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX,
- rlz_lib::CHROME_HOME_PAGE,
+ rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX,
+ RLZTracker::CHROME_HOME_PAGE,
rlz_lib::NO_ACCESS_POINT};
std::string lang_ascii(UTF16ToASCII(lang));
std::string referral_ascii(UTF16ToASCII(referral));
@@ -128,6 +128,22 @@ bool SendFinancialPing(const std::string& brand,
} // namespace
+#if !defined(OS_MACOSX)
+// static
+const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX =
+ rlz_lib::CHROME_OMNIBOX;
+// static
+const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE =
+ rlz_lib::CHROME_HOME_PAGE;
+#else
+// static
+const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX =
+ rlz_lib::CHROME_MAC_OMNIBOX;
+// static
+const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE =
+ rlz_lib::CHROME_MAC_HOME_PAGE;
+#endif
+
RLZTracker* RLZTracker::tracker_ = NULL;
// static
@@ -269,8 +285,8 @@ void RLZTracker::PingNowImpl() {
}
// Prime the RLZ cache for the access points we are interested in.
- GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, NULL);
- GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, NULL);
+ GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, NULL);
+ GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, NULL);
}
std::string reactivation_brand;
@@ -300,7 +316,7 @@ void RLZTracker::Observe(int type,
switch (type) {
case chrome::NOTIFICATION_OMNIBOX_OPENED_URL:
case chrome::NOTIFICATION_INSTANT_CONTROLLER_UPDATED:
- point = rlz_lib::CHROME_OMNIBOX;
+ point = RLZTracker::CHROME_OMNIBOX;
record_used = &omnibox_used_;
call_record = true;
@@ -315,7 +331,7 @@ void RLZTracker::Observe(int type,
if (entry != NULL &&
((entry->GetTransitionType() &
content::PAGE_TRANSITION_HOME_PAGE) != 0)) {
- point = rlz_lib::CHROME_HOME_PAGE;
+ point = RLZTracker::CHROME_HOME_PAGE;
record_used = &homepage_used_;
call_record = true;
@@ -334,7 +350,7 @@ void RLZTracker::Observe(int type,
// attempt the ping.
if (!RecordProductEvent(rlz_lib::CHROME, point, rlz_lib::FIRST_SEARCH))
*record_used = true;
- else if (send_ping_immediately_ && point == rlz_lib::CHROME_OMNIBOX) {
+ else if (send_ping_immediately_ && point == RLZTracker::CHROME_OMNIBOX) {
ScheduleDelayedInit(0);
}
}
diff --git a/chrome/browser/rlz/rlz.h b/chrome/browser/rlz/rlz.h
index 88bc3c2..2c0a743 100644
--- a/chrome/browser/rlz/rlz.h
+++ b/chrome/browser/rlz/rlz.h
@@ -49,6 +49,10 @@ class RLZTracker : public content::NotificationObserver {
rlz_lib::AccessPoint point,
rlz_lib::Event event_id);
+ // For the point parameter of RecordProductEvent.
+ static const rlz_lib::AccessPoint CHROME_OMNIBOX;
+ static const rlz_lib::AccessPoint CHROME_HOME_PAGE;
+
// Get the RLZ value of the access point.
// Returns false if the rlz string could not be obtained. In some cases
// an empty string can be returned which is not an error.
diff --git a/chrome/browser/rlz/rlz_unittest.cc b/chrome/browser/rlz/rlz_unittest.cc
index 03839c1..f899137 100644
--- a/chrome/browser/rlz/rlz_unittest.cc
+++ b/chrome/browser/rlz/rlz_unittest.cc
@@ -138,8 +138,9 @@ class TestRLZTracker : public RLZTracker {
// Set new access points RLZ string, like the actual server ping would have
// done.
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, kNewOmniboxRlzString);
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE,
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX,
+ kNewOmniboxRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE,
kNewHomepageRlzString);
return true;
}
@@ -308,13 +309,6 @@ void RlzLibTest::ExpectReactivationRlzPingSent(bool expected) {
EXPECT_EQ(expected, tracker_.was_ping_sent_for_brand(brand.c_str()));
}
-TEST_F(RlzLibTest, RecordProductEvent) {
- RLZTracker::RecordProductEvent(rlz_lib::CHROME, rlz_lib::CHROME_OMNIBOX,
- rlz_lib::FIRST_SEARCH);
-
- ExpectEventRecorded("C1F", true);
-}
-
// The events that affect the different RLZ scenarios are the following:
//
// A: the user starts chrome for the first time
@@ -338,6 +332,8 @@ TEST_F(RlzLibTest, RecordProductEvent) {
// C2S event is recorded
// RLZ ping sent
//
+// On Mac, C5 / C6 are sent instead of C1 / C2.
+//
// Variations on the above scenarios:
//
// - if the delay specified to InitRlzDelayed() is negative, then the RLZ
@@ -345,18 +341,43 @@ TEST_F(RlzLibTest, RecordProductEvent) {
//
// Also want to test that pre-warming the RLZ string cache works correctly.
+#if !defined(OS_MACOSX)
+const char kC1I[] = "C1I";
+const char kC1S[] = "C1S";
+const char kC1F[] = "C1F";
+
+const char kC2I[] = "C2I";
+const char kC2S[] = "C2S";
+const char kC2F[] = "C2F";
+#else
+const char kC1I[] = "C5I";
+const char kC1S[] = "C5S";
+const char kC1F[] = "C5F";
+
+const char kC2I[] = "C6I";
+const char kC2S[] = "C6S";
+const char kC2F[] = "C6F";
+#endif
+
+TEST_F(RlzLibTest, RecordProductEvent) {
+ RLZTracker::RecordProductEvent(rlz_lib::CHROME, RLZTracker::CHROME_OMNIBOX,
+ rlz_lib::FIRST_SEARCH);
+
+ ExpectEventRecorded(kC1F, true);
+}
+
TEST_F(RlzLibTest, QuickStopAfterStart) {
RLZTracker::InitRlzDelayed(true, 20, true, true);
// Omnibox events.
- ExpectEventRecorded("C1I", false);
- ExpectEventRecorded("C1S", false);
- ExpectEventRecorded("C1F", false);
+ ExpectEventRecorded(kC1I, false);
+ ExpectEventRecorded(kC1S, false);
+ ExpectEventRecorded(kC1F, false);
// Home page events.
- ExpectEventRecorded("C2I", false);
- ExpectEventRecorded("C2S", false);
- ExpectEventRecorded("C2F", false);
+ ExpectEventRecorded(kC2I, false);
+ ExpectEventRecorded(kC2S, false);
+ ExpectEventRecorded(kC2F, false);
ExpectRlzPingSent(false);
}
@@ -366,14 +387,14 @@ TEST_F(RlzLibTest, DelayedInitOnly) {
InvokeDelayedInit();
// Omnibox events.
- ExpectEventRecorded("C1I", true);
- ExpectEventRecorded("C1S", true);
- ExpectEventRecorded("C1F", false);
+ ExpectEventRecorded(kC1I, true);
+ ExpectEventRecorded(kC1S, true);
+ ExpectEventRecorded(kC1F, false);
// Home page events.
- ExpectEventRecorded("C2I", true);
- ExpectEventRecorded("C2S", true);
- ExpectEventRecorded("C2F", false);
+ ExpectEventRecorded(kC2I, true);
+ ExpectEventRecorded(kC2S, true);
+ ExpectEventRecorded(kC2F, false);
ExpectRlzPingSent(true);
}
@@ -383,14 +404,14 @@ TEST_F(RlzLibTest, DelayedInitOnlyNoFirstRunNoRlzStrings) {
InvokeDelayedInit();
// Omnibox events.
- ExpectEventRecorded("C1I", true);
- ExpectEventRecorded("C1S", true);
- ExpectEventRecorded("C1F", false);
+ ExpectEventRecorded(kC1I, true);
+ ExpectEventRecorded(kC1S, true);
+ ExpectEventRecorded(kC1F, false);
// Home page events.
- ExpectEventRecorded("C2I", true);
- ExpectEventRecorded("C2S", true);
- ExpectEventRecorded("C2F", false);
+ ExpectEventRecorded(kC2I, true);
+ ExpectEventRecorded(kC2S, true);
+ ExpectEventRecorded(kC2F, false);
ExpectRlzPingSent(true);
}
@@ -398,21 +419,21 @@ TEST_F(RlzLibTest, DelayedInitOnlyNoFirstRunNoRlzStrings) {
TEST_F(RlzLibTest, DelayedInitOnlyNoFirstRun) {
// Set some dummy RLZ strings to simulate that we already ran before and
// performed a successful ping to the RLZ server.
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, kOmniboxRlzString);
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, kHomepageRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, kHomepageRlzString);
RLZTracker::InitRlzDelayed(false, 20, true, true);
InvokeDelayedInit();
// Omnibox events.
- ExpectEventRecorded("C1I", true);
- ExpectEventRecorded("C1S", false);
- ExpectEventRecorded("C1F", false);
+ ExpectEventRecorded(kC1I, true);
+ ExpectEventRecorded(kC1S, false);
+ ExpectEventRecorded(kC1F, false);
// Home page events.
- ExpectEventRecorded("C2I", true);
- ExpectEventRecorded("C2S", false);
- ExpectEventRecorded("C2F", false);
+ ExpectEventRecorded(kC2I, true);
+ ExpectEventRecorded(kC2S, false);
+ ExpectEventRecorded(kC2F, false);
ExpectRlzPingSent(true);
}
@@ -422,14 +443,14 @@ TEST_F(RlzLibTest, DelayedInitOnlyNoGoogleDefaultSearchOrHomepage) {
InvokeDelayedInit();
// Omnibox events.
- ExpectEventRecorded("C1I", true);
- ExpectEventRecorded("C1S", false);
- ExpectEventRecorded("C1F", false);
+ ExpectEventRecorded(kC1I, true);
+ ExpectEventRecorded(kC1S, false);
+ ExpectEventRecorded(kC1F, false);
// Home page events.
- ExpectEventRecorded("C2I", true);
- ExpectEventRecorded("C2S", false);
- ExpectEventRecorded("C2F", false);
+ ExpectEventRecorded(kC2I, true);
+ ExpectEventRecorded(kC2S, false);
+ ExpectEventRecorded(kC2F, false);
ExpectRlzPingSent(true);
}
@@ -439,14 +460,14 @@ TEST_F(RlzLibTest, OmniboxUsageOnly) {
SimulateOmniboxUsage();
// Omnibox events.
- ExpectEventRecorded("C1I", false);
- ExpectEventRecorded("C1S", false);
- ExpectEventRecorded("C1F", true);
+ ExpectEventRecorded(kC1I, false);
+ ExpectEventRecorded(kC1S, false);
+ ExpectEventRecorded(kC1F, true);
// Home page events.
- ExpectEventRecorded("C2I", false);
- ExpectEventRecorded("C2S", false);
- ExpectEventRecorded("C2F", false);
+ ExpectEventRecorded(kC2I, false);
+ ExpectEventRecorded(kC2S, false);
+ ExpectEventRecorded(kC2F, false);
ExpectRlzPingSent(false);
}
@@ -456,14 +477,14 @@ TEST_F(RlzLibTest, HomepageUsageOnly) {
SimulateHomepageUsage();
// Omnibox events.
- ExpectEventRecorded("C1I", false);
- ExpectEventRecorded("C1S", false);
- ExpectEventRecorded("C1F", false);
+ ExpectEventRecorded(kC1I, false);
+ ExpectEventRecorded(kC1S, false);
+ ExpectEventRecorded(kC1F, false);
// Home page events.
- ExpectEventRecorded("C2I", false);
- ExpectEventRecorded("C2S", false);
- ExpectEventRecorded("C2F", true);
+ ExpectEventRecorded(kC2I, false);
+ ExpectEventRecorded(kC2S, false);
+ ExpectEventRecorded(kC2F, true);
ExpectRlzPingSent(false);
}
@@ -475,14 +496,14 @@ TEST_F(RlzLibTest, UsageBeforeDelayedInit) {
InvokeDelayedInit();
// Omnibox events.
- ExpectEventRecorded("C1I", true);
- ExpectEventRecorded("C1S", true);
- ExpectEventRecorded("C1F", true);
+ ExpectEventRecorded(kC1I, true);
+ ExpectEventRecorded(kC1S, true);
+ ExpectEventRecorded(kC1F, true);
// Home page events.
- ExpectEventRecorded("C2I", true);
- ExpectEventRecorded("C2S", true);
- ExpectEventRecorded("C2F", true);
+ ExpectEventRecorded(kC2I, true);
+ ExpectEventRecorded(kC2S, true);
+ ExpectEventRecorded(kC2F, true);
ExpectRlzPingSent(true);
}
@@ -494,14 +515,14 @@ TEST_F(RlzLibTest, OmniboxUsageAfterDelayedInit) {
SimulateHomepageUsage();
// Omnibox events.
- ExpectEventRecorded("C1I", true);
- ExpectEventRecorded("C1S", true);
- ExpectEventRecorded("C1F", true);
+ ExpectEventRecorded(kC1I, true);
+ ExpectEventRecorded(kC1S, true);
+ ExpectEventRecorded(kC1F, true);
// Home page events.
- ExpectEventRecorded("C2I", true);
- ExpectEventRecorded("C2S", true);
- ExpectEventRecorded("C2F", true);
+ ExpectEventRecorded(kC2I, true);
+ ExpectEventRecorded(kC2S, true);
+ ExpectEventRecorded(kC2F, true);
ExpectRlzPingSent(true);
}
@@ -511,14 +532,14 @@ TEST_F(RlzLibTest, OmniboxUsageSendsPingWhenDelayNegative) {
SimulateOmniboxUsage();
// Omnibox events.
- ExpectEventRecorded("C1I", true);
- ExpectEventRecorded("C1S", true);
- ExpectEventRecorded("C1F", true);
+ ExpectEventRecorded(kC1I, true);
+ ExpectEventRecorded(kC1S, true);
+ ExpectEventRecorded(kC1F, true);
// Home page events.
- ExpectEventRecorded("C2I", true);
- ExpectEventRecorded("C2S", true);
- ExpectEventRecorded("C2F", false);
+ ExpectEventRecorded(kC2I, true);
+ ExpectEventRecorded(kC2S, true);
+ ExpectEventRecorded(kC2F, false);
ExpectRlzPingSent(true);
}
@@ -528,78 +549,80 @@ TEST_F(RlzLibTest, HomepageUsageDoesNotSendPingWhenDelayNegative) {
SimulateHomepageUsage();
// Omnibox events.
- ExpectEventRecorded("C1I", false);
- ExpectEventRecorded("C1S", false);
- ExpectEventRecorded("C1F", false);
+ ExpectEventRecorded(kC1I, false);
+ ExpectEventRecorded(kC1S, false);
+ ExpectEventRecorded(kC1F, false);
// Home page events.
- ExpectEventRecorded("C2I", false);
- ExpectEventRecorded("C2S", false);
- ExpectEventRecorded("C2F", true);
+ ExpectEventRecorded(kC2I, false);
+ ExpectEventRecorded(kC2S, false);
+ ExpectEventRecorded(kC2F, true);
ExpectRlzPingSent(false);
}
TEST_F(RlzLibTest, GetAccessPointRlzOnIoThread) {
// Set dummy RLZ string.
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, kOmniboxRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString);
string16 rlz;
tracker_.set_assume_not_ui_thread(true);
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str());
}
TEST_F(RlzLibTest, GetAccessPointRlzNotOnIoThread) {
// Set dummy RLZ string.
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, kOmniboxRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString);
string16 rlz;
tracker_.set_assume_not_ui_thread(false);
- EXPECT_FALSE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_FALSE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
}
TEST_F(RlzLibTest, GetAccessPointRlzIsCached) {
// Set dummy RLZ string.
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, kOmniboxRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString);
string16 rlz;
tracker_.set_assume_not_ui_thread(false);
- EXPECT_FALSE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_FALSE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
tracker_.set_assume_not_ui_thread(true);
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str());
tracker_.set_assume_not_ui_thread(false);
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str());
}
TEST_F(RlzLibTest, PingUpdatesRlzCache) {
// Set dummy RLZ string.
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, kOmniboxRlzString);
- rlz_lib::SetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, kHomepageRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, kOmniboxRlzString);
+ rlz_lib::SetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, kHomepageRlzString);
string16 rlz;
// Prime the cache.
tracker_.set_assume_not_ui_thread(true);
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str());
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(
+ RLZTracker::CHROME_HOME_PAGE, &rlz));
EXPECT_STREQ(kHomepageRlzString, UTF16ToUTF8(rlz).c_str());
// Make sure cache is valid.
tracker_.set_assume_not_ui_thread(false);
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
EXPECT_STREQ(kOmniboxRlzString, UTF16ToUTF8(rlz).c_str());
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(
+ RLZTracker::CHROME_HOME_PAGE, &rlz));
EXPECT_STREQ(kHomepageRlzString, UTF16ToUTF8(rlz).c_str());
// Perform ping.
@@ -611,9 +634,10 @@ TEST_F(RlzLibTest, PingUpdatesRlzCache) {
// Make sure cache is now updated.
tracker_.set_assume_not_ui_thread(false);
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, &rlz));
EXPECT_STREQ(kNewOmniboxRlzString, UTF16ToUTF8(rlz).c_str());
- EXPECT_TRUE(RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_HOME_PAGE, &rlz));
+ EXPECT_TRUE(RLZTracker::GetAccessPointRlz(
+ RLZTracker::CHROME_HOME_PAGE, &rlz));
EXPECT_STREQ(kNewHomepageRlzString, UTF16ToUTF8(rlz).c_str());
}
diff --git a/rlz/lib/lib_values.cc b/rlz/lib/lib_values.cc
index 467e4568..68b91d8 100644
--- a/rlz/lib/lib_values.cc
+++ b/rlz/lib/lib_values.cc
@@ -93,8 +93,8 @@ const char* GetAccessPointName(AccessPoint point) {
case PARTNER_AP_3: return "V3";
case PARTNER_AP_4: return "V4";
case PARTNER_AP_5: return "V5";
- case UNDEFINED_AP_H: return "RH";
- case UNDEFINED_AP_I: return "RI";
+ case CHROME_MAC_OMNIBOX: return "C5";
+ case CHROME_MAC_HOME_PAGE: return "C6";
case UNDEFINED_AP_J: return "RJ";
case UNDEFINED_AP_K: return "RK";
case UNDEFINED_AP_L: return "RL";
diff --git a/rlz/lib/rlz_enums.h b/rlz/lib/rlz_enums.h
index 4fc60ff..630db11 100644
--- a/rlz/lib/rlz_enums.h
+++ b/rlz/lib/rlz_enums.h
@@ -55,11 +55,12 @@ enum AccessPoint {
PARTNER_AP_4,
PARTNER_AP_5,
+ CHROME_MAC_OMNIBOX, // Chrome searches through the address bar omnibox (mac).
+ CHROME_MAC_HOME_PAGE,// Chrome searches through Google as home page (mac).
+
// Unclaimed access points - should be used first before creating new APs.
// Please also make sure you re-name the enum before using an unclaimed value;
// this acts as a check to ensure we don't have collisions.
- UNDEFINED_AP_H,
- UNDEFINED_AP_I,
UNDEFINED_AP_J,
UNDEFINED_AP_K,
UNDEFINED_AP_L,