mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
refactored performance timing to align with updated spec
refactoring with ResourceFetchMetadata implemented deprecated window.timing functionality created ResourceTimingListener trait fixed w3c links in navigation timing updated include.ini to run resource timing tests on ci
This commit is contained in:
parent
3fe83f1d06
commit
26007fddd3
103 changed files with 1881 additions and 322 deletions
|
@ -35,9 +35,9 @@ use net::hsts::HstsEntry;
|
|||
use net::test::HttpState;
|
||||
use net_traits::request::{Destination, Origin, RedirectMode, Referrer, Request, RequestMode};
|
||||
use net_traits::response::{CacheState, Response, ResponseBody, ResponseType};
|
||||
use net_traits::IncludeSubdomains;
|
||||
use net_traits::NetworkError;
|
||||
use net_traits::ReferrerPolicy;
|
||||
use net_traits::{
|
||||
IncludeSubdomains, NetworkError, ReferrerPolicy, ResourceFetchTiming, ResourceTimingType,
|
||||
};
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
@ -127,7 +127,7 @@ fn test_fetch_blob() {
|
|||
use ipc_channel::ipc;
|
||||
use net_traits::blob_url_store::BlobBuf;
|
||||
|
||||
let context = new_fetch_context(None, None);
|
||||
let mut context = new_fetch_context(None, None);
|
||||
|
||||
let bytes = b"content";
|
||||
let blob_buf = BlobBuf {
|
||||
|
@ -147,7 +147,7 @@ fn test_fetch_blob() {
|
|||
let url = ServoUrl::parse(&format!("blob:{}{}", origin.as_str(), id.to_simple())).unwrap();
|
||||
|
||||
let mut request = Request::new(url, Some(Origin::Origin(origin.origin())), None);
|
||||
let fetch_response = fetch_with_context(&mut request, &context);
|
||||
let fetch_response = fetch_with_context(&mut request, &mut context);
|
||||
|
||||
assert!(!fetch_response.is_network_error());
|
||||
|
||||
|
@ -649,12 +649,15 @@ fn test_fetch_with_hsts() {
|
|||
.unwrap();
|
||||
let ssl_client = create_ssl_connector_builder(&ca_content);
|
||||
|
||||
let context = FetchContext {
|
||||
let mut context = FetchContext {
|
||||
state: Arc::new(HttpState::new(ssl_client)),
|
||||
user_agent: DEFAULT_USER_AGENT.into(),
|
||||
devtools_chan: None,
|
||||
filemanager: FileManager::new(create_embedder_proxy()),
|
||||
cancellation_listener: Arc::new(Mutex::new(CancellationListener::new(None))),
|
||||
timing: Arc::new(Mutex::new(ResourceFetchTiming::new(
|
||||
ResourceTimingType::Navigation,
|
||||
))),
|
||||
};
|
||||
|
||||
{
|
||||
|
@ -668,7 +671,7 @@ fn test_fetch_with_hsts() {
|
|||
request.referrer = Referrer::NoReferrer;
|
||||
// Set the flag.
|
||||
request.local_urls_only = false;
|
||||
let response = fetch_with_context(&mut request, &context);
|
||||
let response = fetch_with_context(&mut request, &mut context);
|
||||
server.close();
|
||||
assert_eq!(
|
||||
response.internal_response.unwrap().url().unwrap().scheme(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue