mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibWeb: Rename internals.signalTextTestIsDone() to signalTestIsDone()
In upcoming change this function will be used for ref-tests as well.
This commit is contained in:
parent
101a8aef26
commit
394073f611
Notes:
github-actions[bot]
2025-03-18 19:11:00 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/394073f6116 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3989 Reviewed-by: https://github.com/gmta ✅
20 changed files with 30 additions and 30 deletions
|
@ -48,9 +48,9 @@ Page& Internals::internals_page() const
|
|||
return internals_window().page();
|
||||
}
|
||||
|
||||
void Internals::signal_text_test_is_done(String const& text)
|
||||
void Internals::signal_test_is_done(String const& text)
|
||||
{
|
||||
internals_page().client().page_did_finish_text_test(text);
|
||||
internals_page().client().page_did_finish_test(text);
|
||||
}
|
||||
|
||||
void Internals::set_test_timeout(double milliseconds)
|
||||
|
|
|
@ -20,7 +20,7 @@ class Internals final : public Bindings::PlatformObject {
|
|||
public:
|
||||
virtual ~Internals() override;
|
||||
|
||||
void signal_text_test_is_done(String const& text);
|
||||
void signal_test_is_done(String const& text);
|
||||
void set_test_timeout(double milliseconds);
|
||||
|
||||
void gc();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
[Exposed=Nobody]
|
||||
interface Internals {
|
||||
|
||||
undefined signalTextTestIsDone(DOMString text);
|
||||
undefined signalTestIsDone(DOMString text);
|
||||
undefined setTestTimeout(double milliseconds);
|
||||
|
||||
undefined gc();
|
||||
|
|
|
@ -385,7 +385,7 @@ public:
|
|||
virtual void page_did_request_file_picker([[maybe_unused]] HTML::FileFilter const& accepted_file_types, Web::HTML::AllowMultipleFiles) { }
|
||||
virtual void page_did_request_select_dropdown([[maybe_unused]] Web::CSSPixelPoint content_position, [[maybe_unused]] Web::CSSPixels minimum_width, [[maybe_unused]] Vector<Web::HTML::SelectItem> items) { }
|
||||
|
||||
virtual void page_did_finish_text_test([[maybe_unused]] String const& text) { }
|
||||
virtual void page_did_finish_test([[maybe_unused]] String const& text) { }
|
||||
virtual void page_did_set_test_timeout([[maybe_unused]] double milliseconds) { }
|
||||
|
||||
virtual void page_did_set_browser_zoom([[maybe_unused]] double factor) { }
|
||||
|
|
|
@ -235,7 +235,7 @@ public:
|
|||
Function<void(Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> items)> on_request_select_dropdown;
|
||||
Function<void(Web::KeyEvent const&)> on_finish_handling_key_event;
|
||||
Function<void(Web::DragEvent const&)> on_finish_handling_drag_event;
|
||||
Function<void(String const&)> on_text_test_finish;
|
||||
Function<void(String const&)> on_test_finish;
|
||||
Function<void(double milliseconds)> on_set_test_timeout;
|
||||
Function<void(double factor)> on_set_browser_zoom;
|
||||
Function<void(size_t current_match_index, Optional<size_t> const& total_match_count)> on_find_in_page;
|
||||
|
|
|
@ -103,11 +103,11 @@ void WebContentClient::did_finish_loading(u64 page_id, URL::URL url)
|
|||
}
|
||||
}
|
||||
|
||||
void WebContentClient::did_finish_text_test(u64 page_id, String text)
|
||||
void WebContentClient::did_finish_test(u64 page_id, String text)
|
||||
{
|
||||
if (auto view = view_for_page_id(page_id); view.has_value()) {
|
||||
if (view->on_text_test_finish)
|
||||
view->on_text_test_finish(text);
|
||||
if (view->on_test_finish)
|
||||
view->on_test_finish(text);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ private:
|
|||
virtual void did_request_file_picker(u64 page_id, Web::HTML::FileFilter accepted_file_types, Web::HTML::AllowMultipleFiles) override;
|
||||
virtual void did_request_select_dropdown(u64 page_id, Gfx::IntPoint content_position, i32 minimum_width, Vector<Web::HTML::SelectItem> items) override;
|
||||
virtual void did_finish_handling_input_event(u64 page_id, Web::EventResult event_result) override;
|
||||
virtual void did_finish_text_test(u64 page_id, String text) override;
|
||||
virtual void did_finish_test(u64 page_id, String text) override;
|
||||
virtual void did_set_test_timeout(u64 page_id, double milliseconds) override;
|
||||
virtual void did_set_browser_zoom(u64 page_id, double factor) override;
|
||||
virtual void did_find_in_page(u64 page_id, size_t current_match_index, Optional<size_t> total_match_count) override;
|
||||
|
|
|
@ -386,9 +386,9 @@ void PageClient::page_did_finish_loading(URL::URL const& url)
|
|||
client().async_did_finish_loading(m_id, url);
|
||||
}
|
||||
|
||||
void PageClient::page_did_finish_text_test(String const& text)
|
||||
void PageClient::page_did_finish_test(String const& text)
|
||||
{
|
||||
client().async_did_finish_text_test(m_id, text);
|
||||
client().async_did_finish_test(m_id, text);
|
||||
}
|
||||
|
||||
void PageClient::page_did_set_test_timeout(double milliseconds)
|
||||
|
|
|
@ -165,7 +165,7 @@ private:
|
|||
virtual void page_did_request_color_picker(Color current_color) override;
|
||||
virtual void page_did_request_file_picker(Web::HTML::FileFilter const& accepted_file_types, Web::HTML::AllowMultipleFiles) override;
|
||||
virtual void page_did_request_select_dropdown(Web::CSSPixelPoint content_position, Web::CSSPixels minimum_width, Vector<Web::HTML::SelectItem> items) override;
|
||||
virtual void page_did_finish_text_test(String const& text) override;
|
||||
virtual void page_did_finish_test(String const& text) override;
|
||||
virtual void page_did_set_test_timeout(double milliseconds) override;
|
||||
virtual void page_did_set_browser_zoom(double factor) override;
|
||||
virtual void page_did_change_theme_color(Gfx::Color color) override;
|
||||
|
|
|
@ -100,7 +100,7 @@ endpoint WebContentClient
|
|||
did_get_styled_js_console_messages(u64 page_id, i32 start_index, Vector<String> message_types, Vector<String> messages) =|
|
||||
did_get_unstyled_js_console_messages(u64 page_id, i32 start_index, Vector<WebView::ConsoleOutput> console_output) =|
|
||||
|
||||
did_finish_text_test(u64 page_id, String text) =|
|
||||
did_finish_test(u64 page_id, String text) =|
|
||||
did_set_test_timeout(u64 page_id, double milliseconds) =|
|
||||
|
||||
did_set_browser_zoom(u64 page_id, double factor) =|
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
<script>
|
||||
document.write("PASS");
|
||||
document.close();
|
||||
internals.signalTextTestIsDone(document.body.innerText);
|
||||
internals.signalTestIsDone(document.body.innerText);
|
||||
</script>
|
||||
|
|
|
@ -14,6 +14,6 @@ img {
|
|||
const inViewport = document.getElementById("inViewport");
|
||||
inViewport.addEventListener("load", function() {
|
||||
document.body.innerHTML = "PASS";
|
||||
internals.signalTextTestIsDone(document.body.innerText);
|
||||
internals.signalTestIsDone(document.body.innerText);
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// Note: This test _must_ be in a .svg file!
|
||||
internals.hitTest(400, 400);
|
||||
// Did not crash!
|
||||
internals.signalTextTestIsDone("");
|
||||
internals.signalTestIsDone("");
|
||||
});
|
||||
</script>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 666 B |
|
@ -10,7 +10,7 @@ function __preventMultipleTestFunctions() {
|
|||
|
||||
if (globalThis.internals === undefined) {
|
||||
internals = {
|
||||
signalTextTestIsDone: function () {},
|
||||
signalTestIsDone: function () {},
|
||||
spoofCurrentURL: function (url) {},
|
||||
};
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ function __finishTest() {
|
|||
if (__originalURL) {
|
||||
internals.spoofCurrentURL(__originalURL);
|
||||
}
|
||||
internals.signalTextTestIsDone(__outputElement.innerText);
|
||||
internals.signalTestIsDone(__outputElement.innerText);
|
||||
}
|
||||
|
||||
function spoofCurrentURL(url) {
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
__outputElement.setAttribute("id", "out");
|
||||
__outputElement.appendChild(document.createTextNode("passed\n"))
|
||||
document.body.appendChild(__outputElement);
|
||||
internals.signalTextTestIsDone(document.body.innerText);
|
||||
internals.signalTestIsDone(document.body.innerText);
|
||||
</script>
|
||||
</head>
|
||||
|
|
|
@ -10,5 +10,5 @@
|
|||
<p>PASS if this tests does not crash</p>
|
||||
<script>
|
||||
if (window.internals)
|
||||
window.internals.signalTextTestIsDone("PASS");
|
||||
window.internals.signalTestIsDone("PASS");
|
||||
</script>
|
||||
|
|
|
@ -12,6 +12,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
b.offsetTop;
|
||||
b.setAttributeNS("h", "class", "")
|
||||
if (window.internals)
|
||||
window.internals.signalTextTestIsDone("PASS");
|
||||
window.internals.signalTestIsDone("PASS");
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -15,5 +15,5 @@
|
|||
parentelement.innerText = 'hello world';
|
||||
|
||||
if (window.internals)
|
||||
internals.signalTextTestIsDone("PASS");
|
||||
internals.signalTestIsDone("PASS");
|
||||
</script>
|
||||
|
|
|
@ -53,7 +53,7 @@ add_completion_callback(function(tests, harness_status) {
|
|||
for (const test of tests) {
|
||||
outputLines.push(`${test.format_status()}\t${test.name}`);
|
||||
}
|
||||
window.internals.signalTextTestIsDone(outputLines.join('\n'));
|
||||
window.internals.signalTestIsDone(outputLines.join('\n'));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ static ErrorOr<void> collect_crash_tests(Application const& app, Vector<Test>& t
|
|||
static void clear_test_callbacks(HeadlessWebView& view)
|
||||
{
|
||||
view.on_load_finish = {};
|
||||
view.on_text_test_finish = {};
|
||||
view.on_test_finish = {};
|
||||
view.on_web_content_crashed = {};
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ void run_dump_test(HeadlessWebView& view, Test& test, URL::URL const& url, int t
|
|||
{
|
||||
auto timer = Core::Timer::create_single_shot(timeout_in_milliseconds, [&view, &test]() {
|
||||
view.on_load_finish = {};
|
||||
view.on_text_test_finish = {};
|
||||
view.on_test_finish = {};
|
||||
view.on_set_test_timeout = {};
|
||||
view.reset_zoom();
|
||||
|
||||
|
@ -255,7 +255,7 @@ void run_dump_test(HeadlessWebView& view, Test& test, URL::URL const& url, int t
|
|||
}
|
||||
};
|
||||
|
||||
view.on_text_test_finish = [&test, on_test_complete](auto const& text) {
|
||||
view.on_test_finish = [&test, on_test_complete](auto const& text) {
|
||||
test.text = text;
|
||||
test.did_finish_test = true;
|
||||
|
||||
|
@ -290,7 +290,7 @@ static void run_ref_test(HeadlessWebView& view, Test& test, URL::URL const& url,
|
|||
{
|
||||
auto timer = Core::Timer::create_single_shot(timeout_in_milliseconds, [&view, &test]() {
|
||||
view.on_load_finish = {};
|
||||
view.on_text_test_finish = {};
|
||||
view.on_test_finish = {};
|
||||
view.on_set_test_timeout = {};
|
||||
view.reset_zoom();
|
||||
|
||||
|
@ -364,7 +364,7 @@ static void run_ref_test(HeadlessWebView& view, Test& test, URL::URL const& url,
|
|||
}
|
||||
};
|
||||
|
||||
view.on_text_test_finish = [&](auto const&) {
|
||||
view.on_test_finish = [&](auto const&) {
|
||||
dbgln("Unexpected text test finished during ref test for {}", url);
|
||||
};
|
||||
|
||||
|
@ -398,7 +398,7 @@ static void run_test(HeadlessWebView& view, Test& test, Application& app)
|
|||
});
|
||||
};
|
||||
|
||||
view.on_text_test_finish = {};
|
||||
view.on_test_finish = {};
|
||||
|
||||
promise->when_resolved([&view, &test, &app](auto) {
|
||||
auto url = URL::create_with_file_scheme(MUST(FileSystem::real_path(test.input_path)));
|
||||
|
|
Loading…
Add table
Reference in a new issue