OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium 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 "components/update_client/update_checker.h" | 5 #include "components/update_client/update_checker.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 post_interceptor_->GetRequests()[0].find( | 197 post_interceptor_->GetRequests()[0].find( |
198 "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\" " | 198 "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\" " |
199 "brand=\"TEST\" ap=\"some_ap\"><updatecheck/><ping rd=\"-2\" ")); | 199 "brand=\"TEST\" ap=\"some_ap\"><updatecheck/><ping rd=\"-2\" ")); |
200 EXPECT_NE(string::npos, | 200 EXPECT_NE(string::npos, |
201 post_interceptor_->GetRequests()[0].find( | 201 post_interceptor_->GetRequests()[0].find( |
202 "<packages><package fp=\"fp1\"/></packages></app>")); | 202 "<packages><package fp=\"fp1\"/></packages></app>")); |
203 | 203 |
204 EXPECT_NE(string::npos, | 204 EXPECT_NE(string::npos, |
205 post_interceptor_->GetRequests()[0].find("<hw physmemory=")); | 205 post_interceptor_->GetRequests()[0].find("<hw physmemory=")); |
206 | 206 |
| 207 // Tests that the progid is injected correctly from the configurator. |
| 208 EXPECT_NE(string::npos, |
| 209 post_interceptor_->GetRequests()[0].find( |
| 210 " version=\"fake_prodid-30.0\" prodversion=\"30.0\" ")); |
| 211 |
207 // Sanity check the arguments of the callback after parsing. | 212 // Sanity check the arguments of the callback after parsing. |
208 EXPECT_EQ(0, error_); | 213 EXPECT_EQ(0, error_); |
209 EXPECT_EQ(1ul, results_.list.size()); | 214 EXPECT_EQ(1ul, results_.list.size()); |
210 EXPECT_STREQ("jebgalgnebhfojomionfpkfelancnnkf", | 215 EXPECT_STREQ("jebgalgnebhfojomionfpkfelancnnkf", |
211 results_.list[0].extension_id.c_str()); | 216 results_.list[0].extension_id.c_str()); |
212 EXPECT_STREQ("1.0", results_.list[0].manifest.version.c_str()); | 217 EXPECT_STREQ("1.0", results_.list[0].manifest.version.c_str()); |
213 } | 218 } |
214 | 219 |
215 // Tests that an invalid "ap" is not serialized. | 220 // Tests that an invalid "ap" is not serialized. |
216 TEST_F(UpdateCheckerTest, UpdateCheckInvalidAp) { | 221 TEST_F(UpdateCheckerTest, UpdateCheckInvalidAp) { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 base::Unretained(this))); | 499 base::Unretained(this))); |
495 RunThreads(); | 500 RunThreads(); |
496 EXPECT_NE( | 501 EXPECT_NE( |
497 string::npos, | 502 string::npos, |
498 post_interceptor_->GetRequests()[3].find( | 503 post_interceptor_->GetRequests()[3].find( |
499 "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\">" | 504 "<app appid=\"jebgalgnebhfojomionfpkfelancnnkf\" version=\"0.9\">" |
500 "<updatecheck/>")); | 505 "<updatecheck/>")); |
501 } | 506 } |
502 | 507 |
503 } // namespace update_client | 508 } // namespace update_client |
OLD | NEW |