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

Side by Side Diff: Source/platform/network/ResourceRequestTest.cpp

Issue 1311923004: Rename FormData/FormDataBuilder to EncodedFormData/FormDataEncoder respectively. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update comments Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/network/ResourceRequest.cpp ('k') | Source/web/WebHistoryItem.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "ResourceRequest.h" 6 #include "ResourceRequest.h"
7 7
8 #include "platform/network/FormData.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 "public/platform/WebURLRequest.h" 11 #include "public/platform/WebURLRequest.h"
12 #include "wtf/text/AtomicString.h" 12 #include "wtf/text/AtomicString.h"
13 #include <gtest/gtest.h> 13 #include <gtest/gtest.h>
14 14
15 namespace blink { 15 namespace blink {
16 16
17 TEST(ResourceRequestTest, RequestorOriginNonNull) 17 TEST(ResourceRequestTest, RequestorOriginNonNull)
18 { 18 {
19 ResourceRequest req; 19 ResourceRequest req;
20 EXPECT_NE(nullptr, req.requestorOrigin().get()); 20 EXPECT_NE(nullptr, req.requestorOrigin().get());
21 EXPECT_TRUE(req.requestorOrigin()->isUnique()); 21 EXPECT_TRUE(req.requestorOrigin()->isUnique());
22 } 22 }
23 23
24 TEST(ResourceRequestTest, CrossThreadResourceRequestData) 24 TEST(ResourceRequestTest, CrossThreadResourceRequestData)
25 { 25 {
26 ResourceRequest original; 26 ResourceRequest original;
27 original.setURL(KURL(ParsedURLString, "http://www.example.com/test.htm")); 27 original.setURL(KURL(ParsedURLString, "http://www.example.com/test.htm"));
28 original.setCachePolicy(UseProtocolCachePolicy); 28 original.setCachePolicy(UseProtocolCachePolicy);
29 original.setTimeoutInterval(10); 29 original.setTimeoutInterval(10);
30 original.setFirstPartyForCookies(KURL(ParsedURLString, "http://www.example.c om/first_party.htm")); 30 original.setFirstPartyForCookies(KURL(ParsedURLString, "http://www.example.c om/first_party.htm"));
31 original.setRequestorOrigin(SecurityOrigin::create(KURL(ParsedURLString, "ht tp://www.example.com/first_party.htm"))); 31 original.setRequestorOrigin(SecurityOrigin::create(KURL(ParsedURLString, "ht tp://www.example.com/first_party.htm")));
32 original.setHTTPMethod(AtomicString("GET", AtomicString::ConstructFromLitera l)); 32 original.setHTTPMethod(AtomicString("GET", AtomicString::ConstructFromLitera l));
33 original.setHTTPHeaderField(AtomicString("Foo"), AtomicString("Bar")); 33 original.setHTTPHeaderField(AtomicString("Foo"), AtomicString("Bar"));
34 original.setHTTPHeaderField(AtomicString("Piyo"), AtomicString("Fuga")); 34 original.setHTTPHeaderField(AtomicString("Piyo"), AtomicString("Fuga"));
35 original.setPriority(ResourceLoadPriorityLow, 20); 35 original.setPriority(ResourceLoadPriorityLow, 20);
36 36
37 RefPtr<FormData> originalBody(FormData::create("Test Body")); 37 RefPtr<EncodedFormData> originalBody(EncodedFormData::create("Test Body"));
38 original.setHTTPBody(originalBody); 38 original.setHTTPBody(originalBody);
39 original.setAllowStoredCredentials(false); 39 original.setAllowStoredCredentials(false);
40 original.setReportUploadProgress(false); 40 original.setReportUploadProgress(false);
41 original.setHasUserGesture(false); 41 original.setHasUserGesture(false);
42 original.setDownloadToFile(false); 42 original.setDownloadToFile(false);
43 original.setSkipServiceWorker(false); 43 original.setSkipServiceWorker(false);
44 original.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS); 44 original.setFetchRequestMode(WebURLRequest::FetchRequestModeCORS);
45 original.setFetchCredentialsMode(WebURLRequest::FetchCredentialsModeSameOrig in); 45 original.setFetchCredentialsMode(WebURLRequest::FetchCredentialsModeSameOrig in);
46 original.setRequestorID(30); 46 original.setRequestorID(30);
47 original.setRequestorProcessID(40); 47 original.setRequestorProcessID(40);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 { 125 {
126 ResourceRequest original; 126 ResourceRequest original;
127 EXPECT_FALSE(original.hasUserGesture()); 127 EXPECT_FALSE(original.hasUserGesture());
128 original.setHasUserGesture(true); 128 original.setHasUserGesture(true);
129 EXPECT_TRUE(original.hasUserGesture()); 129 EXPECT_TRUE(original.hasUserGesture());
130 original.setHasUserGesture(false); 130 original.setHasUserGesture(false);
131 EXPECT_TRUE(original.hasUserGesture()); 131 EXPECT_TRUE(original.hasUserGesture());
132 } 132 }
133 133
134 } // namespace blink 134 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/network/ResourceRequest.cpp ('k') | Source/web/WebHistoryItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698