Commit graph

630 commits

Author SHA1 Message Date
Paul Kaplan
8c92d195f7 Update monitors sb2 integration test for editing locally.
I cannot open the sb2 file without modifying the width/height of the lists, and editing+rezipping does not seem to work for me, so I need to change this width/height before I can make real changes to the tests.
2019-02-11 10:59:07 -05:00
chrisgarrity
7e9297145d Add test for nested sb2 2019-02-11 10:24:34 +01:00
Christopher Willis-Ford
46a1ae83a0 Use MockTimer for TaskQueue tests 2019-02-07 16:35:33 -08:00
Christopher Willis-Ford
7f80fe17b3 Build a mock Timer class and add tests for it 2019-02-07 16:35:32 -08:00
Karishma Chadha
c761a9c82e Fix issue where non-strings were getting passed in to escape functions for handling special characters that can appear in xml. Add tests. 2019-02-07 11:58:10 -05:00
Paul Kaplan
765f2b2549
Merge pull request #1983 from picklesrus/broadcast-msg-chars
Broadcast msg chars
2019-02-07 08:32:55 -05:00
Paul Kaplan
6deab79903
Merge pull request #1979 from paulkaplan/share-blocks-new-ids
Add a utility for giving blocks new IDs, use it for sharing blocks.
2019-02-07 08:31:25 -05:00
Karishma Chadha
166e5f1dbc
Update test/unit/util_new-block-ids.js
Co-Authored-By: paulkaplan <pkaplan@media.mit.edu>
2019-02-07 08:30:38 -05:00
picklesrus
b904f19c1d Fix loading broadcast messages with special characters for projects that were converted from 2.0. 2019-02-06 16:58:46 -05:00
picklesrus
aead1ba8f4 Fix a typo in the variable test. 2019-02-06 16:53:25 -05:00
picklesrus
ecbfcd78bd Fix sb2 loading of broadcast messages with special characters. 2019-02-06 16:48:39 -05:00
Paul Kaplan
b70cf39203 Update VM tests to handle shared block having new ID 2019-02-06 10:35:03 -05:00
Paul Kaplan
31fbcfa4d7 Add a utility for giving blocks new IDs, use it for sharing blocks. 2019-02-06 10:16:22 -05:00
Karishma Chadha
4e924bf4b5
Merge pull request #1973 from kchadha/fix-variable-characters
Fix variable characters
2019-02-05 17:01:43 -05:00
Karishma Chadha
c796a8b1cc
Merge pull request #1962 from LLK/project-dirty-state-fixes
Project dirty state fixes
2019-02-05 16:38:30 -05:00
Karishma Chadha
cd8de5f156 Add tests! =] 2019-02-04 19:05:44 -05:00
Karishma Chadha
166bc37f6f
Merge pull request #1945 from yokobond/fix-message-variable-name-destruction
Escape variable name in XML
2019-02-04 10:10:13 -05:00
Karishma Chadha
b2f63cdbb4 Add tests for project state changes emitted by editing blocks. 2019-01-30 10:59:25 -05:00
Karishma Chadha
ee936e3d36 Fix tests for reordering costumes and sounds. 2019-01-30 10:59:25 -05:00
Karishma Chadha
df823a06f6 Add tests for project changed state. 2019-01-30 10:59:25 -05:00
Karishma Chadha
a9cf509a55
Merge pull request #1941 from kchadha/add-runtime-to-blocks
Add reference for `runtime` to blocks container
2019-01-30 10:57:45 -05:00
Karishma Chadha
e0b0d35b46 Add references to runtime to constructor calls for Sprite, Target, and RenderedTarget so blocks get created properly. 2019-01-29 15:30:45 -05:00
Karishma Chadha
7ac8721aa5 Add references to runtime to existing calls to Blocks constructor in tests. 2019-01-28 19:30:42 -05:00
Karishma Chadha
18e9a08775 Use beforeEach instead of a fake set up test 2019-01-28 10:53:42 -05:00
Karishma Chadha
94fa3d56c8 Fix saving and loading of slider min max values. Add test for sb2 to sb3 conversion that tests all montior properties remain the same after save and load. 2019-01-25 14:14:46 -05:00
yokobond
8eee92d41a Escape variable name in XML 2019-01-25 10:31:33 +09:00
Karishma Chadha
0bf5d8ab90 Update VM getPlaygroundData function to remove circular dependency in blockContainer. It wasn't being used by the tests or the playground and it is not an issue with actual project serialization. Update test to stop passing in runtime to blocklyListen function. 2019-01-24 15:26:16 -05:00
Karishma Chadha
0fa5e9181a
Merge pull request #1839 from mzgoddard/fix-missing-no-param
fix: initialize stack frame params for all procedures
2019-01-16 14:06:38 -05:00
Karishma Chadha
59a865ef47 Create a new addTarget function on the runtime which populates the targets list as well as the executable targets list. 2019-01-14 11:48:11 -05:00
Karishma Chadha
fbee37e915 Populate executable targets when runtime.targets is populated so that scripts don't run before they are supposed to (e.g. before targets are done getting installed). 2019-01-11 14:52:34 -05:00
Paul Kaplan
2346f440c8
Merge pull request #1898 from paulkaplan/re-enable-tests
Re enable tests that were unavailable during maintenance
2019-01-08 13:45:17 -05:00
Karishma Chadha
01970fa6f0
Update test/unit/util_task-queue.js
Co-Authored-By: paulkaplan <pkaplan@media.mit.edu>
2019-01-08 13:29:04 -05:00
Paul Kaplan
cba3eefb52 Re enable tests that were unavailable during maintenance 2019-01-07 12:59:33 -05:00
Karishma Chadha
85843e5d6f Fix cloud variable limit 2019-01-07 11:12:47 -05:00
Ray Schamp
11546c7f0d Skip failing tests, this is @thisandagain's fault :) 2019-01-02 12:41:09 -05:00
Karishma Chadha
c5284469d3
Merge pull request #1831 from apple502j/stop-ask
Clear ask bubble when stopForTarget
2018-12-26 10:29:23 -05:00
apple502j
87df9610a6
Also here and there 2018-12-22 16:57:20 +09:00
apple502j
e11ff6ba19
Fix test 2018-12-22 16:56:45 +09:00
Karishma Chadha
397711b822 Update sb1-converter and add an sb import integration test. 2018-12-21 14:22:33 -05:00
julescubtree
9e2dab0105
fix linting error in serialization_sb3.js 2018-12-17 09:50:17 -08:00
julescubtree
9aa23a31ee
add test file for loading draggability unit test 2018-12-17 09:44:14 -08:00
julescubtree
7a9bea5007
add unit test for loading draggability
to serialization_sb3.js
2018-12-17 09:40:56 -08:00
Karishma Chadha
dfd4735871
Merge pull request #1833 from kchadha/fix-sb2-from-sb1-import
Fix issue importing some sb2s that were originally sb1s, with baseLayerMd5 property formatted differently.
2018-12-13 15:59:44 -05:00
Paul Kaplan
2f6527cb1d
Merge pull request #1843 from paulkaplan/fix-mouse-rounding
Round the values reported from the sensing mouse x/y reporters
2018-12-13 11:27:05 -05:00
Paul Kaplan
1bede31ec1 Round the values of mouse io getScratchX/Y 2018-12-13 11:06:31 -05:00
Michael "Z" Goddard
20ff75b776
fix: initialize stack frame params for all procedures
A previous change fixed compatibility with Scratch 2 removing 3's
unintentional scope leaking. This furthers that change so that
procedures with no parameters will also not accidentally use values in
other procedure stacks.
2018-12-13 10:51:44 -05:00
Karishma Chadha
6c51c40245
Merge pull request #1834 from kchadha/edge-hat-duplicate-sprite
Fix issue where edge-activated hats only run on one sprite after duplicating the sprite
2018-12-12 21:13:09 -05:00
Karishma Chadha
95dafb43c4 Serialize x and y for topLevel blocks even if one or both of the values is 0. 2018-12-12 18:51:36 -05:00
Karishma Chadha
6c4fb29523 Move tracking of edge activated hat values into target. 2018-12-12 12:05:55 -05:00
Karishma Chadha
19737d4e39 Fix issue where edge-activated hats only run on one sprite when sprite is duplicated or cloned. 2018-12-11 12:28:37 -05:00
Karishma Chadha
27be6f1677 Add integration test 2018-12-10 18:24:28 -05:00
picklesrus
ebe06a97d9
Merge pull request #1818 from picklesrus/monitor-vars-project-load
Clear out the blocks in dispose. Fixes #1758 where old monitored vari…
2018-12-07 15:08:09 -05:00
Ray Schamp
758c0a765d
Merge pull request #1808 from rschamp/disable-task-queue-tests
Skip task queue tests
2018-12-06 15:51:52 -05:00
Paul Kaplan
8405ff00d4
Merge pull request #1825 from paulkaplan/emit-start-publicly
Emit PROJECT_START event publicly on green flag click.
2018-12-06 15:38:05 -05:00
Paul Kaplan
56c062eee3 re-emit the PROJECT_START event publicly, add unit test 2018-12-06 11:47:09 -05:00
Karishma Chadha
87f57c8c95
Merge pull request #1823 from kchadha/slider-cloud-vars
Request cloud variable update in top level setVariableValue API
2018-12-06 10:56:07 -05:00
Paul Kaplan
23d9c21a0e
Merge pull request #1822 from paulkaplan/fix-list-clones
Make duplicateVariable deep copy the array instead of keeping reference.
2018-12-06 09:21:41 -05:00
Paul Kaplan
4756726e43
Merge pull request #1816 from paulkaplan/do-save-tl-var-blocks
Add a test and fix for not serializing top-level variable reporters
2018-12-06 05:32:23 -05:00
Karishma Chadha
499209c174
Update test/unit/engine_target.js
Co-Authored-By: paulkaplan <pkaplan@media.mit.edu>
2018-12-06 05:30:17 -05:00
Karishma Chadha
78e5f93544
Update test/unit/engine_target.js
Co-Authored-By: paulkaplan <pkaplan@media.mit.edu>
2018-12-06 05:30:10 -05:00
Karishma Chadha
dc4fd15197 Make a cloud device requestVariableUpdate when setting a variable through the vm's top level setVariableValue API. Add unit test for new functionality. 2018-12-05 22:38:06 -05:00
Paul Kaplan
809d2de9f2 Fix typo uncovered by loading lonely variable reporters 2018-12-05 16:59:47 -05:00
picklesrus
694af40964 Fix the monitor threads test. It was written before monitors could be loaded so was hand editing the monitorBlocks before loading the default project. The code I added to dispose was then clearing that out. 2018-12-05 16:54:08 -05:00
Paul Kaplan
d50504e339 Make duplicateVariable deep copy the array instead of keeping reference. 2018-12-05 16:27:10 -05:00
Katie Broida
9d3d53537d
Merge pull request #1741 from ktbee/load-video-state
Set video state after project load and after adding extension through UI
2018-12-05 14:33:19 -05:00
Paul Kaplan
ff3391718d
Merge pull request #1815 from paulkaplan/clear-pen-on-dispose
Clear the pen layer when runtime dispose happens.
2018-12-05 12:30:24 -05:00
picklesrus
d6acd97ec7 remove stray new line 2018-12-05 12:13:52 -05:00
picklesrus
cddcea652b Clear out the blocks in dispose. Fixes #1758 where old monitored variables were getting kept across project loads 2018-12-05 12:09:12 -05:00
Paul Kaplan
be65b615a2 Add a test and fix for not serializing top-level variable reporters 2018-12-05 11:35:22 -05:00
Katie Broida
ef8bbb7186 Set video state after project load event, adding extension for the first time 2018-12-05 11:08:00 -05:00
Karishma Chadha
6420cc8831
Update test/unit/engine_runtime.js
Co-Authored-By: paulkaplan <pkaplan@media.mit.edu>
2018-12-05 09:01:35 -05:00
Paul Kaplan
4fe06153d6
Merge pull request #1809 from paulkaplan/serialize-infinity
Serialize Infinity and NaN to 0
2018-12-05 08:28:50 -05:00
Paul Kaplan
6bd2307c99 Clear the pen layer when runtime dispose happens. 2018-12-04 16:43:31 -05:00
Eric Rosenbaum
19069998c0
Merge pull request #1804 from evhan55/test/task-queue
Task Queue unit test stubbed timer
2018-12-04 16:15:49 -05:00
Paul Kaplan
23b1e3e134 Add test for nested Infinity 2018-12-04 13:00:36 -05:00
Evelyn Eastmond
16e45957fa Adding a simulated timer to the task queue test instead of using a Timer object. 2018-12-04 12:12:06 -05:00
Karishma Chadha
d71b405300
Merge pull request #1740 from bocoup/fix-flacky-test
Fix flacky test: order-changes-backwards-2-broadcast-and-wait.sb2
2018-12-04 11:18:51 -05:00
Paul Kaplan
7e96ef2985 Serialize Infinity and NaN to 0 2018-12-04 10:52:49 -05:00
Ray Schamp
1697e86f5f Skip task queue tests
They are flaky. Pending resolution of #1807, skip them.
2018-12-04 10:39:59 -05:00
Katie Broida
967cab8f20
Make the wait block's logic and behavior more consistent with Scratch 2 (#1759) 2018-12-04 10:35:42 -05:00
Evelyn Eastmond
2bc8778f00 Test commit for checking out Travis. 2018-12-03 21:25:06 -05:00
Eric Rosenbaum
536305af1b
Remove vestigial device manager (#1793) 2018-12-03 15:52:23 -05:00
DD Liu
122443a75f
Merge pull request #1754 from bocoup/handle-infinity
Make Scratch 3 comparisons with +/-Infinity match Scratch 2
2018-11-29 14:31:10 -05:00
Valerie R Young
ee40e411ab Only one say end after broadcaste and waits 2018-11-29 14:00:57 -05:00
Karishma Chadha
ff2566fec4
Merge pull request #1778 from kchadha/emit-cloud-data-update
Emit cloud data update
2018-11-28 17:23:29 -05:00
Karishma Chadha
431e92aa54 Fix up tests and remove unused function. 2018-11-28 15:03:20 -05:00
picklesrus
eefe021425 add todo and remove a newline 2018-11-28 12:33:04 -05:00
picklesrus
d19848b712 remove unused import 2018-11-28 11:55:02 -05:00
picklesrus
e64cd5f34b stop mocking method in the test. 2018-11-28 10:36:22 -05:00
picklesrus
4a542b455d fix code review comments 2018-11-28 10:36:22 -05:00
picklesrus
f214d3a191 VM changes for the sensing_of block. This handles lists properly (by ignoring them like Scratch2 and makes the attribute menu update based on what was chosen in the target menu. 2018-11-28 10:35:35 -05:00
Paul Kaplan
421aac6340 Ensure setCompatibilityMode continues to restart if previously started.
This was previous behavior, but the previous commit which prevents restarts based on _steppingInterval truthiness broke it because clearInterval does not modify the value of _steppingInterval
2018-11-28 08:47:51 -05:00
Paul Kaplan
4378603d36 Prevent the runtime from spawning new stepping intervals 2018-11-28 08:34:22 -05:00
Valerie R Young
70f00e30c4 Revert changes to toNumber, fix comparison of infinity in cast.compare 2018-11-27 17:53:20 -05:00
Paul Kaplan
ffb02c607d
Merge pull request #1783 from paulkaplan/emit-start-event
Emit a RUNTIME_STARTED event to track if the vm has been started
2018-11-27 16:38:27 -05:00
Paul Kaplan
0c38c3cffe Force exiting after tests finish 2018-11-27 16:06:56 -05:00
Paul Kaplan
cc4751228e Emit a RUNTIME_STARTED event to track if the vm has been started 2018-11-27 11:37:01 -05:00
Karishma Chadha
abbce00203 Add unit tests for new rename and delete cloud var functionality. 2018-11-20 19:56:45 -05:00
Karishma Chadha
25ce08131a Add rename and delete functionality for cloud variables. Refactor function name for cloud variable creation API. 2018-11-20 15:11:12 -05:00
Christopher Willis-Ford
3649c15f2a Fix monitor tests to count only monitor threads
The monitor tests no longer fail if the last step happens to have run a
non-monitor thread in addition to the monitor threads.
2018-11-19 16:34:33 -08:00
Chris Willis-Ford
e071cf3c0c
Merge pull request #1768 from cwillisf/node11-fix-unit-tests
Fix unit tests on Travis CI
2018-11-19 14:06:10 -08:00
Christopher Willis-Ford
30a1ba52e3 Use absolute path for worker shim in dispatch test
Node 11 causes TinyWorker to resolve its start script path differently,
compared to Node 8. Using an absolute path works for both.
2018-11-19 11:57:43 -08:00
Valerie R Young
d8078c018d Implement feedback, broadcast order 2018-11-16 17:24:28 -05:00
Katie Broida
bb82c46f8a
Handle coordinate precision the same as Scratch 2 (#1722) 2018-11-15 15:50:56 -05:00
Valerie Young
2ca735eab4
Merge pull request #1716 from bocoup/unknown-block-input-fix
Handle unknown opcode in input
2018-11-15 10:09:46 -05:00
Ray Schamp
f2550d582c
Merge pull request #1750 from rschamp/feature/sb3-json-assets
Add method for collecting all targets' assets
2018-11-15 10:31:58 +00:00
Ray Schamp
bcd1c5b13a Consolidate collectAssets into getter 2018-11-15 10:26:05 +00:00
Karishma Chadha
0c9da5d963
Merge pull request #1755 from kchadha/cloud-var-create
Create cloud variables
2018-11-14 21:39:29 -05:00
Karishma Chadha
e2e6509a4a Fix lint error 2018-11-14 19:22:41 -05:00
Karishma Chadha
fad4d381bb Add and update unit tests for new create cloud variable functionality. 2018-11-14 15:46:51 -05:00
Karishma Chadha
3dd0d0a657
Merge pull request #1686 from kchadha/monitor-save-load
Monitor save & load
2018-11-14 13:23:10 -05:00
Karishma Chadha
dccb41e3c4 Comment and test cleanup. 2018-11-14 10:42:52 -05:00
Valerie R Young
b4e5655b18 Satisfy linter 2018-11-13 13:59:22 -05:00
Valerie R Young
1b44841034 Add unit tests for treatment of infinity primatives 2018-11-13 13:51:12 -05:00
Ray Schamp
df56e615ec Add method for collecting all targets' assets
Resolves #1601. Does not include the project JSON since that would require knowledge of a project ID, which the VM has not been responsible for so far.

For now, it is the responsibility of the consumer to determine if these assets should be saved or not. Otherwise the VM would need to be responsible for saving, which has been out of its scope.
2018-11-12 15:13:02 +00:00
Karishma Chadha
6dfc0b678e Add integration test for monitor save/load. 2018-11-09 23:45:49 -05:00
Karishma Chadha
cfa71723eb Ignore video sensing monitor and import music tempo monitor unless it is hidden. Load extensions for visible monitors. Add tests for new functionality. 2018-11-09 00:09:54 -05:00
Karishma Chadha
fe186913ac
Merge pull request #1742 from kchadha/multi-monitors
Multi monitors
2018-11-08 14:44:22 -05:00
Karishma Chadha
87244b4110 Normalize capitalization of sensing_current block fields during sb2 import and during monitor id generation. Update monitors integration test to include sensing_current block monitors. 2018-11-08 14:11:30 -05:00
Ray Schamp
4f5aba4fe6
Merge pull request #1727 from paulkaplan/add-ext-on-share
Add unloaded extensions on block sharing
2018-11-08 10:15:58 +00:00
Karishma Chadha
5db3db3a92 monitor id getter should use block fields instead of a list of strings 2018-11-08 01:33:26 -05:00
Karishma Chadha
8aa0fa11aa
Merge pull request #1649 from mzgoddard/get-attribute-stage-alt-name
Get attribute stage alt name
2018-11-07 17:47:44 -05:00
Karishma Chadha
4bb2d19584
Merge pull request #1683 from mzgoddard/sequencer-thread-cleanup
Sequencer thread cleanup
2018-11-07 17:15:11 -05:00
Paul Kaplan
ce94144051 Fixup from comments 2018-11-07 10:11:16 -05:00
Valerie R Young
05a28e553e Say 'end' only after 4th increment 2018-11-06 13:26:25 -05:00
Valerie R Young
b64d18b627 Satisfy linter 2018-11-05 15:16:57 -05:00
Valerie R Young
2c76d3bf71 Add unit test for unknown opcode inputs 2018-11-05 13:23:31 -05:00
Paul Kaplan
979ed66594 Add a unit test to ensure extensions are loaded on shareBlocksToTarget 2018-11-05 13:01:00 -05:00
Paul Kaplan
c8ad1955d4 Load extensions before sharing blocks.
This commit fixes the unit tests so the assertions are made after the promise resolves
2018-11-05 13:00:35 -05:00
Paul Kaplan
bc1da9fa44 Move extension ID parsing into a helper and add test 2018-11-05 12:57:09 -05:00
Karishma Chadha
5593c9ab3e
Merge pull request #1711 from kchadha/import-cloud-var-info
Import cloud var info and enforce cloud var limit
2018-11-01 09:46:37 -04:00
Karishma Chadha
ffef2e92fc Fix up docs and incorrect initialization of cloud data manager functions. Add 'spec' unit tests that the cloud data manager functions are actually functions. 2018-10-31 19:20:13 -04:00
Michael "Z" Goddard
2ffa8eb333
update runtime thread tests
Threads are now removed after every "inner" step. Any thread that
reaches its DONE conditions is immediately removed instead of requiring
an extra step to remove it. As such tests that check the number of
threads have been updated to consider this.
2018-10-31 17:56:12 -04:00
Katie Broida
5cf10b1af1
Tests to check whether extensions load (#1700) 2018-10-31 17:22:21 -04:00
Karishma Chadha
1df6743a5f Refactor cloud data manager to break out cloud data limit check vs. limit update. 2018-10-31 13:40:05 -04:00
Karishma Chadha
d041259473 Fix documentation for local cloud var test 2018-10-30 19:01:16 -04:00
Karishma Chadha
a6de046dda Add unit and integration tests for the new functionality. 2018-10-30 18:54:25 -04:00
Katie Broida
6ef600dc2c
Add runtime event for when the project is loaded (#1669) 2018-10-30 15:26:22 -04:00
Karishma Chadha
fd5e178d3b
Merge pull request #1703 from kchadha/cloud-io
Cloud IO
2018-10-30 11:57:20 -04:00
Paul Kaplan
b245b3868f
Merge pull request #1416 from paulkaplan/fix-mouse-down
Make click hats trigger on mouse down instead of up
2018-10-29 15:05:18 -04:00
Karishma Chadha
be238d35d2
Merge pull request #1517 from joker314/costume-compatibility
Make "switch costume" and "switch backdrop" blocks compatible with 2.0
2018-10-29 11:39:41 -04:00
Karishma Chadha
19b6c35cab Add unit tests for cloud io device 2018-10-29 00:59:24 -04:00
Paul Kaplan
e002db48f2 Add logic to trigger click hats on mouse up on a draggable target
As long as the event was not a drag
2018-10-25 15:08:37 -04:00
Paul Kaplan
9bf7ef8573 Add unit tests for activating click hats 2018-10-25 14:06:36 -04:00
Ray Schamp
de86eb3f19
Merge pull request #1691 from rschamp/storage-no-cache
Store asset objects on costumes and sounds
2018-10-25 10:15:47 +01:00
Karishma Chadha
d3e38c1ae9
Merge pull request #1640 from mzgoddard/set-procedure-param-missing
Set procedure param missing
2018-10-25 00:13:51 -04:00
Katie Broida
18c83dcc67
Prevent non-core extensions from adding monitors (#1688) 2018-10-24 16:43:01 -04:00
Ray Schamp
902aee48ee Merge branch 'develop' of https://github.com/LLK/scratch-vm into storage-no-cache
# Conflicts:
#	package-lock.json
2018-10-24 12:09:06 +01:00
Michael "Z" Goddard
afd2ed72c8
add procedure parameter used outside of proc integrations 2018-10-23 15:14:31 -04:00
Michael "Z" Goddard
58a7a6bb04
add get param blocks in wrong procedure integrations 2018-10-23 15:14:30 -04:00