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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 9415040: Refactor TransportSecurityState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/websockets/websocket_job_spdy2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
===================================================================
--- net/url_request/url_request_unittest.cc (revision 134551)
+++ net/url_request/url_request_unittest.cc (working copy)
@@ -479,8 +479,8 @@
void HTTPUploadDataOperationTest(const std::string& method) {
const int kMsgSize = 20000; // multiple of 10
const int kIterations = 50;
- char *uploadBytes = new char[kMsgSize+1];
- char *ptr = uploadBytes;
+ char* uploadBytes = new char[kMsgSize+1];
+ char* ptr = uploadBytes;
char marker = 'a';
for (int idx = 0; idx < kMsgSize/10; idx++) {
memcpy(ptr, "----------", 10);
@@ -1774,7 +1774,7 @@
scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext(true));
context->set_network_delegate(&network_delegate);
context->set_host_resolver(&host_resolver);
- TransportSecurityState transport_security_state("");
+ TransportSecurityState transport_security_state;
context->set_transport_security_state(&transport_security_state);
context->Init();
@@ -1817,10 +1817,10 @@
scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext(true));
context->set_network_delegate(&network_delegate);
context->set_host_resolver(&host_resolver);
- TransportSecurityState transport_security_state("");
+ TransportSecurityState transport_security_state;
TransportSecurityState::DomainState domain_state;
- EXPECT_TRUE(transport_security_state.HasMetadata(&domain_state,
- "www.google.com", true));
+ EXPECT_TRUE(transport_security_state.GetDomainState("www.google.com", true,
+ &domain_state));
context->set_transport_security_state(&transport_security_state);
context->Init();
@@ -1842,17 +1842,17 @@
// Get a fresh copy of the state, and check that it hasn't been updated.
TransportSecurityState::DomainState new_domain_state;
- EXPECT_TRUE(transport_security_state.HasMetadata(&new_domain_state,
- "www.google.com", true));
- EXPECT_EQ(new_domain_state.mode, domain_state.mode);
+ EXPECT_TRUE(transport_security_state.GetDomainState("www.google.com", true,
+ &new_domain_state));
+ EXPECT_EQ(new_domain_state.upgrade_mode, domain_state.upgrade_mode);
EXPECT_EQ(new_domain_state.include_subdomains,
domain_state.include_subdomains);
- EXPECT_TRUE(FingerprintsEqual(new_domain_state.preloaded_spki_hashes,
- domain_state.preloaded_spki_hashes));
+ EXPECT_TRUE(FingerprintsEqual(new_domain_state.static_spki_hashes,
+ domain_state.static_spki_hashes));
EXPECT_TRUE(FingerprintsEqual(new_domain_state.dynamic_spki_hashes,
domain_state.dynamic_spki_hashes));
- EXPECT_TRUE(FingerprintsEqual(new_domain_state.bad_preloaded_spki_hashes,
- domain_state.bad_preloaded_spki_hashes));
+ EXPECT_TRUE(FingerprintsEqual(new_domain_state.bad_static_spki_hashes,
+ domain_state.bad_static_spki_hashes));
}
namespace {
@@ -2571,8 +2571,8 @@
std::wstring lnk_path = app_path.value() + L".lnk";
HRESULT result;
- IShellLink *shell = NULL;
- IPersistFile *persist = NULL;
+ IShellLink* shell = NULL;
+ IPersistFile* persist = NULL;
CoInitialize(NULL);
// Temporarily create a shortcut for test
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/websockets/websocket_job_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698