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

Side by Side Diff: omaha_request_action_unittest.cc

Issue 6719012: Use crossystem rather than cros_boot_mode. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « SConstruct ('k') | setup_dev_packages » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include <glib.h> 8 #include <glib.h>
9 9
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 kActionCodeError), 596 kActionCodeError),
597 "invalid xml>", 597 "invalid xml>",
598 &post_data); 598 &post_data);
599 // convert post_data to string 599 // convert post_data to string
600 string post_str(&post_data[0], post_data.size()); 600 string post_str(&post_data[0], post_data.size());
601 string expected_event = StringPrintf( 601 string expected_event = StringPrintf(
602 " <o:event eventtype=\"%d\" eventresult=\"%d\" " 602 " <o:event eventtype=\"%d\" eventresult=\"%d\" "
603 "errorcode=\"%d\"></o:event>\n", 603 "errorcode=\"%d\"></o:event>\n",
604 OmahaEvent::kTypeDownloadComplete, 604 OmahaEvent::kTypeDownloadComplete,
605 OmahaEvent::kResultError, 605 OmahaEvent::kResultError,
606 kActionCodeError | kActionCodeBootModeFlag); 606 kActionCodeError);
607 EXPECT_NE(post_str.find(expected_event), string::npos); 607 EXPECT_NE(post_str.find(expected_event), string::npos);
608 EXPECT_EQ(post_str.find("o:updatecheck"), string::npos); 608 EXPECT_EQ(post_str.find("o:updatecheck"), string::npos);
609 } 609 }
610 610
611 TEST(OmahaRequestActionTest, IsEventTest) { 611 TEST(OmahaRequestActionTest, IsEventTest) {
612 string http_response("doesn't matter"); 612 string http_response("doesn't matter");
613 NiceMock<PrefsMock> prefs; 613 NiceMock<PrefsMock> prefs;
614 OmahaRequestAction update_check_action( 614 OmahaRequestAction update_check_action(
615 &prefs, 615 &prefs,
616 kDefaultTestParams, 616 kDefaultTestParams,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 "", 903 "",
904 1500, 904 1500,
905 static_cast<ActionExitCode>( 905 static_cast<ActionExitCode>(
906 kActionCodeOmahaRequestHTTPResponseBase + 999), 906 kActionCodeOmahaRequestHTTPResponseBase + 999),
907 &response, 907 &response,
908 NULL)); 908 NULL));
909 EXPECT_FALSE(response.update_exists); 909 EXPECT_FALSE(response.update_exists);
910 } 910 }
911 911
912 } // namespace chromeos_update_engine 912 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « SConstruct ('k') | setup_dev_packages » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698