Commit Graph

75 Commits

Author SHA1 Message Date
Kamil Jarosz 1db34993a2 tests: Add AutomatedEvent::SetClipboardText
Currently in tests (input.json) it is possible to trigger Ctrl-V using:

    { "type": "TextControl", "code": "Paste" },

But there is no way of populating the clipboard.
This patch adds AutomatedEvent::SetClipboardText, so the clipboard
may be populated before pasting:

    { "type": "SetClipboardText", "text": "<value>" },
    { "type": "TextControl", "code": "Paste" },
2024-01-11 23:22:49 +01:00
Tom Schuster f47e15b68c tests: Add a device font test using Tinos 2024-01-08 23:00:18 +01:00
renovate[bot] a328deab11 fix(deps): update rust dependencies 2024-01-08 02:59:04 +01:00
TÖRÖK Attila 217585daa8 chore: Delegate `[lints]` in `Cargo.toml` of all packages to the workspace 2024-01-05 11:28:19 +01:00
renovate[bot] 91d0520a43 fix(deps): update rust dependencies 2024-01-01 02:03:54 +01:00
renovate[bot] 216a8f3b14 fix(deps): update rust dependencies 2023-12-25 10:09:07 +01:00
Tom Schuster e3d8a279ad core: load_device_font register function must be &mut 2023-12-22 13:47:48 +01:00
Aaron Hill 287ca8801a avm2: Implement AIR playerglobal versioning
This builds on our existing playerglobal versioning support
to add in AIR versioning. We closely follow the avmplus implementation:

* When an SWF is loaded, we chose either a FlashPlayer or AIR
APIVersion for its SWF version, based on our configured player runtime.
* When loading playerglobals, we look at the player runtime. In AIR
  mode, we map FlashPlayer-versioned definitions to the closest AIR
  version. This ensures that all runtime APIVersions are in the
  same series (either AIR or FlashPlayer). In FlashPlayer mode,
  all AIR-versioned definitions get mapped to VM_INTERNAL, hiding
  them from user code.

Part of our existing api versioning code was implemented incorrectly.
Within playerglobals, we need to treat all unmarked namespaces as
VM_INTERNAL - this allows things like playerglobal script
initializer "initproperty" opcodes to see any VM_INTERNAL AIR
definitions (when we run under FlashPlayer mode). Previously, we
were using AllVersions, which would result in those VM_INTERNAL
definitions being hidden from other playerglobal code, which is
not correct.

Using this support, I've added a stub for the AIR-only
'flash.net.DatagramSocket'. I've also extended the test framework
with a new 'player_options.runtime' config option, which can be
set to "AIR" or "FlashPlayer" to configure the test runtime mode.

I've also added two new tests:
* 'air_hidden_lookup' runs under the FlashPlayer runtime, and verifies
  that a list of classes (currently just "DatagramSocket" are
  inacessible).
* 'air_datagram_socket', which uses `player_options.runtime = "AIR"`
  to construct an instance of `flash.net.DatagramSocket`. We can
  extend this test once we implement more of `DatagramSocket`

With this commit, we have all of the needed infrastructure to start
implementing and testing AIR-only classes and methods.
2023-12-16 19:11:50 -05:00
renovate[bot] 6da223a875 fix(deps): update rust dependencies 2023-11-27 09:44:47 +01:00
MrCheeze 5920a6426e core: Allow Regular/Bold/Italic device fonts to be registered separately 2023-11-24 17:08:35 +01:00
renovate[bot] 7757d060ff fix(deps): update rust dependencies to v2 2023-11-20 09:03:08 +01:00
Nathan Adams d6f16b0be5 tests: Make tests use a virtual filesystem, which currently maps to the regular physical FS rooted in a test directory 2023-11-13 22:28:10 +01:00
renovate[bot] 32c65e6460 fix(deps): update rust dependencies 2023-11-13 09:10:26 +01:00
Nathan Adams eb72cfb498 tests: Removed the need for test framework to depend on libtest_mimic 2023-11-10 22:02:18 +01:00
Nathan Adams 2b450af8d5 tests: Test framework doesn't need walkdir 2023-11-10 22:02:18 +01:00
Nathan Adams 7b7785e56d tests: Allow multiple renderers to handle a single test 2023-11-10 22:02:18 +01:00
Nathan Adams 8697a313ac tests: Move rendering interface into its own trait 2023-11-10 22:02:18 +01:00
Nathan Adams 86939e0e82 tests: Move TestUiBackend to backends/ui.rs 2023-11-10 22:02:18 +01:00
Nathan Adams bce0608e1f tests: Move all wgpu code out of test framework, make it abstract over any/no renderer, and make wgpu option if imgtests isn't enabled 2023-11-10 22:02:18 +01:00
Nathan Adams c36f4cfe95 tests: Move PrettyString out of lib 2023-11-10 22:02:18 +01:00
Nathan Adams 8a85a24213 tests: Move TestLogBackend to backends/log.rs 2023-11-10 22:02:18 +01:00
Nathan Adams 6a413e28f7 tests: Move TestAudioBackend to backends/audio.rs 2023-11-10 22:02:18 +01:00
Nathan Adams d1713010d2 tests: Move TestNavigatorBackend to backends/navigator.rs 2023-11-10 22:02:18 +01:00
Nathan Adams 2a2a717a06 tests: Appease clippy by implementing Default for some backends 2023-11-10 22:02:18 +01:00
Nathan Adams 673d52f013 tests: Move test framework into its own crate 2023-11-10 22:02:18 +01:00