AU: change 'userinitiated' into 'installsource'

- Renamed the flag so it is in line with the flag name and values used
  by Chrome to indicate different forms of an update. It will allow us
  to reuse existing Omaha dashboard facilities to monitor this flag.

- Also, per advise from Omaha, moved the said attribute to the <request>
  XML node.

BUG=chromium-os:26594
TEST=New flag name/values now appear

Change-Id: I46a158b3aef8a56813464d74fc6043ea5b1ec3c1
Reviewed-on: https://gerrit.chromium.org/gerrit/41951
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/omaha_request_action_unittest.cc b/omaha_request_action_unittest.cc
index 42b2134..5ce87d7 100644
--- a/omaha_request_action_unittest.cc
+++ b/omaha_request_action_unittest.cc
@@ -918,7 +918,6 @@
       "        <ping active=\"1\" a=\"-1\" r=\"-1\"></ping>\n"
       "        <updatecheck"
       " targetversionprefix=\"\""
-      " userinitiated=\"false\""
       "></updatecheck>\n"),
       string::npos);
   EXPECT_NE(post_str.find("hardware_class=\"OEM MODEL 09235 7471\""),
@@ -949,7 +948,6 @@
       "        <ping active=\"1\" a=\"-1\" r=\"-1\"></ping>\n"
       "        <updatecheck"
       " targetversionprefix=\"\""
-      " userinitiated=\"false\""
       "></updatecheck>\n"),
       string::npos);
   EXPECT_NE(post_str.find("hardware_class=\"OEM MODEL 09235 7471\""),
@@ -1058,7 +1056,7 @@
 TEST(OmahaRequestActionTest, FormatInteractiveOutputTest) {
   for (int i = 0; i < 2; i++) {
     bool interactive = i == 1;
-    const char* interactive_str = interactive ? "true" : "false";
+    const char* interactive_str = interactive ? "ondemandupdate" : "scheduler";
     vector<char> post_data;
     OmahaRequestParams params(OmahaRequestParams::kOsPlatform,
                               OmahaRequestParams::kOsVersion,
@@ -1084,7 +1082,7 @@
                                  &post_data));
     // convert post_data to string
     string post_str(&post_data[0], post_data.size());
-    EXPECT_NE(post_str.find(StringPrintf(" userinitiated=\"%s\"",
+    EXPECT_NE(post_str.find(StringPrintf("installsource=\"%s\"",
                                          interactive_str)),
               string::npos)
         << "i = " << i;