Skip to content

Truly independent web browser

LibWebView: Rename the URL overload of load() to load_from_browser_ui()

Shannon Boothdc201963ebe4
diff --git a/Libraries/LibWebView/Application.cpp b/Libraries/LibWebView/Application.cpp
index dc069e2db02..d47ee451c0f 100644
--- a/Libraries/LibWebView/Application.cpp
+++ b/Libraries/LibWebView/Application.cpp
@@ -1123,7 +1123,7 @@ void Application::remove_content_blocker_list(Badge<SettingsUI>, StringView iden
void Application::open_url_in_new_tab(URL::URL const& url, Web::HTML::ActivateTab activate_tab, ViewImplementation const* source_view) const
{
if (auto view = open_blank_new_tab(activate_tab, source_view); view.has_value())
- view->load(url);
+ view->load_from_browser_ui(url);
}
void Application::read_clipboard_text(ClipboardType type, Function<void(Utf16String)> on_read) const
@@ -1139,7 +1139,7 @@ void Application::read_clipboard_item(Function<void(Web::Clipboard::SystemClipbo
void Application::activate_or_open_tab_with_url(URL::URL const& url) const
{
if (auto view = activate_tab_with_url(url, URL::ExcludeFragment::Yes); view.has_value())
- view->load(url);
+ view->load_from_browser_ui(url);
else
open_url_in_new_tab(url, Web::HTML::ActivateTab::Yes);
}
@@ -2503,7 +2503,7 @@ static NonnullRefPtr<Core::Timer> load_page_for_screenshot_and_exit(Core::EventL
});
});
- view.load(url);
+ view.load_from_browser_ui(url);
timer->start();
return timer;
@@ -2533,7 +2533,7 @@ static void load_page_for_info_and_exit(Core::EventLoop& event_loop, HeadlessWeb
event_loop.quit(1);
};
- view.load(url);
+ view.load_from_browser_ui(url);
}
static void load_page_and_exit_on_close(Core::EventLoop& event_loop, HeadlessWebView& view, URL::URL const& url)
@@ -2542,7 +2542,7 @@ static void load_page_and_exit_on_close(Core::EventLoop& event_loop, HeadlessWeb
event_loop.quit(0);
};
- view.load(url);
+ view.load_from_browser_ui(url);
}
ErrorOr<int> Application::execute()
@@ -3443,7 +3443,7 @@ void Application::navigate_tab(DevTools::TabDescription const& description, Stri
if (!parsed_url.has_value())
return;
- view->load(*parsed_url);
+ view->load_from_browser_ui(*parsed_url);
}
void Application::traverse_the_history_by_delta(DevTools::TabDescription const& description, int delta) const
diff --git a/Libraries/LibWebView/TerminalWebView.cpp b/Libraries/LibWebView/TerminalWebView.cpp
index 366c8615e20..63e8c5a0faf 100644
--- a/Libraries/LibWebView/TerminalWebView.cpp
+++ b/Libraries/LibWebView/TerminalWebView.cpp
@@ -652,7 +652,7 @@ void TerminalWebView::open_url(StringView text)
show_notice(ByteString::formatted("not a URL: {}", text));
return;
}
- load(*url);
+ load_from_browser_ui(*url);
}
void TerminalWebView::show_notice(ByteString notice)
diff --git a/Libraries/LibWebView/ViewImplementation.cpp b/Libraries/LibWebView/ViewImplementation.cpp
index e7f143d139c..e8d169b0f15 100644
--- a/Libraries/LibWebView/ViewImplementation.cpp
+++ b/Libraries/LibWebView/ViewImplementation.cpp
@@ -886,7 +886,7 @@ void ViewImplementation::set_has_system_focus(bool has_system_focus)
traversable().set_has_system_focus(has_system_focus, {});
}
-void ViewImplementation::load(URL::URL const& url, Web::Bindings::NavigationHistoryBehavior history_handling)
+void ViewImplementation::load_from_browser_ui(URL::URL const& url, Web::Bindings::NavigationHistoryBehavior history_handling)
{
load(traversable().prepare_navigation(url, {}, history_handling));
}
@@ -914,7 +914,7 @@ void ViewImplementation::load(Web::HTML::PreparedNavigationDescriptor navigation
void ViewImplementation::open_url_in_new_tab(URL::URL const& url, Web::HTML::ActivateTab activate_tab)
{
if (auto* view = create_view_for_new_tab_or_window(is_private())) {
- view->load(url);
+ view->load_from_browser_ui(url);
return;
}
@@ -954,7 +954,7 @@ void ViewImplementation::open_navigation_in_new_window(Web::HTML::PreparedNaviga
void ViewImplementation::open_url_in_new_window(URL::URL const& url, IsPrivate is_private)
{
if (auto* view = create_view_for_new_tab_or_window(is_private)) {
- view->load(url);
+ view->load_from_browser_ui(url);
return;
}
@@ -4884,7 +4884,7 @@ Optional<ViewImplementation::NavigationToRetry> ViewImplementation::navigation_t
void ViewImplementation::retry_navigation(NavigationToRetry retry, Web::Bindings::NavigationHistoryBehavior history_handling)
{
if (!retry.navigation.has_value()) {
- load(retry.url, history_handling);
+ load_from_browser_ui(retry.url, history_handling);
return;
}
auto navigation = retry.navigation.release_value();
diff --git a/Libraries/LibWebView/ViewImplementation.h b/Libraries/LibWebView/ViewImplementation.h
index 8f61f42cce7..7ee496a125e 100644
--- a/Libraries/LibWebView/ViewImplementation.h
+++ b/Libraries/LibWebView/ViewImplementation.h
@@ -275,7 +275,7 @@ public:
void synchronized_resize_committed(Badge<CompositorPresentationClient>, u64 token) { did_commit_synchronized_resize(token); }
void set_has_system_focus(bool);
- void load(URL::URL const&, Web::Bindings::NavigationHistoryBehavior = Web::Bindings::NavigationHistoryBehavior::Auto);
+ void load_from_browser_ui(URL::URL const&, Web::Bindings::NavigationHistoryBehavior = Web::Bindings::NavigationHistoryBehavior::Auto);
void open_url_in_new_tab(URL::URL const&, Web::HTML::ActivateTab);
void open_url_in_new_window(URL::URL const&, IsPrivate);
void load(Web::HTML::PreparedNavigationDescriptor);
diff --git a/Libraries/LibWebView/WebDriverBrowserConnection.cpp b/Libraries/LibWebView/WebDriverBrowserConnection.cpp
index 287693e2cb0..30067536f0e 100644
--- a/Libraries/LibWebView/WebDriverBrowserConnection.cpp
+++ b/Libraries/LibWebView/WebDriverBrowserConnection.cpp
@@ -165,7 +165,7 @@ void WebDriverBrowserConnection::load_url(u64 command_id, String window_handle,
// The wait is armed only as the load starts: The current document can finish loading before then, and its
// completion would end a wait that was armed for the load.
view->did_start_webdriver_navigation();
- view->load(url);
+ view->load_from_browser_ui(url);
strong_this->async_command_complete(command_id, JsonValue {});
});
}
diff --git a/Services/Hub/ConnectionFromUI.cpp b/Services/Hub/ConnectionFromUI.cpp
index 65df9bb4d78..d2594b40bcd 100644
--- a/Services/Hub/ConnectionFromUI.cpp
+++ b/Services/Hub/ConnectionFromUI.cpp
@@ -932,7 +932,7 @@ View* ConnectionFromUI::find_view(u64 view_id)
void ConnectionFromUI::view_load(u64 view_id, URL::URL url, Web::Bindings::NavigationHistoryBehavior history_behavior)
{
if (auto* view = find_view(view_id)) {
- view->load(url, history_behavior);
+ view->load_from_browser_ui(url, history_behavior);
view->push_state_to_ui();
}
}
diff --git a/Tests/LibWeb/test-web/main.cpp b/Tests/LibWeb/test-web/main.cpp
index 8d0fa2cc285..5fba4980ccd 100644
--- a/Tests/LibWeb/test-web/main.cpp
+++ b/Tests/LibWeb/test-web/main.cpp
@@ -686,7 +686,7 @@ static void run_dump_test(TestWebView& view, TestRunContext& context, Test& test
};
}
- view.load(url);
+ view.load_from_browser_ui(url);
}
static ErrorOr<void> dump_screenshot_to_file(Gfx::Bitmap const& bitmap, StringView path)
@@ -818,7 +818,7 @@ static void run_ref_test(TestWebView& view, TestRunContext& context, Test& test,
test.expectation_screenshot.clear();
test.did_inject_js = false;
- view.load(test.ref_test_expectations[test.ref_test_expectation_index].url);
+ view.load_from_browser_ui(test.ref_test_expectations[test.ref_test_expectation_index].url);
});
} else {
// When the test initially finishes, we take a screenshot and request the reference test metadata.
@@ -886,10 +886,10 @@ static void run_ref_test(TestWebView& view, TestRunContext& context, Test& test,
// Clear flag so we can inject the JS into the reference page.
test.did_inject_js = false;
- view.load(test.ref_test_expectations[test.ref_test_expectation_index].url);
+ view.load_from_browser_ui(test.ref_test_expectations[test.ref_test_expectation_index].url);
};
- view.load(url);
+ view.load_from_browser_ui(url);
}
static void run_screenshot_test(TestWebView& view, TestRunContext& context, Test& test, URL::URL const& url)
@@ -1000,7 +1000,7 @@ static void run_screenshot_test(TestWebView& view, TestRunContext& context, Test
});
};
- view.load(url);
+ view.load_from_browser_ui(url);
}
static void run_test(TestWebView& view, TestRunContext& context, size_t test_index, Application& app, TestRunCapture& test_run_capture)
@@ -1093,7 +1093,7 @@ static void run_test(TestWebView& view, TestRunContext& context, size_t test_ind
});
});
- view.load(URL::about_blank());
+ view.load_from_browser_ui(URL::about_blank());
}
static void set_ui_callbacks_for_tests(TestWebView& view, TestRunContext& context, TestRunCapture& test_run_capture)
diff --git a/Tests/LibWebView/TestBeforeUnload.cpp b/Tests/LibWebView/TestBeforeUnload.cpp
index 47e24924489..89bd4ce22a1 100644
--- a/Tests/LibWebView/TestBeforeUnload.cpp
+++ b/Tests/LibWebView/TestBeforeUnload.cpp
@@ -61,7 +61,7 @@ TEST_CASE(before_unload)
auto view_is_at = [&](URL::URL const& url) { return view->url().serialize() == url.serialize(); };
auto load_and_wait = [&](URL::URL const& url) {
auto expected_loads_finished = loads_finished + 1;
- view->load(url);
+ view->load_from_browser_ui(url);
Core::EventLoop::current().spin_until([&] { return loads_finished >= expected_loads_finished && view_is_at(url); });
};
auto activate_page = [&] {
@@ -102,7 +102,7 @@ TEST_CASE(before_unload)
load_and_wait(source_url);
activate_page();
auto loads_finished_before_cancellation = loads_finished;
- view->load(destination_url);
+ view->load_from_browser_ui(destination_url);
Core::EventLoop::current().spin_until([&] { return loads_finished > loads_finished_before_cancellation; });
VERIFY(prompt_count == 1);
VERIFY(prompt_source == "data://"sv);
@@ -139,7 +139,7 @@ TEST_CASE(before_unload)
adopt_navigation_prompt_for_close = true;
accept_prompt = false;
auto prompt_count_before_adoption = prompt_count;
- view->load(destination_url);
+ view->load_from_browser_ui(destination_url);
Core::EventLoop::current().spin_until([&] { return adopted_close_preflight_result.has_value(); });
VERIFY(!*adopted_close_preflight_result);
VERIFY(view_is_at(source_url));
@@ -148,7 +148,7 @@ TEST_CASE(before_unload)
adopted_close_preflight_result.clear();
accept_prompt = true;
prompt_count_before_adoption = prompt_count;
- view->load(destination_url);
+ view->load_from_browser_ui(destination_url);
Core::EventLoop::current().spin_until([&] { return adopted_close_preflight_result.has_value(); });
VERIFY(*adopted_close_preflight_result);
VERIFY(view_is_at(source_url));
diff --git a/Tests/LibWebView/TestBrowserHistoryTraversal.cpp b/Tests/LibWebView/TestBrowserHistoryTraversal.cpp
index d2d0a2827f5..445ddfff61d 100644
--- a/Tests/LibWebView/TestBrowserHistoryTraversal.cpp
+++ b/Tests/LibWebView/TestBrowserHistoryTraversal.cpp
@@ -136,7 +136,7 @@ TEST_CASE(browser_history_traversal)
size_t spare_view_loads_finished = 0;
spare_view->on_load_finish = [&](auto const&) { ++spare_view_loads_finished; };
auto spare_view_url = URL::Parser::basic_parse("data:text/html,spare-process-navigation"sv).release_value();
- spare_view->load(spare_view_url);
+ spare_view->load_from_browser_ui(spare_view_url);
Core::EventLoop::current().spin_until([&]() { return spare_view_loads_finished == 1; });
VERIFY(spare_view->url() == spare_view_url);
// The page a spare process was started with is one its client may act for, and a page ID the client
@@ -156,13 +156,13 @@ TEST_CASE(browser_history_traversal)
Core::EventLoop::current().spin_until([&]() { return loads_finished >= expected_loads && view_is_at(url); });
};
- view->load(url_a);
+ view->load_from_browser_ui(url_a);
wait_until_at(url_a);
- view->load(url_b);
+ view->load_from_browser_ui(url_b);
wait_until_at(url_b);
- view->load(url_c);
+ view->load_from_browser_ui(url_c);
wait_until_at(url_c);
- view->load(url_d);
+ view->load_from_browser_ui(url_d);
wait_until_at(url_d);
auto back_menu_items = view->session_history_traversal_items(-1);
@@ -228,7 +228,7 @@ TEST_CASE(browser_history_traversal)
auto javascript_url = URL::Parser::basic_parse("javascript:void(0)"sv).release_value();
auto loads_started_before_javascript_url = loads_started;
auto loads_finished_before_javascript_url = loads_finished;
- view->load(javascript_url);
+ view->load_from_browser_ui(javascript_url);
Core::EventLoop::current().spin_until([&] { return loads_finished > loads_finished_before_javascript_url; });
VERIFY(loads_started == loads_started_before_javascript_url + 1);
VERIFY(view_is_at(url_c));
@@ -377,7 +377,7 @@ TEST_CASE(browser_history_traversal)
++navigate_events;
reload_view->alert_closed();
};
- reload_view->load(reload_url);
+ reload_view->load_from_browser_ui(reload_url);
Core::EventLoop::current().spin_until([&] { return reload_url_loads_finished == 1; });
reload_view->reload();
Core::EventLoop::current().spin_until([&] { return reload_url_loads_finished == 2; });
@@ -404,16 +404,16 @@ TEST_CASE(browser_history_traversal)
auto newer_url = TRY_OR_FAIL(write_page("newer.html"sv, "newer"sv));
Vector<URL::URL> loads_finished;
view->on_load_finish = [&](URL::URL const& url) { loads_finished.append(url); };
- view->load(slow_unload_url);
+ view->load_from_browser_ui(slow_unload_url);
Core::EventLoop::current().spin_until([&] { return loads_finished.contains_slow(slow_unload_url); });
// The displayed document is still unloading, after its successor's history job was found ready.
- view->load(activated_url);
+ view->load_from_browser_ui(activated_url);
bool unloading = false;
auto timer = Core::Timer::create_single_shot(AK::Duration::from_milliseconds(300), [&] { unloading = true; });
timer->start();
Core::EventLoop::current().spin_until([&] { return unloading; });
- view->load(newer_url);
+ view->load_from_browser_ui(newer_url);
Core::EventLoop::current().spin_until([&] { return loads_finished.contains_slow(newer_url); });
VERIFY(view->url() == newer_url);
}
diff --git a/Tests/LibWebView/TestCompositorStartup.cpp b/Tests/LibWebView/TestCompositorStartup.cpp
index 6a051d8f2c7..f8a14cb6bb7 100644
--- a/Tests/LibWebView/TestCompositorStartup.cpp
+++ b/Tests/LibWebView/TestCompositorStartup.cpp
@@ -55,7 +55,7 @@ TEST_CASE(a_tab_opened_before_the_compositor_launches_paints_once_it_does)
bool painted = false;
view->on_ready_to_paint = [&] { painted = true; };
- view->load(URL::Parser::basic_parse("data:text/html,<p>painted"sv).release_value());
+ view->load_from_browser_ui(URL::Parser::basic_parse("data:text/html,<p>painted"sv).release_value());
Core::EventLoop::current().spin_until([&] { return painted; });
view->on_ready_to_paint = nullptr;
@@ -81,7 +81,7 @@ TEST_CASE(a_video_that_starts_before_the_compositor_launches_plays_once_it_does)
bool can_play = false;
view->on_title_change = [&](auto const& title) { can_play = title == "canplay"sv; };
- view->load(URL::create_with_file_scheme(page_path).release_value());
+ view->load_from_browser_ui(URL::create_with_file_scheme(page_path).release_value());
EXPECT(!app->has_compositor_process());
Core::EventLoop::current().spin_until([&] { return can_play; });
view->on_title_change = nullptr;
diff --git a/Tests/LibWebView/TestCrashOverlay.cpp b/Tests/LibWebView/TestCrashOverlay.cpp
index 7219df2d18e..5c68b80ddf1 100644
--- a/Tests/LibWebView/TestCrashOverlay.cpp
+++ b/Tests/LibWebView/TestCrashOverlay.cpp
@@ -68,9 +68,9 @@ static void test_crash_overlay(bool bidi_reload_only)
};
auto first_url = URL::Parser::basic_parse("data:text/html,<title>First</title>first-page"sv).release_value();
auto failed_url = URL::Parser::basic_parse("data:text/html,<title>Failed page</title>original-page-content"sv).release_value();
- view->load(first_url);
+ view->load_from_browser_ui(first_url);
Core::EventLoop::current().spin_until([&] { return loads_finished >= 2; });
- view->load(failed_url);
+ view->load_from_browser_ui(failed_url);
Core::EventLoop::current().spin_until([&] { return loads_finished >= 3; });
auto history_step = view->traversable().session_history().current_step();
@@ -142,18 +142,18 @@ static void test_crash_overlay(bool bidi_reload_only)
// A load from the browser's UI navigates the tab whose document was lost as it would the document: to its URL, it
// replaces its entry, to another it pushes one, and to a fragment of its URL it loads the URL again.
- crash_and_load([&] { view->load(failed_url); });
+ crash_and_load([&] { view->load_from_browser_ui(failed_url); });
VERIFY(session_history.current_step() == history_step);
VERIFY(session_history.used_step_count() == 2);
VERIFY(evaluate("document.body.textContent === 'original-page-content'"sv).as_bool());
- crash_and_load([&] { view->load(first_url); });
+ crash_and_load([&] { view->load_from_browser_ui(first_url); });
VERIFY(session_history.used_step_count() == 3);
VERIFY(evaluate("document.body.textContent === 'first-page'"sv).as_bool());
auto first_url_with_fragment = first_url;
first_url_with_fragment.set_fragment("fragment"sv);
- crash_and_load([&] { view->load(first_url_with_fragment); });
+ crash_and_load([&] { view->load_from_browser_ui(first_url_with_fragment); });
VERIFY(session_history.used_step_count() == 4);
VERIFY(view->url() == first_url_with_fragment);
VERIFY(evaluate("document.body.textContent === 'first-page'"sv).as_bool());
diff --git a/Tests/LibWebView/TestImageDecoderIsolation.cpp b/Tests/LibWebView/TestImageDecoderIsolation.cpp
index 849263fce3a..ac8cfe66db2 100644
--- a/Tests/LibWebView/TestImageDecoderIsolation.cpp
+++ b/Tests/LibWebView/TestImageDecoderIsolation.cpp
@@ -139,8 +139,8 @@ TEST_CASE(renderers_of_a_site_share_an_image_decoder)
second_view->on_load_finish = [&](auto const&) { ++second_view_loads; };
Core::EventLoop::current().spin_until([&] { return first_view_loads >= 1 && second_view_loads >= 1; });
- first_view->load(page_url);
- second_view->load(page_url);
+ first_view->load_from_browser_ui(page_url);
+ second_view->load_from_browser_ui(page_url);
Core::EventLoop::current().spin_until([&] { return first_view_loads >= 2 && second_view_loads >= 2; });
VERIFY(processes_of_type(WebView::ProcessType::WebContent).size() >= 2);
@@ -149,7 +149,7 @@ TEST_CASE(renderers_of_a_site_share_an_image_decoder)
// A renderer that comes to host a second site leaves the decoder, which stays with the renderer that has only the one.
first_view->page().client().did_host_document_of_site("https://other.example"_utf16);
- first_view->load(page_url);
+ first_view->load_from_browser_ui(page_url);
Core::EventLoop::current().spin_until([&] { return first_view_loads >= 3; });
auto decoders_after_second_site = processes_of_type(WebView::ProcessType::ImageDecoder);
@@ -201,11 +201,11 @@ TEST_CASE(pdf_viewer_does_not_make_a_renderer_leave_the_image_decoder_of_its_sit
second_view->on_title_change = [&](auto const& title) { second_view_decoded_image = title == "decoded"sv; };
Core::EventLoop::current().spin_until([&] { return first_view_loads >= 1 && second_view_loads >= 1; });
- first_view->load(image_page_url);
+ first_view->load_from_browser_ui(image_page_url);
Core::EventLoop::current().spin_until([&] { return first_view_loads >= 2; });
VERIFY(processes_of_type(WebView::ProcessType::ImageDecoder).size() == 1);
- second_view->load(pdf_page_url);
+ second_view->load_from_browser_ui(pdf_page_url);
Core::EventLoop::current().spin_until([&] { return second_view_decoded_image; });
VERIFY(processes_of_type(WebView::ProcessType::ImageDecoder).size() == 1);
diff --git a/Tests/LibWebView/TestNavigationDownloads.cpp b/Tests/LibWebView/TestNavigationDownloads.cpp
index 807d9942c88..475fe07e97e 100644
--- a/Tests/LibWebView/TestNavigationDownloads.cpp
+++ b/Tests/LibWebView/TestNavigationDownloads.cpp
@@ -195,7 +195,7 @@ void load_page(WebView::HeadlessWebView& view, URL::URL const& url)
{
IGNORE_USE_IN_ESCAPING_LAMBDA bool loaded = false;
view.on_load_finish = [&](URL::URL const&) { loaded = true; };
- view.load(url);
+ view.load_from_browser_ui(url);
auto deadline = Core::Timer::create_single_shot(AK::Duration::from_seconds(30), [] { });
deadline->start();
@@ -211,7 +211,7 @@ WebView::FileDownloader::Download download_navigation_response(WebView::Headless
{
FinishedDownloadRecorder recorder;
- view.load(url);
+ view.load_from_browser_ui(url);
// A download that never finishes fails here, after 30 seconds.
auto deadline = Core::Timer::create_single_shot(AK::Duration::from_seconds(30), [] { });
diff --git a/Tests/LibWebView/TestRendererResponseBodyClaims.cpp b/Tests/LibWebView/TestRendererResponseBodyClaims.cpp
index 8c415b17ceb..a40bea2ef95 100644
--- a/Tests/LibWebView/TestRendererResponseBodyClaims.cpp
+++ b/Tests/LibWebView/TestRendererResponseBodyClaims.cpp
@@ -234,7 +234,7 @@ void load_page(WebView::HeadlessWebView& view, URL::URL const& url)
{
IGNORE_USE_IN_ESCAPING_LAMBDA bool loaded = false;
view.on_load_finish = [&](URL::URL const&) { loaded = true; };
- view.load(url);
+ view.load_from_browser_ui(url);
Core::EventLoop::current().spin_until([&] { return loaded; });
view.on_load_finish = nullptr;
}
diff --git a/Tests/LibWebView/TestRendererViolationReports.cpp b/Tests/LibWebView/TestRendererViolationReports.cpp
index 27f0e2361f2..93577460854 100644
--- a/Tests/LibWebView/TestRendererViolationReports.cpp
+++ b/Tests/LibWebView/TestRendererViolationReports.cpp
@@ -280,7 +280,7 @@ TEST_CASE(renderer_violation_reports)
auto liar = WebView::HeadlessWebView::create(theme, { 800, 600 });
bool loaded = false;
liar->on_load_finish = [&](auto const&) { loaded = true; };
- liar->load(server.url("liar.test"sv, "/target"sv));
+ liar->load_from_browser_ui(server.url("liar.test"sv, "/target"sv));
expect(spin_until_or_timeout([&] { return loaded; }, 10'000), "a liar's page loads"sv);
liar->on_load_finish = {};
liars.append(move(liar));
@@ -297,7 +297,7 @@ TEST_CASE(renderer_violation_reports)
source_view->on_title_change = [&](auto const& title) { titles.append(title.to_utf8().to_byte_string()); };
auto saw_title = [&](StringView title) { return titles.contains_slow(title); };
- source_view->load(server.url("source.test"sv, "/source"sv));
+ source_view->load_from_browser_ui(server.url("source.test"sv, "/source"sv));
expect(spin_until_or_timeout([&] { return saw_title("loaded 1"sv); }, 10'000), "the source's frame loads"sv);
auto& target = *source_view->traversable().children().first();
@@ -372,7 +372,7 @@ TEST_CASE(renderer_violation_reports)
frames_view->on_title_change = [&](auto const& title) { frames_titles.append(title.to_utf8().to_byte_string()); };
auto frames_saw_title = [&](StringView title) { return frames_titles.contains_slow(title); };
- frames_view->load(server.url("source.test"sv, "/frames"sv));
+ frames_view->load_from_browser_ui(server.url("source.test"sv, "/frames"sv));
expect(spin_until_or_timeout([&] { return frames_saw_title("source loaded 1"sv) && frames_saw_title("sibling loaded 1"sv); }, 10'000), "the source and its sibling load"sv);
frames_view->run_javascript("sourceFrame.contentWindow.navigateSibling('blocked.test', '/blocked')"_string);
diff --git a/Tests/LibWebView/TestRequestServerClientSessions.cpp b/Tests/LibWebView/TestRequestServerClientSessions.cpp
index 3fab6ada865..e826d360a98 100644
--- a/Tests/LibWebView/TestRequestServerClientSessions.cpp
+++ b/Tests/LibWebView/TestRequestServerClientSessions.cpp
@@ -169,7 +169,7 @@ TEST_CASE(request_server_client_sessions)
// A worker uses the cookies of the browsing session of the process it runs in, also one that a page's worker
// starts after the page's private session was restarted, whether or not the next private session has begun.
auto worker_owner_view = WebView::HeadlessWebView::create(theme, { 800, 600 }, WebView::IsPrivate::Yes);
- worker_owner_view->load(URL::Parser::basic_parse("data:text/html,<title>workers</title>"sv).release_value());
+ worker_owner_view->load_from_browser_ui(URL::Parser::basic_parse("data:text/html,<title>workers</title>"sv).release_value());
Core::EventLoop::current().spin_until([&] { return worker_owner_view->title() == "workers"sv; });
auto& worker_owner_session = worker_owner_view->page().client().session();
worker_owner_view->run_javascript(R"js(
diff --git a/Tests/LibWebView/TestSharedWorkerHost.cpp b/Tests/LibWebView/TestSharedWorkerHost.cpp
index b73ccfbb5ee..5ea50a8d9d5 100644
--- a/Tests/LibWebView/TestSharedWorkerHost.cpp
+++ b/Tests/LibWebView/TestSharedWorkerHost.cpp
@@ -148,7 +148,7 @@ public:
Tab open(URL::URL const& url, WebView::IsPrivate is_private = WebView::IsPrivate::No)
{
auto tab = WebView::HeadlessWebView::create(m_theme, { 800, 600 }, is_private);
- tab->load(url);
+ tab->load_from_browser_ui(url);
(void)worker_status_of(*tab);
return tab;
}
@@ -283,7 +283,7 @@ static void owner_in_the_host_navigates_away(Browser& browser)
auto host_pid = host_tab->web_content_pid();
auto id = browser.worker_status_of(*other_tab).id;
- host_tab->load(browser.server().url("localhost"sv, "/page?name=navigation"sv));
+ host_tab->load_from_browser_ui(browser.server().url("localhost"sv, "/page?name=navigation"sv));
Core::EventLoop::current().spin_until([&] { return host_tab->web_content_pid() != host_pid; });
Core::EventLoop::current().spin_until([&] { return browser.worker_status_of(*host_tab).id != id; });
diff --git a/Tests/LibWebView/TestViewSource.cpp b/Tests/LibWebView/TestViewSource.cpp
index 7f109766cf7..8c36a758f31 100644
--- a/Tests/LibWebView/TestViewSource.cpp
+++ b/Tests/LibWebView/TestViewSource.cpp
@@ -112,7 +112,7 @@ TEST_CASE(view_source_of_source_page)
VERIFY(!app->active_web_view()->can_view_source());
auto loads_before_navigation = app->opened_tab_loads();
- source_tab.load(URL::Parser::basic_parse("data:text/html,<p>Another page</p>"sv).release_value());
+ source_tab.load_from_browser_ui(URL::Parser::basic_parse("data:text/html,<p>Another page</p>"sv).release_value());
Core::EventLoop::current().spin_until([&]() { return app->opened_tab_loads() > loads_before_navigation; });
VERIFY(source_tab.can_view_source());