mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibURL+LibWeb: Port URL::complete_url to Optional
Removing one more source of the URL::is_valid API.
This commit is contained in:
parent
356728b1e0
commit
53826995f6
Notes:
github-actions[bot]
2025-02-15 17:07:12 +00:00
Author: https://github.com/shannonbooth
Commit: 53826995f6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3586
Reviewed-by: https://github.com/tcl3 ✅
14 changed files with 57 additions and 52 deletions
|
@ -102,12 +102,12 @@ TEST_CASE(data_url_base64_encoded_with_inline_whitespace)
|
|||
TEST_CASE(data_url_completed_with_fragment)
|
||||
{
|
||||
auto url = URL::URL("data:text/plain,test"sv).complete_url("#a"sv);
|
||||
EXPECT(url.is_valid());
|
||||
EXPECT_EQ(url.scheme(), "data");
|
||||
EXPECT_EQ(url.fragment(), "a");
|
||||
EXPECT(!url.host().has_value());
|
||||
EXPECT(url.has_value());
|
||||
EXPECT_EQ(url->scheme(), "data");
|
||||
EXPECT_EQ(url->fragment(), "a");
|
||||
EXPECT(!url->host().has_value());
|
||||
|
||||
auto data_url = TRY_OR_FAIL(Web::Fetch::Infrastructure::process_data_url(url));
|
||||
auto data_url = TRY_OR_FAIL(Web::Fetch::Infrastructure::process_data_url(*url));
|
||||
EXPECT_EQ(data_url.mime_type.serialized(), "text/plain");
|
||||
EXPECT_EQ(StringView(data_url.body.bytes()), "test"sv);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue