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

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

Issue 2065793002: Return a unique_ptr from BinaryValue::CreateWithCopiedBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android and CrOS Created 4 years, 6 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 (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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <queue> 10 #include <queue>
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 ASSERT_TRUE(form_data.get() != NULL); 593 ASSERT_TRUE(form_data.get() != NULL);
594 ASSERT_TRUE(form_data->GetType() == base::Value::TYPE_DICTIONARY); 594 ASSERT_TRUE(form_data->GetType() == base::Value::TYPE_DICTIONARY);
595 // Contents of raw. 595 // Contents of raw.
596 base::ListValue raw; 596 base::ListValue raw;
597 extensions::subtle::AppendKeyValuePair( 597 extensions::subtle::AppendKeyValuePair(
598 keys::kRequestBodyRawBytesKey, 598 keys::kRequestBodyRawBytesKey,
599 BinaryValue::CreateWithCopiedBuffer(kPlainBlock1, kPlainBlock1Length), 599 BinaryValue::CreateWithCopiedBuffer(kPlainBlock1, kPlainBlock1Length),
600 &raw); 600 &raw);
601 extensions::subtle::AppendKeyValuePair( 601 extensions::subtle::AppendKeyValuePair(
602 keys::kRequestBodyRawFileKey, 602 keys::kRequestBodyRawFileKey,
603 new base::StringValue(std::string()), 603 base::MakeUnique<base::StringValue>(std::string()), &raw);
604 &raw);
605 extensions::subtle::AppendKeyValuePair( 604 extensions::subtle::AppendKeyValuePair(
606 keys::kRequestBodyRawBytesKey, 605 keys::kRequestBodyRawBytesKey,
607 BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length), 606 BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length),
608 &raw); 607 &raw);
609 // Summary. 608 // Summary.
610 const base::Value* const kExpected[] = { 609 const base::Value* const kExpected[] = {
611 form_data.get(), 610 form_data.get(),
612 NULL, 611 NULL,
613 &raw, 612 &raw,
614 &raw, 613 &raw,
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 EXPECT_TRUE(credentials_set); 2314 EXPECT_TRUE(credentials_set);
2316 EXPECT_FALSE(auth3.Empty()); 2315 EXPECT_FALSE(auth3.Empty());
2317 EXPECT_EQ(username, auth1.username()); 2316 EXPECT_EQ(username, auth1.username());
2318 EXPECT_EQ(password, auth1.password()); 2317 EXPECT_EQ(password, auth1.password());
2319 EXPECT_EQ(1u, warning_set.size()); 2318 EXPECT_EQ(1u, warning_set.size());
2320 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2319 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2321 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2320 EXPECT_EQ(3u, capturing_net_log.GetSize());
2322 } 2321 }
2323 2322
2324 } // namespace extensions 2323 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698