summaryrefslogtreecommitdiffstats
path: root/rlz/lib/lib_values_unittest.cc
diff options
context:
space:
mode:
authorsdefresne@chromium.org <sdefresne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 18:10:32 +0000
committersdefresne@chromium.org <sdefresne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 18:10:32 +0000
commit29f580249b14b54fd43544a2991746fde6780a4c (patch)
treeb9dba638819f90db2e5853d8855c81733fa4ca7b /rlz/lib/lib_values_unittest.cc
parent90963efa16f3f2e1da168fdca1872a638939aa51 (diff)
downloadchromium_src-29f580249b14b54fd43544a2991746fde6780a4c.zip
chromium_src-29f580249b14b54fd43544a2991746fde6780a4c.tar.gz
chromium_src-29f580249b14b54fd43544a2991746fde6780a4c.tar.bz2
Use invalid value for GetAccessPointName for CHROME_IOS_RESERVED
The team that uses the RLZ access point does not want to reserve two access points for Chrome on iOS since only one is currently used but the enumeration rlz_lib::AccessPoint cannot be changed. Mark the CHROME_IOS_RESERVED access point enumeration value as not supported in IsAccessPointSupported (as we should never reference an access point with enumeration value until the value is reused). This fixes the code that iterates over all values in that enumeration in FinancialPing::FormRequest when no events have been recorded. Return an invalid value in GetAccessPointName if called with the enumeration value rlz_lib::AccessPoint instead of returning NULL to avoid a crash on Chrome OS (constructing a std::string from NULL crash in strlen on Chrome OS). BUG=360686,363700 Review URL: https://codereview.chromium.org/239053004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'rlz/lib/lib_values_unittest.cc')
-rw-r--r--rlz/lib/lib_values_unittest.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/rlz/lib/lib_values_unittest.cc b/rlz/lib/lib_values_unittest.cc
index 7e8fa83..3fcda4f 100644
--- a/rlz/lib/lib_values_unittest.cc
+++ b/rlz/lib/lib_values_unittest.cc
@@ -32,8 +32,13 @@ TEST(LibValuesUnittest, GetAccessPointFromName) {
EXPECT_FALSE(rlz_lib::GetAccessPointFromName("T4 ", &point));
EXPECT_EQ(rlz_lib::NO_ACCESS_POINT, point);
-}
+ for (int ap = rlz_lib::NO_ACCESS_POINT + 1;
+ ap < rlz_lib::LAST_ACCESS_POINT; ++ap) {
+ rlz_lib::AccessPoint point = static_cast<rlz_lib::AccessPoint>(ap);
+ EXPECT_TRUE(GetAccessPointName(point) != NULL);
+ }
+}
TEST(LibValuesUnittest, GetEventFromName) {
rlz_lib::SetExpectedAssertion("GetEventFromName: event is NULL");