AU: propagate a deadline form the update check response to Chrome.
Currently, this is done through the file system.
BUG=3284
TEST=unit tests
Change-Id: I0e579ef6ccd7832ca22a248e71f2689c27159056
TBR=resubmitting due to git issues
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index 8b15a86..f822357 100755
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -62,7 +62,8 @@
const string& codebase,
const string& hash,
const string& needsadmin,
- const string& size) {
+ const string& size,
+ const string& deadline) {
return string("<?xml version=\"1.0\" encoding=\"UTF-8\"?><gupdate "
"xmlns=\"http://www.google.com/update2/response\" "
"protocol=\"2.0\"><app "
@@ -72,7 +73,8 @@
"IsDelta=\"true\" "
"codebase=\"" + codebase + "\" hash=\"not-applicable\" "
"sha256=\"" + hash + "\" needsadmin=\"" + needsadmin + "\" "
- "size=\"" + size + "\" status=\"ok\"/></app></gupdate>";
+ "size=\"" + size + "\" deadline=\"" + deadline +
+ "\" status=\"ok\"/></app></gupdate>";
}
class OmahaRequestActionTestProcessorDelegate : public ActionProcessorDelegate {
@@ -232,7 +234,8 @@
"http://code/base", // dl url
"HASH1234=", // checksum
"false", // needs admin
- "123"), // size
+ "123", // size
+ "20101020"), // deadline
kActionCodeSuccess,
&response,
NULL));
@@ -245,6 +248,7 @@
EXPECT_EQ(123, response.size);
EXPECT_FALSE(response.needs_admin);
EXPECT_TRUE(response.prompt);
+ EXPECT_EQ("20101020", response.deadline);
}
TEST(OmahaRequestActionTest, NoOutputPipeTest) {
@@ -355,6 +359,7 @@
EXPECT_EQ(123, response.size);
EXPECT_TRUE(response.needs_admin);
EXPECT_FALSE(response.prompt);
+ EXPECT_TRUE(response.deadline.empty());
}
namespace {
@@ -448,13 +453,15 @@
"testthe&codebase", // dl url
"HASH1234=", // checksum
"false", // needs admin
- "123"), // size
+ "123", // size
+ "<20110101"), // deadline
kActionCodeSuccess,
&response,
NULL));
EXPECT_EQ(response.more_info_url, "testthe<url");
EXPECT_EQ(response.codebase, "testthe&codebase");
+ EXPECT_EQ(response.deadline, "<20110101");
}
TEST(OmahaRequestActionTest, ParseIntTest) {
@@ -470,7 +477,8 @@
"HASH1234=", // checksum
"false", // needs admin
// overflows int32:
- "123123123123123"), // size
+ "123123123123123", // size
+ "deadline"),
kActionCodeSuccess,
&response,
NULL));