| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |