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

Side by Side Diff: net/http/http_response_headers_unittest.cc

Issue 2605293002: Add WARN_UNUSED_RESULT to base::Time methods that return bool. (Closed)
Patch Set: Add comment to PexeDownloader::didReceiveResponse() Created 3 years, 11 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 "net/http/http_response_headers.h" 5 #include "net/http/http_response_headers.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iostream> 10 #include <iostream>
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 773
774 class RequiresValidationTest 774 class RequiresValidationTest
775 : public HttpResponseHeadersTest, 775 : public HttpResponseHeadersTest,
776 public ::testing::WithParamInterface<RequiresValidationTestData> { 776 public ::testing::WithParamInterface<RequiresValidationTestData> {
777 }; 777 };
778 778
779 TEST_P(RequiresValidationTest, RequiresValidation) { 779 TEST_P(RequiresValidationTest, RequiresValidation) {
780 const RequiresValidationTestData test = GetParam(); 780 const RequiresValidationTestData test = GetParam();
781 781
782 base::Time request_time, response_time, current_time; 782 base::Time request_time, response_time, current_time;
783 base::Time::FromString("Wed, 28 Nov 2007 00:40:09 GMT", &request_time); 783 ASSERT_TRUE(
784 base::Time::FromString("Wed, 28 Nov 2007 00:40:12 GMT", &response_time); 784 base::Time::FromString("Wed, 28 Nov 2007 00:40:09 GMT", &request_time));
785 base::Time::FromString("Wed, 28 Nov 2007 00:45:20 GMT", &current_time); 785 ASSERT_TRUE(
786 base::Time::FromString("Wed, 28 Nov 2007 00:40:12 GMT", &response_time));
787 ASSERT_TRUE(
788 base::Time::FromString("Wed, 28 Nov 2007 00:45:20 GMT", &current_time));
786 789
787 std::string headers(test.headers); 790 std::string headers(test.headers);
788 HeadersToRaw(&headers); 791 HeadersToRaw(&headers);
789 scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers)); 792 scoped_refptr<HttpResponseHeaders> parsed(new HttpResponseHeaders(headers));
790 793
791 ValidationType validation_type = 794 ValidationType validation_type =
792 parsed->RequiresValidation(request_time, response_time, current_time); 795 parsed->RequiresValidation(request_time, response_time, current_time);
793 EXPECT_EQ(test.validation_type, validation_type); 796 EXPECT_EQ(test.validation_type, validation_type);
794 } 797 }
795 798
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 TEST_F(HttpResponseHeadersCacheControlTest, 2134 TEST_F(HttpResponseHeadersCacheControlTest,
2132 FirstStaleWhileRevalidateValueUsed) { 2135 FirstStaleWhileRevalidateValueUsed) {
2133 InitializeHeadersWithCacheControl( 2136 InitializeHeadersWithCacheControl(
2134 "stale-while-revalidate=1,stale-while-revalidate=7200"); 2137 "stale-while-revalidate=1,stale-while-revalidate=7200");
2135 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue()); 2138 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue());
2136 } 2139 }
2137 2140
2138 } // namespace 2141 } // namespace
2139 2142
2140 } // namespace net 2143 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698