Index: omaha_request_action_unittest.cc |
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc |
index 5ac0811b9f5e12c563cda594eefae00097799c1a..f4dcd1e9050077304e268707ab71e64129afb8dd 100755 |
--- a/omaha_request_action_unittest.cc |
+++ b/omaha_request_action_unittest.cc |
@@ -35,8 +35,6 @@ class OmahaRequestActionTest : public ::testing::Test { }; |
namespace { |
const OmahaRequestParams kDefaultTestParams( |
- "machine_id", |
- "user_id", |
OmahaRequestParams::kOsPlatform, |
OmahaRequestParams::kOsVersion, |
"service_pack", |
@@ -406,9 +404,7 @@ TEST(OmahaRequestActionTest, XmlEncodeTest) { |
vector<char> post_data; |
// Make sure XML Encode is being called on the params |
- OmahaRequestParams params("testthemachine<id", |
- "testtheuser_id<", |
- OmahaRequestParams::kOsPlatform, |
+ OmahaRequestParams params(OmahaRequestParams::kOsPlatform, |
OmahaRequestParams::kOsVersion, |
"testtheservice_pack>", |
"x86 generic<id", |
@@ -576,9 +572,7 @@ TEST(OmahaRequestActionTest, FormatDeltaOkayOutputTest) { |
bool delta_okay = i == 1; |
const char* delta_okay_str = delta_okay ? "true" : "false"; |
vector<char> post_data; |
- OmahaRequestParams params("machine_id", |
- "user_id", |
- OmahaRequestParams::kOsPlatform, |
+ OmahaRequestParams params(OmahaRequestParams::kOsPlatform, |
OmahaRequestParams::kOsVersion, |
"service_pack", |
"x86-generic", |
@@ -738,7 +732,7 @@ TEST(OmahaRequestActionTest, BackInTimePingTest) { |
TEST(OmahaRequestActionTest, LastPingDayUpdateTest) { |
// This test checks that the action updates the last ping day to now |
- // minus 200 seconds with a slack for 5 seconds. Therefore, the test |
+ // minus 200 seconds with a slack of 5 seconds. Therefore, the test |
// may fail if it runs for longer than 5 seconds. It shouldn't run |
// that long though. |
int64_t midnight = |
@@ -799,4 +793,18 @@ TEST(OmahaRequestActionTest, BadElapsedSecondsTest) { |
NULL)); |
} |
+TEST(OmahaRequestActionTest, NoUniqueIDTest) { |
+ vector<char> post_data; |
+ ASSERT_FALSE(TestUpdateCheck(NULL, // prefs |
+ kDefaultTestParams, |
+ "invalid xml>", |
+ kActionCodeError, |
+ NULL, // response |
+ &post_data)); |
+ // convert post_data to string |
+ string post_str(&post_data[0], post_data.size()); |
+ EXPECT_EQ(post_str.find("machineid="), string::npos); |
+ EXPECT_EQ(post_str.find("userid="), string::npos); |
+} |
+ |
} // namespace chromeos_update_engine |