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

Side by Side Diff: components/autofill/content/browser/wallet/wallet_client_unittest.cc

Issue 545193008: Use base::StringPairs where appropriate from /components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/json/json_reader.h" 5 #include "base/json/json_reader.h"
6 #include "base/json/json_writer.h" 6 #include "base/json/json_writer.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 net::HttpRequestHeaders request_headers; 796 net::HttpRequestHeaders request_headers;
797 fetcher->GetExtraRequestHeaders(&request_headers); 797 fetcher->GetExtraRequestHeaders(&request_headers);
798 std::string auth_header_value; 798 std::string auth_header_value;
799 EXPECT_TRUE(request_headers.GetHeader( 799 EXPECT_TRUE(request_headers.GetHeader(
800 net::HttpRequestHeaders::kAuthorization, 800 net::HttpRequestHeaders::kAuthorization,
801 &auth_header_value)); 801 &auth_header_value));
802 EXPECT_EQ("GoogleLogin auth=gdToken", auth_header_value); 802 EXPECT_EQ("GoogleLogin auth=gdToken", auth_header_value);
803 803
804 const std::string& upload_data = fetcher->upload_data(); 804 const std::string& upload_data = fetcher->upload_data();
805 std::vector<std::pair<std::string, std::string> > tokens; 805 base::StringPairs tokens;
806 base::SplitStringIntoKeyValuePairs(upload_data, '=', '&', &tokens); 806 base::SplitStringIntoKeyValuePairs(upload_data, '=', '&', &tokens);
807 EXPECT_EQ(tokens.size(), expected_parameter_number); 807 EXPECT_EQ(tokens.size(), expected_parameter_number);
808 808
809 size_t num_params = 0U; 809 size_t num_params = 0U;
810 for (size_t i = 0; i < tokens.size(); ++i) { 810 for (base::StringPairs::const_iterator iter = tokens.begin();
811 const std::string& key = tokens[i].first; 811 iter != tokens.end();
812 const std::string& value = tokens[i].second; 812 ++iter) {
813 const std::string& key = iter->first;
814 const std::string& value = iter->second;
813 815
814 if (key == "request_content_type") { 816 if (key == "request_content_type") {
815 EXPECT_EQ("application/json", value); 817 EXPECT_EQ("application/json", value);
816 num_params++; 818 num_params++;
817 } 819 }
818 820
819 if (key == "request") { 821 if (key == "request") {
820 EXPECT_EQ(json_payload, 822 EXPECT_EQ(json_payload,
821 GetData( 823 GetData(
822 net::UnescapeURLComponent( 824 net::UnescapeURLComponent(
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 delegate_.ExpectBaselineMetrics(); 1862 delegate_.ExpectBaselineMetrics();
1861 1863
1862 wallet_client_->GetWalletItems(base::string16(), base::string16()); 1864 wallet_client_->GetWalletItems(base::string16(), base::string16());
1863 EXPECT_TRUE(wallet_client_->HasRequestInProgress()); 1865 EXPECT_TRUE(wallet_client_->HasRequestInProgress());
1864 wallet_client_->CancelRequest(); 1866 wallet_client_->CancelRequest();
1865 EXPECT_FALSE(wallet_client_->HasRequestInProgress()); 1867 EXPECT_FALSE(wallet_client_->HasRequestInProgress());
1866 } 1868 }
1867 1869
1868 } // namespace wallet 1870 } // namespace wallet
1869 } // namespace autofill 1871 } // namespace autofill
OLDNEW
« no previous file with comments | « components/auto_login_parser/auto_login_parser.cc ('k') | components/leveldb_proto/leveldb_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698