Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Issue 6253002: AU: XmlEncode the previous version, just in case. (Closed)

Created:
9 years, 11 months ago by petkov
Modified:
9 years, 7 months ago
Reviewers:
adlr
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Visibility:
Public.

Description

AU: XmlEncode the previous version, just in case. BUG=9198 TEST=unit tests Change-Id: I5ae497fa4c318645ac07ee6fcef6dad9b276606f Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=5c0f36e

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M omaha_request_action.cc View 1 chunk +1 line, -1 line 0 comments Download
M omaha_request_action_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
petkov
I integrated the original CL into R9.y already. It might be nice to get this ...
9 years, 11 months ago (2011-01-13 21:12:10 UTC) #1
adlr
9 years, 11 months ago (2011-01-13 21:14:55 UTC) #2
LGTM

On Thu, Jan 13, 2011 at 1:12 PM, <petkov@chromium.org> wrote:

> Reviewers: adlr,
>
> Message:
> I integrated the original CL into R9.y already. It might be nice to get
> this
> patch into R9.y too.
>
>
> Description:
> AU: XmlEncode the previous version, just in case.
>
> BUG=9198
> TEST=unit tests
>
> Change-Id: I5ae497fa4c318645ac07ee6fcef6dad9b276606f
>
> Please review this at http://codereview.chromium.org/6253002/
>
> SVN Base: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
>
> Affected files:
>  M omaha_request_action.cc
>  M omaha_request_action_unittest.cc
>
>
> Index: omaha_request_action.cc
> diff --git a/omaha_request_action.cc b/omaha_request_action.cc
> index
>
d5b324176e6f7b4828da2d1d71247df497aea671..4c77ce02019aa2eec0a5a0c2dbc744865e1dbcc0
> 100644
> --- a/omaha_request_action.cc
> +++ b/omaha_request_action.cc
> @@ -114,7 +114,7 @@ string FormatRequest(const OmahaEvent* event,
>           "previousversion=\"%s\"></o:event>\n",
>           OmahaEvent::kTypeUpdateComplete,
>           OmahaEvent::kResultSuccessReboot,
> -          prev_version.c_str());
> +          XmlEncode(prev_version).c_str());
>       LOG_IF(WARNING, !prefs->SetString(kPrefsPreviousVersion, ""))
>           << "Unable to reset the previous version.";
>     }
> Index: omaha_request_action_unittest.cc
> diff --git a/omaha_request_action_unittest.cc
> b/omaha_request_action_unittest.cc
> index
>
8082e1567f237eedfc40a96ca825364eb097eec2..7e67555f592f4a57466bd47fc78324c9d5819e68
> 100755
> --- a/omaha_request_action_unittest.cc
> +++ b/omaha_request_action_unittest.cc
> @@ -546,7 +546,7 @@ TEST(OmahaRequestActionTest,
> FormatUpdateCheckPrevVersionOutputTest) {
>   vector<char> post_data;
>   NiceMock<PrefsMock> prefs;
>   EXPECT_CALL(prefs, GetString(kPrefsPreviousVersion, _))
> -      .WillOnce(DoAll(SetArgumentPointee<1>(string("1.2.3.4")),
> Return(true)));
> +      .WillOnce(DoAll(SetArgumentPointee<1>(string("1.2>3.4")),
> Return(true)));
>   EXPECT_CALL(prefs, SetString(kPrefsPreviousVersion, ""))
>       .WillOnce(Return(true));
>   ASSERT_FALSE(TestUpdateCheck(&prefs,
> @@ -565,7 +565,7 @@ TEST(OmahaRequestActionTest,
> FormatUpdateCheckPrevVersionOutputTest) {
>             string::npos);
>   string prev_version_event = StringPrintf(
>       "        <o:event eventtype=\"%d\" eventresult=\"%d\" "
> -      "previousversion=\"1.2.3.4\"></o:event>\n",
> +      "previousversion=\"1.2&gt;3.4\"></o:event>\n",
>       OmahaEvent::kTypeUpdateComplete,
>       OmahaEvent::kResultSuccessReboot);
>   EXPECT_NE(post_str.find(prev_version_event), string::npos);
>
>
>

Powered by Google App Engine
This is Rietveld 408576698