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

Unified Diff: trunk/src/net/spdy/spdy_test_utils.cc

Issue 485943004: Revert 290320 "Refactor pooling logic into a helper method" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/net/spdy/spdy_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/spdy/spdy_test_utils.cc
===================================================================
--- trunk/src/net/spdy/spdy_test_utils.cc (revision 290385)
+++ trunk/src/net/spdy/spdy_test_utils.cc (working copy)
@@ -7,13 +7,10 @@
#include <cstring>
#include <vector>
-#include "base/base64.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/sys_byteorder.h"
-#include "net/http/transport_security_state.h"
-#include "net/ssl/ssl_info.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
@@ -142,36 +139,6 @@
return result;
}
-HashValue GetTestHashValue(uint8_t label) {
- HashValue hash_value(HASH_VALUE_SHA256);
- memset(hash_value.data(), label, hash_value.size());
- return hash_value;
-}
-
-std::string GetTestPin(uint8_t label) {
- HashValue hash_value = GetTestHashValue(label);
- std::string base64;
- base::Base64Encode(base::StringPiece(
- reinterpret_cast<char*>(hash_value.data()), hash_value.size()), &base64);
-
- return std::string("pin-sha256=\"") + base64 + "\"";
-}
-
-void AddPin(TransportSecurityState* state,
- const std::string& host,
- uint8_t primary_label,
- uint8_t backup_label) {
- std::string primary_pin = GetTestPin(primary_label);
- std::string backup_pin = GetTestPin(backup_label);
- std::string header = "max-age = 10000; " + primary_pin + "; " + backup_pin;
-
- // Construct a fake SSLInfo that will pass AddHPKPHeader's checks.
- SSLInfo ssl_info;
- ssl_info.is_issued_by_known_root = true;
- ssl_info.public_key_hashes.push_back(GetTestHashValue(primary_label));
- EXPECT_TRUE(state->AddHPKPHeader(host, header, ssl_info));
-}
-
} // namespace test
} // namespace net
« no previous file with comments | « trunk/src/net/spdy/spdy_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698