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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <map> 5 #include <map>
6 #include <queue> 6 #include <queue>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 "{\"A\":[\"test text\"],\"B\":[\"\"],\"C\":[\"test password\"]}"; 567 "{\"A\":[\"test text\"],\"B\":[\"\"],\"C\":[\"test password\"]}";
568 scoped_ptr<const Value> form_data(base::JSONReader::Read(kFormData)); 568 scoped_ptr<const Value> form_data(base::JSONReader::Read(kFormData));
569 ASSERT_TRUE(form_data.get() != NULL); 569 ASSERT_TRUE(form_data.get() != NULL);
570 ASSERT_TRUE(form_data->GetType() == Value::TYPE_DICTIONARY); 570 ASSERT_TRUE(form_data->GetType() == Value::TYPE_DICTIONARY);
571 // Contents of raw. 571 // Contents of raw.
572 ListValue raw; 572 ListValue raw;
573 extensions::subtle::AppendKeyValuePair( 573 extensions::subtle::AppendKeyValuePair(
574 keys::kRequestBodyRawBytesKey, 574 keys::kRequestBodyRawBytesKey,
575 BinaryValue::CreateWithCopiedBuffer(kPlainBlock1, kPlainBlock1Length), 575 BinaryValue::CreateWithCopiedBuffer(kPlainBlock1, kPlainBlock1Length),
576 &raw); 576 &raw);
577 extensions::subtle::AppendKeyValuePair(keys::kRequestBodyRawFileKey, 577 extensions::subtle::AppendKeyValuePair(
578 Value::CreateStringValue(""), 578 keys::kRequestBodyRawFileKey,
579 &raw); 579 Value::CreateStringValue(std::string()),
580 &raw);
580 extensions::subtle::AppendKeyValuePair( 581 extensions::subtle::AppendKeyValuePair(
581 keys::kRequestBodyRawBytesKey, 582 keys::kRequestBodyRawBytesKey,
582 BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length), 583 BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length),
583 &raw); 584 &raw);
584 // Summary. 585 // Summary.
585 const Value* const kExpected[] = { 586 const Value* const kExpected[] = {
586 form_data.get(), 587 form_data.get(),
587 NULL, 588 NULL,
588 &raw, 589 &raw,
589 &raw, 590 &raw,
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 int expected_extra_info_spec) { 956 int expected_extra_info_spec) {
956 int actual_info_spec; 957 int actual_info_spec;
957 bool actual_return_code = GenerateInfoSpec(values, &actual_info_spec); 958 bool actual_return_code = GenerateInfoSpec(values, &actual_info_spec);
958 EXPECT_EQ(expected_return_code, actual_return_code); 959 EXPECT_EQ(expected_return_code, actual_return_code);
959 if (expected_return_code) 960 if (expected_return_code)
960 EXPECT_EQ(expected_extra_info_spec, actual_info_spec); 961 EXPECT_EQ(expected_extra_info_spec, actual_info_spec);
961 } 962 }
962 963
963 } 964 }
964 TEST_F(ExtensionWebRequestTest, InitFromValue) { 965 TEST_F(ExtensionWebRequestTest, InitFromValue) {
965 TestInitFromValue("", true, 0); 966 TestInitFromValue(std::string(), true, 0);
966 967
967 // Single valid values. 968 // Single valid values.
968 TestInitFromValue( 969 TestInitFromValue(
969 "requestHeaders", 970 "requestHeaders",
970 true, 971 true,
971 ExtensionWebRequestEventRouter::ExtraInfoSpec::REQUEST_HEADERS); 972 ExtensionWebRequestEventRouter::ExtraInfoSpec::REQUEST_HEADERS);
972 TestInitFromValue( 973 TestInitFromValue(
973 "responseHeaders", 974 "responseHeaders",
974 true, 975 true,
975 ExtensionWebRequestEventRouter::ExtraInfoSpec::RESPONSE_HEADERS); 976 ExtensionWebRequestEventRouter::ExtraInfoSpec::RESPONSE_HEADERS);
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 EXPECT_TRUE(credentials_set); 2126 EXPECT_TRUE(credentials_set);
2126 EXPECT_FALSE(auth3.Empty()); 2127 EXPECT_FALSE(auth3.Empty());
2127 EXPECT_EQ(username, auth1.username()); 2128 EXPECT_EQ(username, auth1.username());
2128 EXPECT_EQ(password, auth1.password()); 2129 EXPECT_EQ(password, auth1.password());
2129 EXPECT_EQ(1u, warning_set.size()); 2130 EXPECT_EQ(1u, warning_set.size());
2130 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2131 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2131 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2132 EXPECT_EQ(3u, capturing_net_log.GetSize());
2132 } 2133 }
2133 2134
2134 } // namespace extensions 2135 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698