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

Side by Side Diff: net/socket/ssl_client_socket_unittest.cc

Issue 2558963004: Fix a typo in SSLClientSocketTest.DumpMemoryStats (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | 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 (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 "net/socket/ssl_client_socket.h" 5 #include "net/socket/ssl_client_socket.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 3696 matching lines...) Expand 10 before | Expand all | Expand 10 after
3707 sock_->DumpMemoryStats(process_memory_dump.get(), 3707 sock_->DumpMemoryStats(process_memory_dump.get(),
3708 parent_dump2->absolute_name()); 3708 parent_dump2->absolute_name());
3709 3709
3710 const base::trace_event::ProcessMemoryDump::AllocatorDumpsMap& 3710 const base::trace_event::ProcessMemoryDump::AllocatorDumpsMap&
3711 allocator_dumps = process_memory_dump->allocator_dumps(); 3711 allocator_dumps = process_memory_dump->allocator_dumps();
3712 bool did_dump[] = {false, false}; 3712 bool did_dump[] = {false, false};
3713 // Checks that there are two dumps because DumpMemoryStats() is invoked twice. 3713 // Checks that there are two dumps because DumpMemoryStats() is invoked twice.
3714 for (const auto& pair : allocator_dumps) { 3714 for (const auto& pair : allocator_dumps) {
3715 const std::string& dump_name = pair.first; 3715 const std::string& dump_name = pair.first;
3716 if (dump_name.find("ssl_socket") == std::string::npos) 3716 if (dump_name.find("ssl_socket") == std::string::npos)
3717 return; 3717 continue;
3718 std::unique_ptr<base::Value> raw_attrs = 3718 std::unique_ptr<base::Value> raw_attrs =
3719 pair.second->attributes_for_testing()->ToBaseValue(); 3719 pair.second->attributes_for_testing()->ToBaseValue();
3720 base::DictionaryValue* attrs; 3720 base::DictionaryValue* attrs;
3721 ASSERT_TRUE(raw_attrs->GetAsDictionary(&attrs)); 3721 ASSERT_TRUE(raw_attrs->GetAsDictionary(&attrs));
3722 base::DictionaryValue* buffer_size_attrs; 3722 base::DictionaryValue* buffer_size_attrs;
3723 ASSERT_TRUE(attrs->GetDictionary("buffer_size", &buffer_size_attrs)); 3723 ASSERT_TRUE(attrs->GetDictionary("buffer_size", &buffer_size_attrs));
3724 std::string buffer_size; 3724 std::string buffer_size;
3725 ASSERT_TRUE(buffer_size_attrs->GetString("value", &buffer_size)); 3725 ASSERT_TRUE(buffer_size_attrs->GetString("value", &buffer_size));
3726 ASSERT_TRUE(attrs->HasKey("serialized_cert_size")); 3726 ASSERT_TRUE(attrs->HasKey("serialized_cert_size"));
3727 ASSERT_TRUE(attrs->HasKey("cert_count")); 3727 ASSERT_TRUE(attrs->HasKey("cert_count"));
3728 if (dump_name.find("parent1/ssl_socket") != std::string::npos) { 3728 if (dump_name.find("parent1/ssl_socket") != std::string::npos) {
3729 did_dump[0] = true; 3729 did_dump[0] = true;
3730 ASSERT_EQ("0", buffer_size); 3730 ASSERT_EQ("0", buffer_size);
3731 } 3731 }
3732 if (dump_name.find("parent2/ssl_socket") != std::string::npos) { 3732 if (dump_name.find("parent2/ssl_socket") != std::string::npos) {
3733 did_dump[1] = true; 3733 did_dump[1] = true;
3734 // The read buffer is not released, so |buffer_size| can't be 0. 3734 // The read buffer is not released, so |buffer_size| can't be 0.
3735 ASSERT_NE("0", buffer_size); 3735 ASSERT_NE("0", buffer_size);
3736 } 3736 }
3737 } 3737 }
3738 EXPECT_THAT(did_dump, testing::ElementsAre(true, true)); 3738 EXPECT_THAT(did_dump, testing::ElementsAre(true, true));
3739 } 3739 }
3740 3740
3741 } // namespace net 3741 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698