mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Move UTF8 bytes handling into generic constructor.
Separate from Servo specific logic.
This commit is contained in:
parent
52b3226d54
commit
d3b8b6472b
2 changed files with 11 additions and 11 deletions
|
@ -150,19 +150,19 @@ 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 = "derp";
|
||||
let mock_preload_content = b"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_key() {
|
||||
let mock_preload_content = "{\"nothing\": \"to see here\"}";
|
||||
let mock_preload_content = b"{\"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 = "{\
|
||||
let mock_preload_content = b"{\
|
||||
\"entries\": [\
|
||||
{\"host\": \"mozilla.org\",\
|
||||
\"include_subdomains\": false}\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue