OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "platform/loader/fetch/ResourceRequest.h" | 5 #include "platform/loader/fetch/ResourceRequest.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "platform/network/EncodedFormData.h" | 8 #include "platform/network/EncodedFormData.h" |
9 #include "platform/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
10 #include "platform/weborigin/Referrer.h" | 10 #include "platform/weborigin/Referrer.h" |
11 #include "platform/wtf/text/AtomicString.h" | 11 #include "platform/wtf/text/AtomicString.h" |
12 #include "public/platform/WebCachePolicy.h" | 12 #include "public/platform/WebCachePolicy.h" |
13 #include "public/platform/WebURLRequest.h" | 13 #include "public/platform/WebURLRequest.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 TEST(ResourceRequestTest, RequestorOriginNonNull) { | |
19 ResourceRequest req; | |
20 EXPECT_NE(nullptr, req.RequestorOrigin().Get()); | |
21 EXPECT_TRUE(req.RequestorOrigin()->IsUnique()); | |
22 } | |
23 | |
24 TEST(ResourceRequestTest, CrossThreadResourceRequestData) { | 18 TEST(ResourceRequestTest, CrossThreadResourceRequestData) { |
25 ResourceRequest original; | 19 ResourceRequest original; |
26 original.SetURL(KURL(kParsedURLString, "http://www.example.com/test.htm")); | 20 original.SetURL(KURL(kParsedURLString, "http://www.example.com/test.htm")); |
27 original.SetCachePolicy(WebCachePolicy::kUseProtocolCachePolicy); | 21 original.SetCachePolicy(WebCachePolicy::kUseProtocolCachePolicy); |
28 original.SetTimeoutInterval(10); | 22 original.SetTimeoutInterval(10); |
29 original.SetFirstPartyForCookies( | 23 original.SetFirstPartyForCookies( |
30 KURL(kParsedURLString, "http://www.example.com/first_party.htm")); | 24 KURL(kParsedURLString, "http://www.example.com/first_party.htm")); |
31 original.SetRequestorOrigin(SecurityOrigin::Create( | 25 original.SetRequestorOrigin(SecurityOrigin::Create( |
32 KURL(kParsedURLString, "http://www.example.com/first_party.htm"))); | 26 KURL(kParsedURLString, "http://www.example.com/first_party.htm"))); |
33 original.SetHTTPMethod(HTTPNames::GET); | 27 original.SetHTTPMethod(HTTPNames::GET); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 TEST(ResourceRequestTest, SetHasUserGesture) { | 138 TEST(ResourceRequestTest, SetHasUserGesture) { |
145 ResourceRequest original; | 139 ResourceRequest original; |
146 EXPECT_FALSE(original.HasUserGesture()); | 140 EXPECT_FALSE(original.HasUserGesture()); |
147 original.SetHasUserGesture(true); | 141 original.SetHasUserGesture(true); |
148 EXPECT_TRUE(original.HasUserGesture()); | 142 EXPECT_TRUE(original.HasUserGesture()); |
149 original.SetHasUserGesture(false); | 143 original.SetHasUserGesture(false); |
150 EXPECT_TRUE(original.HasUserGesture()); | 144 EXPECT_TRUE(original.HasUserGesture()); |
151 } | 145 } |
152 | 146 |
153 } // namespace blink | 147 } // namespace blink |
OLD | NEW |