mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
delegate resource reading to embedder
This commit is contained in:
parent
21517504cb
commit
9fb5795f37
52 changed files with 472 additions and 396 deletions
|
@ -176,24 +176,24 @@ fn test_push_entry_to_hsts_list_should_add_an_entry() {
|
|||
|
||||
#[test]
|
||||
fn test_parse_hsts_preload_should_return_none_when_json_invalid() {
|
||||
let mock_preload_content = b"derp";
|
||||
let mock_preload_content = "derp";
|
||||
assert!(HstsList::from_preload(mock_preload_content).is_none(), "invalid preload list should not have parsed")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_hsts_preload_should_return_none_when_json_contains_no_entries_map_key() {
|
||||
let mock_preload_content = b"{\"nothing\": \"to see here\"}";
|
||||
let mock_preload_content = "{\"nothing\": \"to see here\"}";
|
||||
assert!(HstsList::from_preload(mock_preload_content).is_none(), "invalid preload list should not have parsed")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_hsts_preload_should_decode_host_and_includes_subdomains() {
|
||||
let mock_preload_content = b"{\
|
||||
\"entries\": [\
|
||||
{\"host\": \"mozilla.org\",\
|
||||
\"include_subdomains\": false}\
|
||||
]\
|
||||
}";
|
||||
let mock_preload_content = "{\
|
||||
\"entries\": [\
|
||||
{\"host\": \"mozilla.org\",\
|
||||
\"include_subdomains\": false}\
|
||||
]\
|
||||
}";
|
||||
let hsts_list = HstsList::from_preload(mock_preload_content);
|
||||
let entries_map = hsts_list.unwrap().entries_map;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue