Commit Graph

178 Commits

Author SHA1 Message Date
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