mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 21:44:59 +00:00

We have a 5 second timeout between a user-activated event occurring and an activation-gated API being invoked in order for that API to succeed. This is quite fine in normal circumstances, but the machines used in CI often exceed that limit (we see upwards of 10 seconds passing between generating the user-activated event and the API call running). So instead of generating a user-activated event, add a hook to allow tests to bypass the very next activation check.
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Bindings/PlatformObject.h>
|
|
|
|
namespace Web::Internals {
|
|
|
|
class Internals final : public Bindings::PlatformObject {
|
|
WEB_PLATFORM_OBJECT(Internals, Bindings::PlatformObject);
|
|
JS_DECLARE_ALLOCATOR(Internals);
|
|
|
|
public:
|
|
virtual ~Internals() override;
|
|
|
|
void signal_text_test_is_done();
|
|
|
|
void gc();
|
|
JS::Object* hit_test(double x, double y);
|
|
|
|
void send_text(HTML::HTMLElement&, String const&);
|
|
void commit_text();
|
|
|
|
void click(double x, double y);
|
|
void wheel(double x, double y, double delta_x, double delta_y);
|
|
|
|
bool bypass_next_transient_activation_test() const { return m_bypass_next_transient_activation_test; }
|
|
void set_bypass_next_transient_activation_test(bool bypass_next_transient_activation_test) { m_bypass_next_transient_activation_test = bypass_next_transient_activation_test; }
|
|
|
|
private:
|
|
explicit Internals(JS::Realm&);
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
bool m_bypass_next_transient_activation_test { false };
|
|
};
|
|
|
|
}
|