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

Side by Side Diff: chrome/browser/component_updater/test/component_updater_service_unittest.cc

Issue 165393009: Added "lang" attribute to the component updater update requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « chrome/browser/component_updater/component_updater_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "chrome/browser/component_updater/test/component_updater_service_unitte st.h" 5 #include "chrome/browser/component_updater/test/component_updater_service_unitte st.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 // ... 483 // ...
484 // </request> 484 // </request>
485 const std::string update_request(post_interceptor_->GetRequests()[0]); 485 const std::string update_request(post_interceptor_->GetRequests()[0]);
486 std::vector<base::StringPiece> elements; 486 std::vector<base::StringPiece> elements;
487 Tokenize(update_request, "<>", &elements); 487 Tokenize(update_request, "<>", &elements);
488 EXPECT_NE(string::npos, elements[1].find(" os=")); 488 EXPECT_NE(string::npos, elements[1].find(" os="));
489 EXPECT_NE(string::npos, elements[1].find(" arch=")); 489 EXPECT_NE(string::npos, elements[1].find(" arch="));
490 EXPECT_NE(string::npos, elements[1].find(" prodchannel=")); 490 EXPECT_NE(string::npos, elements[1].find(" prodchannel="));
491 EXPECT_NE(string::npos, elements[1].find(" prodversion=")); 491 EXPECT_NE(string::npos, elements[1].find(" prodversion="));
492 492
493 // Look for additional attributes of the request, such as |version|,
494 // |requestid|, |lang|, and |nacl_arch|.
495 EXPECT_NE(string::npos, elements[1].find(" version="));
496 EXPECT_NE(string::npos, elements[1].find(" requestid="));
497 EXPECT_NE(string::npos, elements[1].find(" lang="));
498 EXPECT_NE(string::npos, elements[1].find(" nacl_arch="));
499
493 component_updater()->Stop(); 500 component_updater()->Stop();
494 } 501 }
495 502
496 // This test checks that the "prodversionmin" value is handled correctly. In 503 // This test checks that the "prodversionmin" value is handled correctly. In
497 // particular there should not be an install because the minimum product 504 // particular there should not be an install because the minimum product
498 // version is much higher than of chrome. 505 // version is much higher than of chrome.
499 TEST_F(ComponentUpdaterTest, ProdVersionCheck) { 506 TEST_F(ComponentUpdaterTest, ProdVersionCheck) {
500 EXPECT_TRUE(post_interceptor_->ExpectRequest(new PartialMatch( 507 EXPECT_TRUE(post_interceptor_->ExpectRequest(new PartialMatch(
501 "updatecheck"), test_file("updatecheck_reply_2.xml"))); 508 "updatecheck"), test_file("updatecheck_reply_2.xml")));
502 509
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 EXPECT_EQ(1, post_interceptor_->GetHitCount()); 1403 EXPECT_EQ(1, post_interceptor_->GetHitCount());
1397 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error()); 1404 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->error());
1398 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count()); 1405 EXPECT_EQ(0, static_cast<TestInstaller*>(com.installer)->install_count());
1399 1406
1400 component_updater()->Stop(); 1407 component_updater()->Stop();
1401 } 1408 }
1402 1409
1403 1410
1404 } // namespace component_updater 1411 } // namespace component_updater
1405 1412
OLDNEW
« 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