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

Unified Diff: chrome/browser/component_updater/test/component_updater_service_unittest.cc

Issue 130543002: Added "os" attribute in the component updater update requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/component_updater/component_updater_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/test/component_updater_service_unittest.cc
diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.cc b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
index 31483686f677d3d465015ccf9ed3577084fa8613..99a7acb32b6cffa5b093f29d39882df28b938813 100644
--- a/chrome/browser/component_updater/test/component_updater_service_unittest.cc
+++ b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
@@ -7,6 +7,7 @@
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/component_updater/component_updater_utils.h"
@@ -471,6 +472,21 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
"request protocol=\"3.0\" extra=\"foo\""))
<< post_interceptor_->GetRequestsAsString();
+ // Tokenize the request string to look for specific attributes, which
+ // are important for backward compatibility with the version v2 of the update
+ // protocol. In this case, inspect the <request>, which is the first element
+ // after the xml declaration of the update request body.
+ // Expect to find the |os| and the |arch| attributes:
+ // <?xml version="1.0" encoding="UTF-8"?>
+ // <request...os=...arch=...>
+ // ...
+ // </request>
+ const std::string update_request(post_interceptor_->GetRequests()[0]);
+ std::vector<base::StringPiece> elements;
+ Tokenize(update_request, "<>", &elements);
+ EXPECT_NE(string::npos, elements[1].find("os="));
+ EXPECT_NE(string::npos, elements[1].find("arch="));
+
component_updater()->Stop();
}
« no previous file with comments | « chrome/browser/component_updater/component_updater_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698