Commit Graph

119 Commits

Author SHA1 Message Date
David Wendt 1e0d259075 avm2: Allow nulling `Bitmap.bitmapData`.
One of the two tests in this PR relies upon the backend storing bitmap data, but the test rendering backend does not yet do this.
2021-09-11 12:11:35 -07:00
David Wendt 7c5dc568f1 avm2: Impl `BitmapData.getPixel`.
This also changes the `bitmapdata_constr` test slightly to use a different starting value. Our premultiplied alpha calculations generate slightly different values from Flash Player which trips the test.
2021-09-11 12:11:35 -07:00
David Wendt 723b8b6756 tests: Add tests for `BitmapData`'s constructor, in both fresh and embedded bitmap contexts. 2021-09-11 12:11:35 -07:00
David Wendt fbccd75e23 tests: Add bitmap timeline test 2021-09-11 12:11:35 -07:00
Chris Midgley bd26790f5b
avm1: Fix `this` inside watchers (#5276)
* fix: fix 'this' inside watchers

* tests: test value of 'this' in watcher

* lint: cargo fmt
2021-09-11 15:15:16 +03:00
Tal Hayon 7d6eaf127d core: Fix EditText width and height scaling (close #3001) 2021-09-08 02:39:01 -07:00
Chris Midgley 868706d775
avm1: call watcher, if defined, from virtual properties on prototype (#4827)
* avm1: extract get_watcher

* tests: add tests for TextField text watch

* avm1: call the watcher, if defined, from call_setter

* dev: shadow variable to avoid unused mut warning

* dev: remove value mutability

* chore: cargo fmt

* dev: unify virtual and stored property watcher cases

* tests: add test for watching prototyped property

* feat: when getting old values, ascend the proto chain ignoring virtual properties

* chore: lint

* dev: share complicated code

* chore: Small cleanups

Co-authored-by: relrelb <relrelbachar@gmail.com>
2021-09-08 03:41:18 +03:00
David Wendt 34fe35a998 avm2: Impl `SoundMixer.bufferTime` 2021-09-03 16:47:02 -06:00
David Wendt 364ee62c92 avm2: Impl `SoundChannel`'s `soundComplete` event.
This includes a test that is currently ignored because `NullAudioBackend` can't fire complete events.
2021-09-03 16:47:02 -06:00
David Wendt efcab92d97 avm2: Impl `SoundMixer.stopAll` 2021-09-03 16:47:02 -06:00
David Wendt d73ba586d0 avm2: Impl `SoundChannel.stop()` 2021-09-03 16:47:02 -06:00
David Wendt 39305f6a38 avm2: Implement `SoundChannel.soundTransform` 2021-09-03 16:47:02 -06:00
David Wendt 6b7609ff4e avm2: Stub `SoundChannel.position`.
This also comes with an ignored test for `position`, because I originally believed this to be implementable.
2021-09-03 16:47:02 -06:00
David Wendt 116fb1f323 avm2: Impl `Sound.play`
This does not (yet) implement the third `SoundTransform` parameter on `play`.
2021-09-03 16:47:02 -06:00
David Wendt 3c3228f3c9 tests: Add tests for `SimpleButton.soundTransform` and `SoundMixer.soundTransform` 2021-09-03 16:47:02 -06:00
David Wendt 2f6e695483 avm2: Impl `Sprite.soundTransform` 2021-09-03 16:47:02 -06:00
David Wendt 66117450f5 tests: Add more coverage of `rightToLeft` as it disables `pan` 2021-09-03 16:47:02 -06:00
David Wendt 9926237074 tests: Add a test for AS3 `SoundTransform` properties 2021-09-03 16:47:02 -06:00
David Wendt b184273352 tests: Add some basic tests for the `Sound` class 2021-09-03 16:47:02 -06:00
David Wendt bf4492c454 avm2: Add the legacy Vector types that old movies can use.
This one was rather tough to test, as I actually can't generate ABCs in Animate CC that reference these classes. I instead had to modify a compiled SWF to open the package-internal namespace that these pre-specialized classes exist in.
2021-09-02 17:57:58 -06:00
David Wendt b452b653bf tests: Add a test for `Vector`'s instance initializer. 2021-09-02 17:57:58 -06:00
David Wendt aaddcc598f avm2: Impl `Vector.toLocaleString` and test `toString` 2021-09-02 17:57:58 -06:00
David Wendt dbc6f38c34 avm2: Impl `Vector.splice` 2021-09-02 17:57:58 -06:00
David Wendt 81d0775776 avm2: Impl `Vector.sort` 2021-09-02 17:57:58 -06:00
David Wendt 44a9f13047 avm2: Impl `Vector.slice` 2021-09-02 17:57:58 -06:00
David Wendt 077fd87842 avm2: Impl `Vector.reverse` 2021-09-02 17:57:58 -06:00
David Wendt aa2d729a44 avm2: Impl `Vector.removeAt` 2021-09-02 17:57:58 -06:00
David Wendt cea580e7c0 tests: Ensure we're testing push/shift/etc with empty vectors 2021-09-02 17:57:58 -06:00
David Wendt a053015558 avm2: Impl `Vector.insertAt` 2021-09-02 17:57:58 -06:00
David Wendt e3ad30a0f7 tests: Consolidate all of the type variants of each test into one test per function. 2021-09-02 17:57:58 -06:00
David Wendt 1cfa9e0b28 avm2: Impl `Vector.push` and `.pop` 2021-09-02 17:57:58 -06:00
David Wendt 6350ce2dde avm2: Impl `Vector.map` 2021-09-02 17:57:58 -06:00
David Wendt 7628b2b49a avm2: Impl `Vector.lastIndexOf` (and the weird backward-index behavior of `indexOf`) 2021-09-02 17:57:58 -06:00
David Wendt 4624157ae0 avm2: Impl `Vector.indexOf` 2021-09-02 17:57:58 -06:00
David Wendt c06a3c10d8 avm2: Impl `Vector.filter` 2021-09-02 17:57:58 -06:00
David Wendt 97e6f55110 avm2: Impl `Vector.every` 2021-09-02 17:57:58 -06:00
David Wendt 01904acad3 tests: Add `Vector.<T>.join` tests 2021-09-02 17:57:58 -06:00
David Wendt f255c7d577 tests: Add tests for multi-dimensional vector coercion typechecks & concatenation 2021-09-02 17:57:58 -06:00
David Wendt ecf514969b tests: Add a test for concatenating to lists of ES4 interfaces. 2021-09-02 17:57:58 -06:00
David Wendt 8740098e5d tests: Recompile the `vector_es4class_concat` test 2021-09-02 17:57:58 -06:00
David Wendt 70b60d6bb4 tests: Recompile the concat test 2021-09-02 17:57:58 -06:00
David Wendt 9a1b864988 tests: Add tests for `Vector.concat` 2021-09-02 17:57:58 -06:00
David Wendt 176f05a16b tests: Recompile a handful of miscompiled tests 2021-09-02 17:57:58 -06:00
David Wendt 1711400f07 tests: Actually enable all the vector tests I've been running 2021-09-02 17:57:58 -06:00
David Wendt f6ea1b2bff tests: Add a test for the `delete` operator 2021-09-02 17:57:58 -06:00
David Wendt f3cf82ad5a tests: Add test for sticking ES3 classes in a `Vector.<Object>` 2021-09-02 17:57:58 -06:00
David Wendt e65958cc22 tests: Add another test for subclass and superclass storage 2021-09-02 17:57:58 -06:00
David Wendt 2af5192893 tests: Add tests for vector holes and set coercion 2021-09-02 17:57:58 -06:00
David Wendt 9a3c4e6adb tests: Here's a very basic test for int access 2021-09-02 17:57:58 -06:00
David Wendt 4cf407da7e tests: Add a test for symbol class association on buttons, both for timeline-constructed and AVM-constructed buttons. 2021-08-31 21:21:54 -06:00