Auto merge of #10971 - shssoichiro:remove-cacherequestdetails, r=KiChjang

Remove CacheRequestDetails

Fixes #10904

Note that the related web-platform-tests failed both before and after this commit

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10971)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-02 19:58:14 -07:00
commit 3128a71ac7
3 changed files with 30 additions and 56 deletions

View file

@ -13,7 +13,7 @@ use hyper::server::{Handler, Listening, Server};
use hyper::server::{Request as HyperRequest, Response as HyperResponse};
use hyper::status::StatusCode;
use hyper::uri::RequestUri;
use net::fetch::cors_cache::{CacheRequestDetails, CORSCache};
use net::fetch::cors_cache::CORSCache;
use net::fetch::methods::{fetch, fetch_async, fetch_with_cors_cache};
use net_traits::AsyncFetchListener;
use net_traits::request::{Origin, RedirectMode, Referer, Request, RequestMode};
@ -238,8 +238,8 @@ fn test_cors_preflight_cache_fetch() {
let wrapped_request0 = Rc::new(request.clone());
let wrapped_request1 = Rc::new(request);
let fetch_response0 = fetch_with_cors_cache(wrapped_request0, &mut cache);
let fetch_response1 = fetch_with_cors_cache(wrapped_request1, &mut cache);
let fetch_response0 = fetch_with_cors_cache(wrapped_request0.clone(), &mut cache);
let fetch_response1 = fetch_with_cors_cache(wrapped_request1.clone(), &mut cache);
let _ = server.close();
assert!(!fetch_response0.is_network_error() && !fetch_response1.is_network_error());
@ -248,11 +248,8 @@ fn test_cors_preflight_cache_fetch() {
assert_eq!(1, counter.load(Ordering::SeqCst));
// The entry exists in the CORS-preflight cache
assert_eq!(true, cache.match_method(CacheRequestDetails {
origin: origin,
destination: url,
credentials: false
}, Method::Get));
assert_eq!(true, cache.match_method(&*wrapped_request0, Method::Get));
assert_eq!(true, cache.match_method(&*wrapped_request1, Method::Get));
match *fetch_response0.body.lock().unwrap() {
ResponseBody::Done(ref body) => assert_eq!(&**body, ACK),