Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / base / FuzzingFunctions.h
blob1028803e28699b0200281e771392848577d35631
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_FuzzingFunctions
8 #define mozilla_dom_FuzzingFunctions
10 #include "mozilla/EventForwards.h"
12 class nsIWidget;
14 namespace mozilla {
16 class ErrorResult;
17 class TextInputProcessor;
19 namespace dom {
21 class GlobalObject;
22 struct KeyboardEventInit;
24 class FuzzingFunctions final {
25 public:
26 static void GarbageCollect(const GlobalObject&);
28 static void GarbageCollectCompacting(const GlobalObject&);
30 static void Crash(const GlobalObject& aGlobalObject,
31 const nsAString& aKeyValue);
33 static void CycleCollect(const GlobalObject&);
35 static void MemoryPressure(const GlobalObject&);
37 static void SignalIPCReady(const GlobalObject&);
39 static void EnableAccessibility(const GlobalObject&, ErrorResult& aRv);
41 MOZ_CAN_RUN_SCRIPT_BOUNDARY static void SynthesizeKeyboardEvents(
42 const GlobalObject& aGlobalObject, const nsAString& aKeyValue,
43 const KeyboardEventInit& aKeyboardEvent, ErrorResult& aRv);
45 private:
46 /**
47 * ActivateModifiers() activates aModifiers in the TextInputProcessor.
49 * @param aTextInputProcessor The TIP whose modifier state you want to change.
50 * @param aModifiers Modifiers which you want to activate.
51 * @param aWidget The widget which should be set to
52 * WidgetKeyboardEvent.
53 * @param aRv Returns error if TextInputProcessor fails to
54 * dispatch a modifier key event.
55 * @return Modifiers which are activated by the call.
57 MOZ_CAN_RUN_SCRIPT static Modifiers ActivateModifiers(
58 TextInputProcessor* aTextInputProcessor, Modifiers aModifiers,
59 nsIWidget* aWidget, ErrorResult& aRv);
61 /**
62 * InactivateModifiers() inactivates aModifiers in the TextInputProcessor.
64 * @param aTextInputProcessor The TIP whose modifier state you want to change.
65 * @param aModifiers Modifiers which you want to inactivate.
66 * @param aWidget The widget which should be set to
67 * WidgetKeyboardEvent.
68 * @param aRv Returns error if TextInputProcessor fails to
69 * dispatch a modifier key event.
70 * @return Modifiers which are inactivated by the call.
72 MOZ_CAN_RUN_SCRIPT static Modifiers InactivateModifiers(
73 TextInputProcessor* aTextInputProcessor, Modifiers aModifiers,
74 nsIWidget* aWidget, ErrorResult& aRv);
77 } // namespace dom
78 } // namespace mozilla
80 #endif // mozilla_dom_FuzzingFunctions