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

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

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/http/http_response_info.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/http/http_response_info.h"
6
7 #include "base/pickle.h"
8 #include "net/http/http_response_headers.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 class HttpResponseInfoTest : public testing::Test {
12 protected:
13 void SetUp() override {
14 response_info_.headers = new net::HttpResponseHeaders("");
15 }
16
17 void PickleAndRestore(const net::HttpResponseInfo& response_info,
18 net::HttpResponseInfo* restored_response_info) const {
19 Pickle pickle;
20 response_info.Persist(&pickle, false, false);
21 bool truncated = false;
22 restored_response_info->InitFromPickle(pickle, &truncated);
23 }
24
25 net::HttpResponseInfo response_info_;
26 };
27
28 TEST_F(HttpResponseInfoTest, UnusedSincePrefetchDefault) {
29 EXPECT_FALSE(response_info_.unused_since_prefetch);
30 }
31
32 TEST_F(HttpResponseInfoTest, UnusedSincePrefetchCopy) {
33 response_info_.unused_since_prefetch = true;
34 net::HttpResponseInfo response_info_clone(response_info_);
35 EXPECT_TRUE(response_info_clone.unused_since_prefetch);
36 }
37
38 TEST_F(HttpResponseInfoTest, UnusedSincePrefetchPersistFalse) {
39 net::HttpResponseInfo restored_response_info;
40 PickleAndRestore(response_info_, &restored_response_info);
41 EXPECT_FALSE(restored_response_info.unused_since_prefetch);
42 }
43
44 TEST_F(HttpResponseInfoTest, UnusedSincePrefetchPersistTrue) {
45 response_info_.unused_since_prefetch = true;
46 net::HttpResponseInfo restored_response_info;
47 PickleAndRestore(response_info_, &restored_response_info);
48 EXPECT_TRUE(restored_response_info.unused_since_prefetch);
49 }
OLDNEW
« no previous file with comments | « net/http/http_response_info.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698