Mike Welsh
06b6d14367
avm1: Fix removeMovieClip depth range
...
removeMovieClip should only function on objects within a certain
depth range, usually to prevent removing timeline clips. However,
this wasn't working properly in some cases because the depth was
being biased incorrectly (removeMovieClip never takes a depth
parameter, so we should not bias the depth).
2020-08-21 00:55:35 -07:00
Mike Welsh
528b52ac7c
tests: Activate unused remove_movie_clip test
2020-08-21 00:55:35 -07:00
Mike Welsh
bbc5e01009
tests: Add test for targetPath action
2020-08-20 18:14:01 -07:00
Mike Welsh
e9f9cda34d
tests: Rename target_path test to string_path
2020-08-20 18:14:01 -07:00
Mike Welsh
b8f5a405b9
tests: Add test for flash.geom.Transform
2020-08-20 17:29:04 -07:00
Mike Welsh
544c1becc2
tests: Add test for button children
2020-08-18 01:18:15 -07:00
Mike Welsh
b5c7e1dab0
tests: Add test for conflicting instance names
2020-08-18 01:18:15 -07:00
Floens
95acc14190
avm1: fix array unshift
...
update array_trivial test for it
2020-08-16 04:27:09 -07:00
Albert Safin
e03373bceb
avm1: parseInt
2020-08-13 00:40:20 -07:00
David Wendt
354b194b69
avm1: Add test for nested text fields in buttons.
2020-08-12 11:08:27 -07:00
David Wendt
6ec1d453b8
Add tests for `greaterequals`, `greaterthan`, `lessequals`, and `lessthan`.
2020-08-10 16:38:04 -07:00
David Wendt
f88f2e225a
Add tests for `>`, `<`, `<=`, and `>=`.
...
Note that this does NOT completely test the full range of if instructions for abstract relational comparison. Notably, the Adobe Animate CC compiler compiles each operator into it's negated equivalent, e.g. `<` becomes `ifnlt`.
I do not know how to get it to emit `ifge` or the like, which differ only by how they handle `NaN`s.
2020-08-10 16:38:04 -07:00
David Wendt
76ab8570e4
Implement and test `equals`.
...
The test is also far more in-depth than the `if_eq`/`if_ne` tests, which use the same set of vectors as the strict-equality tests from a while ago. Interestingly, this test passed on first run
2020-08-10 16:38:04 -07:00
David Wendt
5da4e2f118
Test for `iseq` and `isne`
2020-08-10 16:38:04 -07:00
David Wendt
86965eb674
Test for `coerce_s`.
...
I cannot yet figure out how to generate tests that use `convert_s`, so it's not covered.
2020-08-10 16:38:04 -07:00
David Wendt
35f939cb15
Add and test for `convert_u` using `ToUint32` from ECMA-262
2020-08-10 16:38:04 -07:00
David Wendt
6eb41035cf
Add & test ECMA-262 ToInt32 and `convert_i` opcode.
...
The ECMA-262 documentation is awfully overwrought for something that boils down to "chop off the non-whole part, wrap to 32 bits, then reinterpret as signed". Bitwise operations are *hell* to describe mathematically, and such descriptions are even harder to understand.
2020-08-10 16:38:04 -07:00
David Wendt
351fe026e9
Add a test for all the above numerical coercions.
2020-08-10 16:38:04 -07:00
David Wendt
60f9613365
Implement and test for `convert_b`.
2020-08-10 16:38:04 -07:00
David Wendt
6cf48eb543
Implement and test `not`.
2020-08-10 16:38:04 -07:00
David Wendt
b972c24f7e
Oh look, I figured out how to emit `istrue`, so that's tested, too.
2020-08-10 16:38:04 -07:00
David Wendt
850ebc88a2
Add test for truthiness.
...
As compiled by Adobe Animate CC 2020, this test appears to only use `iffalse`. However, both `op_is_false` and `op_is_true` coerce in the same manner, so I'm not entirely sure this is a problem for now.
2020-08-10 16:38:04 -07:00
unknown
47a8eb6f3e
avm1: Copy broadcast functions for MovieClipLoader
2020-08-04 07:02:14 -07:00
Nathan Adams
88a31cc5a9
avm1: Ensure we call movie constructors through Function::construct, not manually, to set __constructor__
2020-08-01 02:33:14 -07:00
unknown
a14f19e9e5
avm1: Call the respective listeners
2020-07-29 15:24:23 -07:00
unknown
795cd72dce
avm1: Broadcasting functions are now copied from AsBroadcaster
2020-07-29 15:24:23 -07:00
unknown
b72dbcae96
chore: Assert his inside of listeners
2020-07-29 15:24:23 -07:00
unknown
df50cbb27f
avm1: Fix the behavior of addListener and removeListener
2020-07-29 15:24:23 -07:00
unknown
20989ef03d
avm1: Initialize now copies the functions from AsBroadcaster
2020-07-29 15:24:23 -07:00
unknown
890dc0ea13
avm1: Implement AsBroadcaster
2020-07-29 15:24:23 -07:00
Nathan Adams
32be19da6d
avm1: Allow gotoAndStop/gotoAndPlay with frame numbers in paths - #915
2020-07-29 13:53:57 -07:00
Mike Welsh
5d08956152
tests: Add typeof and labels for Object() test
2020-07-29 13:52:51 -07:00
CUB3D
0fe3a23fd6
core: Correct handling of Object function without args
2020-07-29 13:52:51 -07:00
CUB3D
49bee3fe5c
core: Implement Object() function
2020-07-29 13:52:51 -07:00
CUB3D
c1771d7d4e
core: Split function and constructor, tests, fix bug with constructor
2020-07-27 12:50:31 -07:00
CUB3D
afb1d6b42f
core: Add global Array() function
2020-07-27 12:50:31 -07:00
CUB3D
22db5ab76a
core: Populate function when creating a constructor
2020-07-27 10:38:50 -07:00
Nathan Adams
cf61f8a4d3
avm1: Add failing test for registerClass in a loaded movie
2020-07-27 01:40:28 -07:00
David Wendt
f56d16a68d
Separate player creation from root movie setup, and allow users of Ruffle to load in movies synchronously or asynchronously.
...
During the small period of time when a player is created but has no root movie, a temporary empty movie is installed with an assumed stage size and framerate of 550x400@12fps. This is Flash default for new projects, so it seemed appropriate. User ActionScript cannot see these values, and I'm not even sure JavaScript can, either.
2020-07-23 23:02:51 -04:00
Mike Welsh
efa059ff8d
tests: Add test for LoadVars
2020-07-23 03:00:19 -07:00
Mike Welsh
74cb8609c1
avm1: Support loading into _level in GetURL2
...
Calling loadMovieNum with a variable parameter compiles into a
GetURL2 call with a `_level` window target parameter. Previously
this triggered Ruffle to try to navigate to the SWF. Now it
properly loads the SWF inside the current movie.
2020-07-23 02:08:48 -07:00
Nathan Adams
f0980301da
avm1: Implement arguments.callee
2020-07-22 15:57:45 -07:00
Nathan Adams
d5deeee1b7
avm1: Properly implement the arguments object, it's an array
2020-07-21 07:49:00 -07:00
Mike Welsh
1a5d7fe452
avm2: Initial AVM2 interpreter (merge #404 )
...
Initial work on the AVM2 interpreter.
2020-07-19 19:59:05 -07:00
Mike Welsh
8c1ec01d75
tests: Test clip events copying in duplicateMovieClip
...
duplicateMovieClip should also copy any clip events on the source
clip to the newly created movie clip.
2020-07-17 20:49:05 -07:00
Mike Welsh
f9b1c586d1
tests: Add test for paths in ActionCall
2020-07-14 23:34:21 -07:00
David Wendt
64e5b46259
Add tests for `instanceof` and `is` operators.
2020-07-13 17:45:10 -04:00
David Wendt
563a515189
Add a test for loading interfaces into the AVM2.
...
This test will fail if the AVM2 implementation does not support bodyless methods or bare classes properly.
2020-07-13 17:45:07 -04:00
David Wendt
6117288fe2
Add tests for `ifstricteq`, `ifstrictne`, and `strictequals`.
2020-07-13 17:44:59 -04:00
David Wendt
03a240ebcd
Add tests for `valueOf`.
2020-07-13 17:44:58 -04:00
David Wendt
3b52dfe2ba
Since we have an `es3_inheritance` test now, rename the existing inheritance test to `es4_inheritance`.
2020-07-13 17:44:57 -04:00
David Wendt
cf6714d33c
Implement and test `toLocaleString`.
...
This function has vague documentation about enabling locale-specific formatting in subclasses. As far as I can tell, none of the objects I implemented so far do anything different than `toString`, so I just have it use the same `TObject` property I set up for `toString`.
2020-07-13 17:44:57 -04:00
David Wendt
3558c3afa0
Add test of `Function.prototype.call`
2020-07-13 17:44:56 -04:00
David Wendt
16774aa055
Add a test for legacy / ES3 inheritance.
...
This was originally something *way* more evil: mixed inheritance between ES3 and ES4 classes. It didn't pan out due to fundamental limitations of the two object models. How the hell did Brendan Eich/Adobe/TC-39 expect ES4 classes to be adopted in already-existing codebases?!
2020-07-13 17:44:56 -04:00
David Wendt
37cdcb3bce
Add tests for `toString` on objects, functions, and classes.
2020-07-13 17:44:54 -04:00
David Wendt
ba2c1f5750
Add test for `setPropertyIsEnumerable`
2020-07-13 17:44:39 -04:00
David Wendt
dc0cb00a03
Add a test for `propertyIsEnumerable`.
2020-07-13 17:44:37 -04:00
David Wendt
42cb8f57c8
Add a test for `has_own_property` in various class instance scenarios.
2020-07-13 17:44:35 -04:00
David Wendt
8677804ea0
Actually enable the `isPrototypeOf` test.
2020-07-13 17:44:34 -04:00
David Wendt
0e89cb2175
Impl `Object.isPrototypeOf` w/ test
2020-07-13 17:44:33 -04:00
David Wendt
d29f3dc1d0
Add `as3_object_enumeration` and `as3_class_enumeration` tests.
...
The former tests iterating normal objects and the latter tests iterating objects with prototypes.
2020-07-13 17:44:33 -04:00
David Wendt
7253c091a2
Add tests for control flow instructions that use booleans or strict equality.
...
Other comparisons will have to wait until we have ECMA-compliant abstract comparison and coercion.
2020-07-13 17:44:30 -04:00
David Wendt
ddc9aa4cca
Add a test for ES4 method binding of `this`.
2020-07-13 17:44:29 -04:00
David Wendt
f042e453a3
Add a test for interactions between prototype and class-trait properties.
...
This is the test that broke the old object model's back, please see parent commit's description for more details.
2020-07-13 17:44:27 -04:00
David Wendt
6cc3f7ecc3
Add a test for stored properties as well.
...
This test passed with no errors.
2020-07-13 17:44:24 -04:00
David Wendt
5abc78d3bd
Add test of AVM2 virtual properties.
...
This tests:
* Getter invocation
* Setter invocation
* Properties with one or the other, but not both
* Inheritance
* Superproperty getters and setters
* Getters with inherited setter
* Setters with inherited getter
2020-07-13 17:44:24 -04:00
David Wendt
785832b7f3
Add `as3_inheritance` test, which is primarily designed to test method calls, constructor execution, and usage of `super`.
2020-07-13 17:44:22 -04:00
David Wendt
ab5a95c05b
Add a test for various types of class methods.
2020-07-13 17:44:19 -04:00
David Wendt
f3dee5c310
Add (currently failing) test for constructors.
2020-07-13 17:44:14 -04:00
David Wendt
bedf5cb459
Add a basic test for function calls.
2020-07-13 17:44:13 -04:00
David Wendt
a2dfffc56e
Add our first AVM2 regression test: hello world!
2020-07-13 17:44:09 -04:00
CUB3D
83cca044ad
core: Add tests for ContextMenu and ContextMenuItem
2020-07-12 15:25:58 -07:00
Mike Welsh
8715589f50
tests: Add setInterval test
2020-07-10 14:38:48 -07:00
Nathan Adams
8a0430d744
avm1: Implement Object.watch & Object.unwatch ( #268 )
2020-07-10 12:02:26 -07:00
Nathan Adams
ecbab536b5
avm1: Respect ScriptLimits for recursion depth, and use that in infinite_recursion_function
2020-07-08 14:47:38 -07:00
Nathan Adams
51ec5739c6
avm1: Throw errors when functions (user-called, or special) go too deep
2020-07-08 14:47:38 -07:00
Mike Welsh
2cbbe32412
tests: Add test for GetVariable/SetVariable on _x, etc.
2020-07-05 15:15:31 -07:00
Mike Welsh
804385347f
tests: Add test for virtual properties on prototype
2020-07-05 15:15:31 -07:00
Mike Welsh
fec8cf5e52
tests: Add tests for with from issue #792
2020-07-05 15:15:31 -07:00
CUB3D
ab58cff8b3
core: Add tests for ColorTransform and cleanup code
2020-07-05 13:49:59 -07:00
Mike Welsh
07814fdf53
tests: Add test for Error
2020-07-02 20:58:01 -07:00
Mike Welsh
3a4d432645
tests: Edit textfield_variable test for #777
2020-07-02 01:29:41 -07:00
Nathan Adams
d86761db5d
avm1: Implement try {..} catch {..} finally {..} - #731
2020-07-01 17:30:56 -07:00
Nathan Adams
7c0b0a7a57
avm1: Fix instanceof checks with primitives
2020-07-01 16:36:54 -07:00
Nathan Adams
d1732dd3d6
avm1: Returning from with{} should return from the parent activation
2020-07-01 16:21:43 -07:00
Mike Welsh
ef31a6bea4
text: Don't override TextField::set_matrix and other layout changes
...
Don't override set_matrix and set_x for TextFields, and leave the
bounds intact.
TODO: There are still some wrapping issues in the tests, but
this allows the simple case of single-line texts to render
correctly.
2020-06-28 18:36:10 -07:00
Mike Welsh
d97a515330
tests: Add text field variable test
2020-06-28 18:36:10 -07:00
Mike Welsh
8da0f43412
tests: Add test for DefineLocal and issue #760
2020-06-28 15:15:45 -07:00
Mike Welsh
0833c15e25
tests: Add test for enumerating array indices
2020-06-27 20:25:45 -07:00
Mike Welsh
478d88b22d
tests: Test hasOwnProperty for array indices in array_properties
2020-06-27 20:25:45 -07:00
Mike Welsh
8e3b96f1b1
tests: Add tests for non-string params in hasOwnProperty:
2020-06-27 20:25:45 -07:00
Mike Welsh
b37b74e0b6
tests: Add test for __constructor__ being DontEnum
2020-06-27 18:54:01 -07:00
Nathan Adams
463b79f063
avm1: Implement Action::Throw
2020-06-25 02:03:15 -07:00
Mike Welsh
81d75c6256
text: Text formatting for EditText fields (merge #615 )
...
First implementation of HTML parsing and formatting for text fields.
2020-06-24 23:06:11 -07:00
CUB3D
4e286b43ae
chore: Format
2020-06-24 01:46:06 +01:00
CUB3D
752ffc5cca
chore: Fix clippy lints and tests
2020-06-24 01:44:07 +01:00
David Wendt
c1ad37a0f6
Implement text span raising, sans list items.
...
During the raising process, we maintain a list of pointers to the lowest-most `textformat`, `p`, `font`, `a`, `b`, `i`, and `u` in the document that we are appending to. When we get a new one of any of those elements, we clear the rest off the stack. This forces us to add HTML in the same order Flash does.
LIs are not yet supported because they require us to process text line-by-line which doesn't mesh with this model.
There's also a test but the XML DOM generates HTML strings with the wrong attribute order, so the test fails spuriously.
2020-06-20 20:14:57 -04:00
David Wendt
e036d6594b
Add some entity support to HTML parsing.
2020-06-20 20:08:22 -04:00
David Wendt
88fcb98913
Allow disabling entity processing when parsing XML.
...
This necessitated a change to edittext_bullet, which turns out is accidentally an entity test, too. It now no longer uses entities so that it won't spuriously fail due to an entity related problem.
2020-06-20 20:06:21 -04:00
David Wendt
65f4d2cf1e
Add regression tests for `underline`.
...
We're within 4px in every case.
2020-06-20 19:56:01 -04:00
David Wendt
a2d69a69a3
Add a test for bullets.
...
As usual with most newline related things, we're 3px off no matter how many or how few lines we have.
2020-06-20 19:56:00 -04:00
David Wendt
8628261dc8
Add a bunch of necessary fixes to default text formatting and HTML format extraction.
...
This also replaces the `edittext_html_defaults` test with a more robust test that checks the default format and global format of SWF-based, text, and HTML test vectors.
2020-06-20 19:55:57 -04:00
David Wendt
9e56f10fd0
Approx the align and margins text by up to 3 pixels.
...
These tests currently have visual bugs in all cases, and measurement bugs in the justification case that require me to approx them.
2020-06-20 19:55:54 -04:00
David Wendt
3c9a43ea72
Add a regression test for newlines.
...
This test includes tests for HTML newlines, which causes the XML parser in Ruffle to throw errors. Hence why it's currently ignored.
2020-06-20 19:55:53 -04:00
David Wendt
6c44418b10
Add a test for tab_stops.
...
This test is currently inaccurate by up to 5 pixels, this is due to some behavior with really, really wide tabstops and word breaks that I don't entirely get yet.
2020-06-20 19:55:51 -04:00
David Wendt
0e45dc12e9
Recompile the letter spacing test 'cause I spotted an errant `s` in the FLA
2020-06-20 19:55:49 -04:00
David Wendt
3d094ed689
Add margins test.
...
This test is also approx'd to 1px due to the same issue where heights are off by one.
2020-06-20 19:55:48 -04:00
David Wendt
74d4c25133
Add a test for letter spacing.
...
This test is approximate because the 0.5px test is off by 1px in terms of height.
2020-06-20 19:55:47 -04:00
David Wendt
171954d5e4
Add `edittext_leading` test.
...
This test constructs a handful of text fields and measures them. Each field has 0, 5, or 15px of `leading` applied to it's text format.
2020-06-20 19:55:47 -04:00
David Wendt
bbc73f1477
The `edittext_align` test now passes perfectly.
2020-06-20 19:55:46 -04:00
David Wendt
c67bf0b6b7
Add approximate test of text field metrics during alignment.
...
This is an approximate text with a 1-pixel tolerance because our height is currently off by one and I cannot explain why. Previous attempts to fix the bug have resulted in cascading errors that resulted in off-by-one errors in the opposite direction. This is still better than nothing and I need to check other tests in.
2020-06-20 19:55:44 -04:00
David Wendt
a1e52ab556
Add a test for formatting defaults on HTML text.
2020-06-20 19:55:44 -04:00
David Wendt
06dc2f5fe0
Implement the `leading` attribute as defined by fonts.
...
`EditText` supports two different forms of leading:
1. Font-provided leading, specified relative to the EM square and scaled with font size
2. User-specificed leading, specified in pixels
Notably, the former appears to apply to the first line in the text and pushes it down. This showed up in the `edittext_font_size` test, and according to that test result the leading is rounded *up* to the nearest pixel, plus one.
That last bit seems possibly wrong and is subject to further change, but it matches the tests at multiple scales.
2020-06-20 19:55:29 -04:00
Nathan Adams
2e7ebbf258
avm1: Fatal errors will halt the AVM and prevent further execution
2020-06-20 15:02:00 -07:00
Nathan Adams
3695c3c9fa
tests: Add test for default names of display objects
2020-06-18 16:26:36 -07:00
Nathan Adams
25ad2a428d
tests: Improve attach_movie test to prove when the first frame is executed
2020-06-17 14:16:38 -07:00
Mike Welsh
568d0513ed
tests: register_and_init_order tests for constructor after goto
2020-06-16 14:53:44 -07:00
Mike Welsh
5da9863402
tests: Add test for #710
2020-06-13 02:48:38 -07:00
Mike Welsh
29dc88ec01
tests: Clip event test now tests for children unloading
...
The test now verifies that a child movie clip runs its `unload`
clip event if its parent is removed.
2020-06-11 23:39:16 -07:00
Mike Welsh
faa35a53e9
tests: Add test for getBounds with empty children
2020-06-10 17:17:08 -07:00
Mike Welsh
359df6860f
tests: Add String.charCodeAt tests
...
Tests the fix provided in #634 .
2020-06-04 16:02:55 -07:00
Nathan Adams
34cf21289b
avm1: Fixed some missing behaviours with flash.geom.Rectangle
2020-06-02 18:49:01 -07:00
Nathan Adams
f5765f2bac
avm1: Implement all of flash.geom.Rectangle + tests ( #305 )
2020-06-02 18:49:01 -07:00
Nathan Adams
2e25fec099
tests: Add test coverage for flash.geom.Point
2020-05-27 00:23:45 -07:00
Nathan Adams
4f69566f77
tests: Add test coverage for flash.geom.Matrix
2020-05-21 18:38:08 +02:00
Nathan Adams
51d9f3ef36
core: Change Player::new to take in a SwfMovie, not &[u8]
2020-05-04 16:07:38 -07:00
Nathan Adams
96d1f8fd30
tests: Add test for order of init_object vs constructor when attaching movies
2020-05-03 12:46:55 -07:00
Nathan Adams
0152f384ea
core: Run any on(construct) events at the appropriate time
2020-05-03 12:46:55 -07:00
Nathan Adams
2b9219e8f9
tests: Add test for undocumented on(construct) property (note: this swf is hand-crafted)
2020-05-03 12:46:55 -07:00
David Wendt
bb879870ec
Add test for the constructor property on v6 and v7 SWFs
2020-04-25 13:25:21 -04:00
Nathan Adams
b3322acc8c
tests: Copy as2_super_and_this test for manual prototype setting, used by mx (currently broken)
2020-04-25 13:25:20 -04:00
David Wendt
aaa6f481ac
Add a v6 version of the super-and-this test, which is exactly the same source compiled to SWF version 6.
2020-04-25 13:25:20 -04:00
David Wendt
869cbd17da
Extend `as2_super_and_this` to cover accessing object properties in super-methods, super-getters, and super-setters.
2020-04-25 13:25:18 -04:00
David Wendt
15a19f4cf8
Add test from @Dinnerbone that checks to make sure super-called functions can still initialize the object they are a part of.
2020-04-25 13:25:17 -04:00
Mike Welsh
bad34c4d8f
tests: Fix tests for regressions caused by #498
...
Changes to the action queue caused actions queued during other
actions to run too late. These regressions weren't caught by the
tests because many of the goto tests ran for more frames than was
necessary, allowing the late actions to still run.
2020-04-25 03:06:54 -07:00
Nathan Adams
a673e7108d
tests: Add test for movieclip.createEmptyMovieClip().attachMovie()`
2020-04-21 05:49:25 -07:00
Nathan Adams
6316d7e0b3
tests: Add (currently failing) test for init order when combined with register_class
2020-04-17 23:48:58 -07:00
Nathan Adams
d0fd26a89c
avm1: Fix panic with [].unshift(x)
2020-04-17 21:17:13 -07:00
Mike Welsh
47e936fcc2
tests: Add tests for Array.sort
2020-04-01 18:46:12 -07:00
Mike Welsh
2bdbac9247
tests: Test that Color has no effect when target is undefined
2020-03-30 01:09:05 -07:00
Mike Welsh
4ea609cca1
tests: Don't special case enumeration tests
2020-03-28 16:22:02 -07:00
Mike Welsh
81a0bb370b
tests: Add test for SWF<=6 case insensitivty
2020-03-28 16:22:02 -07:00
Mike Welsh
4df1128c19
core: Implement Object.registerClass (merge #344 )
...
Implement Object.registerClass
2020-03-25 18:55:49 -07:00
Nathan Adams
b4624fddce
avm1: GetVariable and SetVariable look through the scope chain. Fixes #414
...
GetVariable and SetVariable attempt to resolve paths on each scope
in the scope chain.
2020-03-19 19:58:16 -07:00
Nathan Adams
7bed4d4940
chore: Document each trace in attach_movie avm1 tests
2020-02-29 23:05:17 +01:00
Nathan Adams
041bb6b44c
avm1: Implement `Object.registerClass`
2020-02-29 23:05:17 +01:00
Mike Welsh
223edb9bc1
core: Matrix translation is in twips
2020-02-26 12:47:47 -08:00
Mike Welsh
a917fa4028
tests: Add temporary test for MovieClip.getRect
...
This is just testing that it exists and returns the same values as
getBounds for shapes without strokes.
TODO: When it is properly implemented for strokes, add stroked
shapes to testing.
2020-02-24 14:12:48 -08:00
Mike Welsh
73a9a0e771
tests: Add test for MovieClip.getBounds
2020-02-24 14:12:48 -08:00
David Wendt
9adf0f43d7
Allow levels to be read as scope variables, and add a test for this.
2020-02-22 00:02:50 -05:00
David Wendt
5a7e530c91
Add a test for cross-movie `_root`.
...
This test does not pass yet. Other layers need to resolve as target paths in order for this to happen.
2020-02-22 00:02:48 -05:00
David Wendt
aab339880d
Implement `XML.load()`, with tests.
...
Interestingly enough, very little actually has to be done inside the async process for XML. The async process basically just fetches data and fires an event handler when it's done. Everything else is handled via a system builtin, `XML.onData`.
2020-02-22 00:02:45 -05:00
David Wendt
538a5f05e5
Add tests for various forms of `loadVariables`.
...
Surprisingly enough these tests passed without any changes, somehow.
2020-02-22 00:02:43 -05:00
David Wendt
c00ecccd1f
Basic, stub implementation of `MovieClipLoader.getProgress`, plus test.
...
This implementation just returns the size of the current loaded movie. The test is also deliberately written to be loose on timings so that it likely won't see a partially loaded movie. (I don't want it to be a test of load events, so I just wait a few frames, rather than the correct way of waiting for `onLoadComplete`.)
Until we support streaming file loads, we can't faithfully support these properties. Still, it's better to have them, just in case.
2020-02-22 00:02:42 -05:00
David Wendt
3f7e3a9ed8
Implement `MovieClipLoader.unloadClip`, with tests.
2020-02-22 00:02:41 -05:00
David Wendt
a132226da4
Run `onLoadInit` at the *end* of a frame, rather than before the movie clip's own actions.
...
This is technically better, but it may make more sense to trigger `ClipEvent::Load` at the start of the next frame instead. Furthermore, I don't know if other forms of load events should trigger on the next frame (or end of the current one) like this.
2020-02-22 00:02:39 -05:00
David Wendt
55734619f7
`GetUrl2` can accept a `DisplayObject` as target in `LoadTargetFlag` mode.
...
I have no idea what happens to non-MovieClip objects, or if I'm really supposed to `coerce_to_string` here.
2020-02-22 00:02:36 -05:00
David Wendt
d49c0e9bf7
Rewrite some of the unload and cliploader tests to be more generous with load timing.
...
Loads in Flash Player, like all web technologies, are asynchronous tasks of some kind (probably a separate thread). They appear to operate on some kind of a delay. If I `trace` each frame out, like in the previous version of `mcl_loadclip`, you get a series of events that look like this:
1. Parent frame 1
2. Parent frame 2
3. Event: onLoadStart
4. Event: onLoadProgress
5. Event: onLoadComplete
6. Parent frame 3
7. Event: onLoadInit
If I run that version of the test on Ruffle, everything happens after frame 1. This is an artifact of how we're testing asynchronous behavior in Ruffle. In order to guarantee test determinism, we have a dummy implementation of `fetch` that does a blocking load, and we poll all futures every frame of execution. This means that there is a very specific order of execution with these tests, which is good for testing, but probably isn't 100% accurate.
Flash Player appears to delay all loads by at least one frame, even loads that are coming from disk which should load immediately. I don't know if this is intentional or not, so I don't want to implement a load delay just for the sake of making tests pass. Ergo, I'm loosening the tests to just test the ability to load and unload movies, and fire events from a loader.
Specifically:
1. `mcl_loadclip` no longer traces out frames of the parent timeline
2. `unloadmovie` et. all use a target movie that doesn't fail the test until 10 frames have passed.
If someone can find a movie network that breaks with fast loading, then I'll consider implementing explicit frame delays for async tasks. Otherwise, this is how we're testing this.
2020-02-22 00:01:22 -05:00
David Wendt
8ece2d1b31
Add another ignored test, this time measuring the timing of load events broadcasted by `MovieClipLoader`. We're loading too early, which is why this is ignored.
2020-02-22 00:01:20 -05:00
David Wendt
8ef4a94672
Add new tests for `unloadMovie`, `unloadMovieNum`, and `MovieClip.unloadMovie`.
...
They currently fail in Ruffle, so they're ignored.
2020-02-22 00:01:18 -05:00
David Wendt
cc5dff4254
Add a test for `MovieClip.loadMovie`.
2020-02-22 00:01:17 -05:00
David Wendt
82d305a0f5
Add test for `loadmovienum`
2020-02-22 00:01:16 -05:00
David Wendt
a9621da47d
Add tests for `loadMovie`.
...
This test also includes changes to the SWF testing environment to allow asynchronous movie loads to execute.
2020-02-22 00:01:15 -05:00
David Wendt
db41bec91e
Implement `MovieClipLoader`'s `addListener`, `removeListener`, and `broadcastMessage` methods.
...
Interestingly, this constitutes an implementation of `AsBroadcaster`. It appears Macromedia decided to implement event handling on `MovieClipLoader` in a very similar fashion to `AsBroadcaster`, down to invoking `broadcastMessage` and searching a `_listeners` property for listeners.
2020-02-22 00:01:12 -05:00
David Wendt
55149b7b7e
Reference count the Player and provide a weak reference in UpdateContext.
...
This allows the formation of `'static` futures that can still interact with a player. Async code will need to upgrade the weak reference in order to be able to interact with the player.
2020-02-21 23:44:06 -05:00
Mike Welsh
dc1f99e2ba
tests: Add test for misdocumented DefineFunction2 register preload
2020-02-20 12:58:26 -08:00
Mike Welsh
10fb6c7c04
tests: Add define_function2_preload test
2020-02-19 23:22:33 -08:00
Mike Welsh
dfde98da7d
tests: Add tests for coercing undefined to string in SWF6
2020-02-19 10:47:43 -08:00
Mike Welsh
452ac84f0e
tests: Uncomment Number.POSITIVE_INFINITY/Number.NEGATIVE_INFINITY tests
2020-02-18 10:17:55 -08:00
Mike Welsh
324dd1c5e4
tests: Add swf_tests_approx macro
...
Use this macro to test numeric calculations that might have some
variance using approx_eq.
2020-02-17 15:42:29 -08:00
Mike Welsh
b6249cdb73
tests: Add localToGlobal/globalToLocal test
2020-02-17 15:42:29 -08:00
Mike Welsh
3a1a73ae11
tests: Add more tests for display object properties
...
Add more _x = weirdo value tests, and copy the test into a v6 SWF.
(because undefined etc. can coerce to 0 instead of NaN in SWFv6).
2020-02-14 15:34:14 -08:00
Mike Welsh
19df074a79
tests: Add more tests for AVM1 Color object
...
Include not defined values, wrapping values, invalid values.
2020-02-13 18:06:27 -08:00
Mike Welsh
4d1f7c4d4a
tests: Add movieclip depth method tests
2020-01-31 19:44:42 -08:00
Mike Welsh
a835573f3c
tests: Add test for global GotoFrame action
2020-01-30 15:17:01 -08:00
Mike Welsh
81a1c05682
tests: Add goto_execution_order2 regression test
...
Tests execution order of children added during a goto.
2020-01-28 04:15:08 -08:00
Mike Welsh
69f19f03c4
avm1: Output trace warning for invalid SetTarget ( fix #332 )
2020-01-27 23:35:41 -08:00
Mike Welsh
0446644742
tests: Add target_path test
2020-01-27 23:35:41 -08:00
David Wendt
8eeb9a5c60
This technically isn't a test of `toString`, so remove stuff from the test that it relies upon.
2020-01-27 21:50:11 -05:00
David Wendt
0470b8d0a7
Add a test for `Function.call` and `Function.apply`
2020-01-27 21:50:10 -05:00
Mike Welsh
e71099edd5
tests: Add primitive_type_globals test
2020-01-21 18:24:49 -08:00
Mike Welsh
5f12ce78b6
tests: Add string method tests
2020-01-21 18:24:49 -08:00
Mike Welsh
8cb4278903
tests: Use pretty_assertions for nice output on test fail
2020-01-17 13:54:39 -08:00
Mike Welsh
4eef8a1821
tests: Add test for ActionCall
2020-01-14 00:04:11 -08:00
Mike Welsh
a60fadf0bb
tests: Add test for correct scope in SetVariable
2020-01-06 20:49:05 -08:00
David Wendt
fec95dd226
Add regression test for `idMap`.
2020-01-04 19:00:49 -05:00
David Wendt
1722558d44
Add test for `XML.parseXML`
2020-01-04 19:00:47 -05:00
David Wendt
b4b722e1d6
Add another test for AVM1 XML's failure to roundtrip unsupported node types (e.g. comments).
2020-01-04 19:00:45 -05:00
David Wendt
ce1b958abb
Add some more tests for XML namespace URIs.
2020-01-04 19:00:45 -05:00
David Wendt
d2aa3dd987
Add a test for `createElement` and `createTextNode`.
2020-01-04 19:00:43 -05:00
David Wendt
97bcb6b2dc
Add an ignored test for `xmlDecl`.
...
Test is currently ignored because AS2 XML currently handles XML declarations in ways not compatible with our current parser. Investigating hacky ways around this.
2020-01-04 19:00:41 -05:00
David Wendt
ce0546fc2c
Add test for `docTypeDecl`.
2020-01-04 19:00:40 -05:00
David Wendt
7965045d87
Add test for XMLNode.toString.
2020-01-04 19:00:37 -05:00
David Wendt
c76e5ce447
appendChild also refuses to orphan nodes already part of another XML tree.
2020-01-04 19:00:35 -05:00
David Wendt
bff851e6a4
Add test for insertBefore
2020-01-04 19:00:34 -05:00
David Wendt
7753e20fe3
Add a test for XML.removeNode().
2020-01-04 19:00:33 -05:00
David Wendt
73da72db98
Add a test for `appendChild`.
2020-01-04 19:00:28 -05:00
David Wendt
8939dae90c
Implement `XMLNode.attributes` w/ read tests
2020-01-04 19:00:27 -05:00
David Wendt
6f48f3436f
Expose `previousSibling` and `nextSibling` to ActionScript.
...
This commit also fixes a bug caused by excessive use of copypaste, which was detected by the included test.
2020-01-04 19:00:25 -05:00
David Wendt
223320c98c
Expose `parentNode` to ActionScript
2020-01-04 19:00:24 -05:00
David Wendt
807725d7aa
Expose `firstChild` and `lastChild` to ActionScript w/ tests
2020-01-04 19:00:24 -05:00
David Wendt
48d68bebc4
Implement `hasChildNodes()` and add test
2020-01-04 19:00:23 -05:00
David Wendt
c58e866236
Add test for `cloneNode`
2020-01-04 19:00:22 -05:00
David Wendt
8e33566d07
Add namespacing test
2020-01-04 19:00:21 -05:00
David Wendt
f8f569440f
Add very basic XML test
2020-01-04 19:00:17 -05:00
Mike Welsh
4ce67535b0
tests: Add test for Color
2020-01-03 20:31:32 -08:00
Mike Welsh
1d8ae9154b
tests: Add tests for AVM1 logical ops
2019-12-21 23:01:10 -08:00
Mike Welsh
00fdc74f1f
tests: Add test for property updating in fast-forward gotos
2019-12-21 21:16:27 -08:00
Nathan Adams
eedc4bbe24
core: Added Input backend, currently unimplemented, for polling user input
2019-12-21 19:08:06 -08:00
Mike Welsh
c4b446ff78
tests: Add test for functions closing over base clip
2019-12-19 17:30:50 -08:00
Mike Welsh
13c43ed171
tests: Update movieclip_hittest to verify points are in root coordinates
2019-12-19 12:35:56 -08:00
Nathan Adams
f6f358b4de
avm1: Expose TextFields and allow setting their .text
2019-12-19 10:19:43 -08:00
Nathan Adams
d3848f97ea
avm1: Implemented MovieClip.hittest, without shape flag
2019-12-18 15:21:14 -08:00
Mike Welsh
32953d5c5c
avm1: Allow objects in ActionSetTarget2
...
Fixes 8-Bit Theater 3 soft locking on the first frame.
2019-12-17 18:32:25 -08:00
Mike Welsh
28faf2030b
tests: Add failing case to slash_syntax test
2019-12-17 04:00:01 -08:00
Mike Welsh
fc3878d6d9
tests: Add tests for movie clip cloning/removing
2019-12-17 03:20:01 -08:00
Nathan Adams
45e497826b
avm1: Implement `Mouse` listeners & events (excluding scroll)
2019-12-16 19:22:10 -08:00
Mike Welsh
c61842a72a
tests: Add test for slash syntax
2019-12-16 15:33:57 -08:00
Mike Welsh
b2cdc19f55
tests: Add test for goto MovieClip methods
2019-12-16 00:52:27 -08:00
Mike Welsh
1fe170400c
tests: Add clip_events regression test
2019-12-15 19:22:23 -08:00
David Wendt
e08cfcd288
Enable the `as2-oop` test since it now passes.
2019-12-15 13:32:04 -08:00
David Wendt
d173e91de6
AS2 OOP test. This won't actually pass until we have interfaces, init actions, and constant pool closures merged in. Hence, it's ignored.
2019-12-15 13:17:41 -08:00
Nathan Adams
aca746eee7
core: Implemented Array.splice with tests
2019-12-15 12:33:24 -08:00
Nathan Adams
31b84c5f19
core: Made arrays a storage property of objects, not a unique object type. Added more corner case tests.
2019-12-15 12:33:24 -08:00
Nathan Adams
3bdf710af6
core: Add another array.concat test
2019-12-15 12:33:24 -08:00
Nathan Adams
32a1eda080
core: Implement Arrays & array prototype
2019-12-15 12:33:24 -08:00
Nathan Adams
46b6ce570b
core: Added array tests
2019-12-15 12:33:24 -08:00
Mike Welsh
95755b5fb3
tests: Add test for TransformedByScript flag
2019-12-15 10:17:33 -08:00
Mike Welsh
f6c50efe5a
tests: Clean up stage_object_propreties and add _name and _target
2019-12-15 10:17:33 -08:00
Mike Welsh
e36dbad7d2
tests: Add stage_object_properties test
2019-12-15 10:17:33 -08:00
Mike Welsh
c9864eb557
core: Add StageObject properties
2019-12-15 10:17:33 -08:00
Mike Welsh
3986a8dc4a
tests: Add regression test for display object properties
2019-12-15 08:54:26 -08:00
Mike Welsh
d30506dc59
tests: Add test for enumerating child instances
2019-12-15 08:54:26 -08:00
Mike Welsh
11f2b46b6a
tests: Add test for stage instances
2019-12-15 08:54:26 -08:00
Mike Welsh
f0c6b2d8d8
core: Remove this from Object::get/set
2019-12-15 08:54:26 -08:00
Mike Welsh
cbe0f873af
tests: Add test for Object.addProperty
2019-12-03 15:01:39 -08:00
David Wendt
89e060be4e
Add a regression test for `_global` being a bare object
2019-11-28 20:53:31 -05:00
Nathan Adams
68760007fc
Lessthan can return `undefined`, not just booleans
2019-11-28 20:53:30 -05:00
Nathan Adams
ec5ed4f140
Change regression_test to use `actual, expected` so tools (like intelliJ) diff it correctly
2019-11-28 20:43:54 -05:00
Nathan Adams
f5b78f6fb0
Typo in test filename
2019-11-28 20:41:26 -05:00
Nathan Adams
bda72728ac
Assume that NaN == NaN for ruffle
2019-11-28 20:41:25 -05:00
Nathan Adams
c9c4749bb0
core: Added battery of tests for lessthan, greaterthan, equals and strictequals between swf4-swf7
2019-11-28 20:41:23 -05:00
Nathan Adams
3f4597f081
Add tests for lessthan
2019-11-28 20:31:02 -05:00
David Wendt
504f962256
Add a test for every string coercion I could find.
2019-11-28 20:28:46 -05:00
Nathan Adams
2650433271
Fixed get_keys with prototypes
2019-11-27 22:30:31 +01:00
Nathan Adams
585c520b87
Added prototype_enumerate test, `for (key in obj)`
2019-11-27 21:46:21 +01:00
Nathan Adams
fdbd16a5d9
Ignore extends_chain, that's NYI
2019-11-27 21:11:03 +01:00
Nathan Adams
57d8469e3b
Added a test for isPrototypeOf
2019-11-27 21:09:14 +01:00
David Wendt
1eb4dfa696
Merge remote-tracking branch 'dinnerbone/feature/extends_test' into feature/prototyping
2019-11-27 14:58:47 -05:00
Nathan Adams
b0f0008596
Added test for hasOwnProperty
2019-11-27 20:51:40 +01:00