| 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 bf4f1c88f6ff6355663b01e054c170db6475827d..d5aff41a706ecb6a8044be3e792f16df06c91097 100644
|
| --- a/chrome/browser/component_updater/test/component_updater_service_unittest.cc
|
| +++ b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "chrome/browser/component_updater/test/component_updater_service_unittest.h"
|
|
|
| +#include <string>
|
| #include <vector>
|
|
|
| #include "base/files/file_util.h"
|
| @@ -196,13 +197,13 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) {
|
| EXPECT_EQ(2, post_interceptor_->GetCount())
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"abagagagagagagagagagagagagagagag\" version=\"1.1\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"abagagagagagagagagagagagagagagag\" version=\"1.1\">"
|
| "<updatecheck /></app>"))
|
| @@ -240,13 +241,13 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) {
|
| EXPECT_EQ(2, post_interceptor_->GetCount())
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"abagagagagagagagagagagagagagagag\" version=\"1.1\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"abagagagagagagagagagagagagagagag\" version=\"1.1\">"
|
| "<updatecheck /></app>"))
|
| @@ -345,20 +346,20 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
|
| EXPECT_EQ(1, get_interceptor_->GetHitCount());
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"abagagagagagagagagagagagagagagag\" version=\"2.2\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" "
|
| "version=\"0.9\" nextversion=\"1.0\">"
|
| @@ -366,12 +367,12 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
|
| << post_interceptor_->GetRequestsAsString();
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[2].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"1.0\">"
|
| "<updatecheck /></app>"));
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[2].find(
|
| "<app appid=\"abagagagagagagagagagagagagagagag\" version=\"2.2\">"
|
| "<updatecheck /></app>"))
|
| @@ -380,7 +381,7 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
|
| // Test the protocol version is correct and the extra request attributes
|
| // are included in the request.
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "request protocol=\"3.0\" extra=\"foo\""))
|
| << post_interceptor_->GetRequestsAsString();
|
| @@ -398,17 +399,17 @@ TEST_F(ComponentUpdaterTest, InstallCrx) {
|
| 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="));
|
| - EXPECT_NE(string::npos, elements[1].find(" prodchannel="));
|
| - EXPECT_NE(string::npos, elements[1].find(" prodversion="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" os="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" arch="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" prodchannel="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" prodversion="));
|
|
|
| // Look for additional attributes of the request, such as |version|,
|
| // |requestid|, |lang|, and |nacl_arch|.
|
| - EXPECT_NE(string::npos, elements[1].find(" version="));
|
| - EXPECT_NE(string::npos, elements[1].find(" requestid="));
|
| - EXPECT_NE(string::npos, elements[1].find(" lang="));
|
| - EXPECT_NE(string::npos, elements[1].find(" nacl_arch="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" version="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" requestid="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" lang="));
|
| + EXPECT_NE(std::string::npos, elements[1].find(" nacl_arch="));
|
|
|
| component_updater()->Stop();
|
| }
|
| @@ -562,19 +563,19 @@ TEST_F(ComponentUpdaterTest, MAYBE_OnDemandUpdate) {
|
| // Expect the update check to contain an "ondemand" request for the
|
| // second component (com2) and a normal request for the other component.
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"abagagagagagagagagagagagagagagag\" "
|
| "version=\"2.2\"><updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" "
|
| "version=\"0.9\" installsource=\"ondemand\"><updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" "
|
| "version=\"0.9\" nextversion=\"1.0\">"
|
| @@ -749,20 +750,20 @@ TEST_F(ComponentUpdaterTest, CheckReRegistration) {
|
| EXPECT_EQ(1, get_interceptor_->GetHitCount());
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" "
|
| "version=\"0.9\" nextversion=\"1.0\">"
|
| "<event eventtype=\"3\" eventresult=\"1\"/>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[2].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"1.0\">"
|
| "<updatecheck /></app>"))
|
| @@ -817,7 +818,7 @@ TEST_F(ComponentUpdaterTest, CheckReRegistration) {
|
| << post_interceptor_->GetRequestsAsString();
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"2.2\">"
|
| "<updatecheck /></app>"));
|
| @@ -875,26 +876,26 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdate) {
|
| EXPECT_EQ(2, get_interceptor_->GetHitCount());
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"0.0\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" "
|
| "version=\"0.0\" nextversion=\"1.0\">"
|
| "<event eventtype=\"3\" eventresult=\"1\" nextfp=\"1\"/>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[2].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"1.0\">"
|
| "<updatecheck /><packages><package fp=\"1\"/></packages></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[3].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" "
|
| "version=\"1.0\" nextversion=\"2.0\">"
|
| @@ -902,7 +903,7 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdate) {
|
| "previousfp=\"1\" nextfp=\"22\"/>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[4].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"2.0\">"
|
| "<updatecheck /><packages><package fp=\"22\"/></packages></app>"))
|
| @@ -965,13 +966,13 @@ TEST_F(ComponentUpdaterTest, MAYBE_DifferentialUpdateFails) {
|
| EXPECT_EQ(2, get_interceptor_->GetHitCount());
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"1.0\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" "
|
| "version=\"1.0\" nextversion=\"2.0\">"
|
| @@ -979,7 +980,7 @@ TEST_F(ComponentUpdaterTest, MAYBE_DifferentialUpdateFails) {
|
| "differrorcat=\"2\" differrorcode=\"16\" nextfp=\"22\"/>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[2].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"2.0\">"
|
| "<updatecheck /><packages><package fp=\"22\"/></packages></app>"))
|
| @@ -1031,13 +1032,13 @@ TEST_F(ComponentUpdaterTest, MAYBE_CheckFailedInstallPing) {
|
| EXPECT_EQ(2, get_interceptor_->GetHitCount());
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" "
|
| "version=\"0.9\" nextversion=\"1.0\">"
|
| @@ -1045,13 +1046,13 @@ TEST_F(ComponentUpdaterTest, MAYBE_CheckFailedInstallPing) {
|
| "errorcat=\"3\" errorcode=\"9\"/>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[2].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[3].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" "
|
| "version=\"0.9\" nextversion=\"1.0\">"
|
| @@ -1080,7 +1081,7 @@ TEST_F(ComponentUpdaterTest, MAYBE_CheckFailedInstallPing) {
|
| << post_interceptor_->GetRequestsAsString();
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\">"
|
| "<updatecheck /></app>"))
|
| @@ -1139,26 +1140,26 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdateFailErrorcode) {
|
| EXPECT_EQ(3, get_interceptor_->GetHitCount());
|
|
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[0].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"0.0\">"
|
| "<updatecheck /></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[1].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" "
|
| "version=\"0.0\" nextversion=\"1.0\">"
|
| "<event eventtype=\"3\" eventresult=\"1\" nextfp=\"1\"/>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[2].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"1.0\">"
|
| "<updatecheck /><packages><package fp=\"1\"/></packages></app>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[3].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" "
|
| "version=\"1.0\" nextversion=\"2.0\">"
|
| @@ -1168,7 +1169,7 @@ TEST_F(ComponentUpdaterTest, DifferentialUpdateFailErrorcode) {
|
| "previousfp=\"1\" nextfp=\"22\"/>"))
|
| << post_interceptor_->GetRequestsAsString();
|
| EXPECT_NE(
|
| - string::npos,
|
| + std::string::npos,
|
| post_interceptor_->GetRequests()[4].find(
|
| "<app appid=\"ihfokbkgjpifnbbojhneepfflplebdkc\" version=\"2.0\">"
|
| "<updatecheck /><packages><package fp=\"22\"/></packages></app>"))
|
|
|