Browse files

Merge pull request #1169 from yurydelendik/unturbo

Reverts back testing turbo mode (9c30535)
  • Loading branch information...
2 parents 8ef1abd + c80a3d0 commit 6e3c7d3fec5a43eef17f0a992de21f9f5f0a8f10 @yurydelendik yurydelendik committed Mar 4, 2014
Showing with 63 additions and 44 deletions.
  1. +4 −0 src/flash/display/Loader.js
  2. +12 −2 src/swf/embed.js
  3. +6 −2 test/harness/slave.js
  4. BIN test/swfs/3_joystick.fla
  5. BIN test/swfs/3_joystick.swf
  6. +5 −1 test/swfs/code/Interactivity3.as
  7. +1 −2 test/swfs/flash_display_BitmapData.as
  8. BIN test/swfs/flash_display_BitmapData.swf
  9. +1 −2 test/swfs/flash_display_DisplayObject.as
  10. BIN test/swfs/flash_display_DisplayObject.swf
  11. +1 −2 test/swfs/flash_display_DisplayObjectContainer.as
  12. BIN test/swfs/flash_display_DisplayObjectContainer.swf
  13. +1 −2 test/swfs/flash_display_Graphics.as
  14. BIN test/swfs/flash_display_Graphics.swf
  15. +1 −1 test/swfs/flash_display_InteractiveObject.as
  16. BIN test/swfs/flash_display_InteractiveObject.swf
  17. +2 −1 test/swfs/flash_display_Loader.as
  18. BIN test/swfs/flash_display_Loader.swf
  19. +2 −1 test/swfs/flash_display_LoaderInfo.as
  20. BIN test/swfs/flash_display_LoaderInfo.swf
  21. +1 −1 test/swfs/flash_display_MovieClip.as
  22. BIN test/swfs/flash_display_MovieClip.swf
  23. +1 −1 test/swfs/flash_display_Shape.as
  24. BIN test/swfs/flash_display_Shape.swf
  25. +16 −13 test/swfs/flash_display_SimpleButton.as
  26. BIN test/swfs/flash_display_SimpleButton.swf
  27. +1 −2 test/swfs/flash_display_Stage.as
  28. BIN test/swfs/flash_display_Stage.swf
  29. +1 −2 test/swfs/flash_filters_BlurFilter.as
  30. BIN test/swfs/flash_filters_BlurFilter.swf
  31. +1 −2 test/swfs/flash_filters_DropShadowFilter.as
  32. BIN test/swfs/flash_filters_DropShadowFilter.swf
  33. +1 −2 test/swfs/flash_filters_GlowFilter.as
  34. BIN test/swfs/flash_filters_GlowFilter.swf
  35. +1 −1 test/swfs/flash_geom_ColorTransform.as
  36. BIN test/swfs/flash_geom_ColorTransform.swf
  37. +2 −2 test/swfs/flash_geom_Point.as
  38. BIN test/swfs/flash_geom_Point.swf
  39. BIN test/swfs/timeline/scene/Scene_1_MainTimeline.fla
  40. BIN test/swfs/timeline/scene/Scene_1_MainTimeline.swf
  41. BIN test/swfs/timeline/scene/Scene_2_MovieClipTimeline.fla
  42. BIN test/swfs/timeline/scene/Scene_2_MovieClipTimeline.swf
  43. +2 −2 utils/compileabc.js
View
4 src/flash/display/Loader.js
@@ -72,6 +72,10 @@ var LoaderDefinition = (function () {
}
});
});
+
+ // signal when we finish parsing, it's mostly to provide consistent testing results
+ this._contentLoaderInfo._dispatchEvent("parsed");
+
Promise.all([frameConstructed, this._lastPromise]).then(function () {
this._content._complete = true;
this._contentLoaderInfo._dispatchEvent("complete");
View
14 src/swf/embed.js
@@ -15,7 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*global SWF, renderStage, rgbaObjToStr, ShumwayKeyboardListener, forceHidpi */
+/*global SWF, renderStage, rgbaObjToStr, ShumwayKeyboardListener, forceHidpi,
+ Promise */
SWF.embed = function(file, doc, container, options) {
var canvas = doc.createElement('canvas');
@@ -191,9 +192,18 @@ SWF.embed = function(file, doc, container, options) {
options.onStageInitialized(stage);
}
- renderStage(stage, ctx, options);
+ var startPromise = options.startPromise || Promise.resolve();
+ startPromise.then(function () {
+ renderStage(stage, ctx, options);
+ });
});
+ if (options.onParsed) {
+ loaderInfo._addEventListener("parsed", function () {
+ options.onParsed();
+ });
+ }
+
if (options.onComplete) {
loaderInfo._addEventListener("complete", function () {
options.onComplete();
View
8 test/harness/slave.js
@@ -16,7 +16,10 @@
* limitations under the License.
*/
-turboMode.value = true;
+// turbo mode introduces intermittent failures in timeline and timeline_scene
+// tests since frames are not parsed fast enough for gotoAndPlay/gotoAndStop
+// turboMode.value = true;
+
skipFrameDraw.value = false;
function loadMovie(path, reportFrames) {
@@ -68,7 +71,8 @@ function loadMovie(path, reportFrames) {
}
SWF.embed(buffer, document, document.getElementById("stage"), {
url: path,
- onComplete: loaded,
+ startPromise: movieReady,
+ onParsed: loaded,
onAfterFrame: onFrameCallback,
onTerminated: terminate
});
View
BIN test/swfs/3_joystick.fla
Binary file not shown.
View
BIN test/swfs/3_joystick.swf
Binary file not shown.
View
6 test/swfs/code/Interactivity3.as
@@ -23,6 +23,7 @@
public var decay:Number = .5;
public var xSpeed:Number = 0;
public var dragging:Boolean = false;
+ private var moved:Boolean = false;
//*************************
// Constructor:
@@ -97,8 +98,11 @@
if( x < 231 ){
x = 465;
}
- if( x > 465 ){
+ if (x > 370 && !moved) {
+ moved = true;
trace('wrap');
+ }
+ if( x > 465 ){
x = 231;
}
// Move the beetle in proportion to how far
View
3 test/swfs/flash_display_BitmapData.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf BitmapDataTest,200,200 test/swfs/flash_ui_BitmapData.as
+ node utils/compileabc.js --swf BitmapDataTest,600,600,60 -p test/swfs/flash_display_BitmapData.as
*/
package {
@@ -11,7 +11,6 @@ package {
public class BitmapDataTest extends Sprite {
public var child;
public function BitmapDataTest() {
- stage.frameRate = 20;
child = new BitmapDataObject();
addChild(child);
addEventListener(Event.ENTER_FRAME, child.enterFrameHandler);
View
BIN test/swfs/flash_display_BitmapData.swf
Binary file not shown.
View
3 test/swfs/flash_display_DisplayObject.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf DisplayObjectTest,600,600 test/swfs/flash_display_DisplayObject.as
+ node utils/compileabc.js --swf DisplayObjectTest,600,600,60 -p test/swfs/flash_display_DisplayObject.as
*/
package {
@@ -10,7 +10,6 @@ package {
public class DisplayObjectTest extends Sprite {
public function DisplayObjectTest() {
- stage.frameRate = 20;
var child:CustomDisplayObject = new CustomDisplayObject();
addChild(child);
}
View
BIN test/swfs/flash_display_DisplayObject.swf
Binary file not shown.
View
3 test/swfs/flash_display_DisplayObjectContainer.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf DisplayObjectContainerTest,600,600 test/swfs/flash_display_DisplayObjectContainer.as
+ node utils/compileabc.js --swf DisplayObjectContainerTest,600,600,60 -p test/swfs/flash_display_DisplayObjectContainer.as
*/
package {
@@ -10,7 +10,6 @@ package {
public class DisplayObjectContainerTest extends Sprite {
public function DisplayObjectContainerTest() {
- stage.frameRate = 20;
var child:DisplayObjectContainerObject = new DisplayObjectContainerObject();
addChild(child);
addEventListener(Event.ENTER_FRAME, child.enterFrameHandler);
View
BIN test/swfs/flash_display_DisplayObjectContainer.swf
Binary file not shown.
View
3 test/swfs/flash_display_Graphics.as
@@ -1,15 +1,14 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf GraphicsTest,600,600 test/swfs/flash_display_Grahics.as
+ node utils/compileabc.js --swf GraphicsTest,600,600,60 -p test/swfs/flash_display_Graphics.as
*/
package {
import flash.display.Sprite;
public class GraphicsTest extends Sprite {
public function GraphicsTest() {
- stage.frameRate = 20;
var child:GraphicsObject = new GraphicsObject();
addChild(child);
}
View
BIN test/swfs/flash_display_Graphics.swf
Binary file not shown.
View
2 test/swfs/flash_display_InteractiveObject.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf InteractiveObjectTest,400,400 test/swfs/flash_display_InteractiveObject.as
+ node utils/compileabc.js --swf InteractiveObjectTest,400,400,60 -p test/swfs/flash_display_InteractiveObject.as
*/
package {
View
BIN test/swfs/flash_display_InteractiveObject.swf
Binary file not shown.
View
3 test/swfs/flash_display_Loader.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf LoaderTest,100,100,2 test/swfs/flash_display_Loader.as
+ node utils/compileabc.js --swf LoaderTest,100,100,10 -p test/swfs/flash_display_Loader.as
*/
package {
@@ -51,6 +51,7 @@ class CustomLoader extends Loader {
var openHandlerTicket = 0;
var progressHandlerTicket = 0;
var unloadHandlerTicket = 0;
+ var ioErrorHandlerTicket = 0;
private function completeHandler(event:Event):void {
trace("completeHandler: " + ticket);
View
BIN test/swfs/flash_display_Loader.swf
Binary file not shown.
View
3 test/swfs/flash_display_LoaderInfo.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf LoaderTest,100,100,2 test/swfs/flash_display_Loader.as
+ node utils/compileabc.js --swf LoaderInfoTest,100,100,10 -p test/swfs/flash_display_LoaderInfo.as
*/
package {
@@ -51,6 +51,7 @@ class CustomLoader extends Loader {
var openHandlerTicket = 0;
var progressHandlerTicket = 0;
var unloadHandlerTicket = 0;
+ var ioErrorHandlerTicket = 0;
private function completeHandler(event:Event):void {
trace("completeHandler: " + ticket);
View
BIN test/swfs/flash_display_LoaderInfo.swf
Binary file not shown.
View
2 test/swfs/flash_display_MovieClip.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf MovieClipTest,100,100,10 test/swfs/flash_display_MovieClip.as
+ node utils/compileabc.js --swf MovieClipTest,100,100,60 -p test/swfs/flash_display_MovieClip.as
*/
package {
View
BIN test/swfs/flash_display_MovieClip.swf
Binary file not shown.
View
2 test/swfs/flash_display_Shape.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf Shape,100,100,10 test/swfs/test_ShapeTest.as
+ node utils/compileabc.js --swf ShapeTest,100,100,60 -p test/swfs/flash_display_Shape.as
*/
package {
View
BIN test/swfs/flash_display_Shape.swf
Binary file not shown.
View
29 test/swfs/flash_display_SimpleButton.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf SimpleButtonTest,400,400,2 test/swfs/flash_display_SimpleButton.as
+ node utils/compileabc.js --swf SimpleButtonTest,400,400,10 -p test/swfs/flash_display_SimpleButton.as
*/
package {
@@ -22,20 +22,23 @@ import flash.events.*;
dynamic class SimpleButtonObject extends SimpleButton {
- var downShape, upShape, hitTestShape, overShape;
+ private var downShape:Shape;
+ private var upShape:Shape;
+ private var hitTestShape:Shape;
+ private var overShape:Shape;
public function SimpleButtonObject() {
- this.hitTestState = new Shape;
- this.hitTestState.graphics.drawRect(10, 10, 100, 100);
- this.downState = new Shape;
- this.downState.graphics.beginFill(0xFF0000);
- this.downState.graphics.drawRect(10, 10, 80, 80);
- this.upState = new Shape;
- this.upState.graphics.beginFill(0x00FF00);
- this.upState.graphics.drawRect(10, 10, 80, 80);
- this.overState = new Shape;
- this.overState.graphics.beginFill(0x0000FF);
- this.overState.graphics.drawRect(10, 10, 80, 80);
+ this.hitTestState = hitTestShape = new Shape;
+ hitTestShape.graphics.drawRect(10, 10, 100, 100);
+ this.downState = downShape = new Shape;
+ downShape.graphics.beginFill(0xFF0000);
+ downShape.graphics.drawRect(10, 10, 80, 80);
+ this.upState = upShape = new Shape;
+ upShape.graphics.beginFill(0x00FF00);
+ upShape.graphics.drawRect(10, 10, 80, 80);
+ this.overState = overShape = new Shape;
+ overShape.graphics.beginFill(0x0000FF);
+ overShape.graphics.drawRect(10, 10, 80, 80);
}
private function set_downState():void {
View
BIN test/swfs/flash_display_SimpleButton.swf
Binary file not shown.
View
3 test/swfs/flash_display_Stage.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf StageTest,600,600 test/swfs/flash_display_Stage.as
+ node utils/compileabc.js --swf StageTest,600,600,60 -p test/swfs/flash_display_Stage.as
*/
package {
@@ -12,7 +12,6 @@ package {
public class StageTest extends Sprite {
public var loader;
public function StageTest() {
- stage.frameRate = 20;
var child = new TestObject();
addChild(child);
child.stage.addEventListener(Event.ENTER_FRAME, child.enterFrameHandler);
View
BIN test/swfs/flash_display_Stage.swf
Binary file not shown.
View
3 test/swfs/flash_filters_BlurFilter.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf BlurFilterTest,600,600 test/swfs/flash_filters_BlurFilter.as
+ node utils/compileabc.js --swf BlurFilterTest,600,600,60 -p test/swfs/flash_filters_BlurFilter.as
*/
package {
@@ -13,7 +13,6 @@ package {
public class BlurFilterTest extends Sprite {
public var loader;
public function BlurFilterTest() {
- stage.frameRate = 20;
var child = new TestObject();
background(0xFFFFFF);
addEventListener(Event.ENTER_FRAME, child.enterFrameHandler);
View
BIN test/swfs/flash_filters_BlurFilter.swf
Binary file not shown.
View
3 test/swfs/flash_filters_DropShadowFilter.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf DropShadowFilterTest,600,600 test/swfs/flash_filters_DropShadowFilter.as
+ node utils/compileabc.js --swf DropShadowFilterTest,600,600,60 -p test/swfs/flash_filters_DropShadowFilter.as
*/
package {
@@ -13,7 +13,6 @@ package {
public class DropShadowFilterTest extends Sprite {
public var loader;
public function DropShadowFilterTest() {
- stage.frameRate = 30;
var child = new TestObject();
background(0xFFFFFF);
addEventListener(Event.ENTER_FRAME, child.enterFrameHandler);
View
BIN test/swfs/flash_filters_DropShadowFilter.swf
Binary file not shown.
View
3 test/swfs/flash_filters_GlowFilter.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf GlowFilterTest,600,600 test/swfs/flash_filters_GlowFilter.as
+ node utils/compileabc.js --swf GlowFilterTest,600,600,60 -p test/swfs/flash_filters_GlowFilter.as
*/
package {
@@ -13,7 +13,6 @@ package {
public class GlowFilterTest extends Sprite {
public var loader;
public function GlowFilterTest() {
- stage.frameRate = 30;
var child = new TestObject();
background(0xFFFFFF);
addEventListener(Event.ENTER_FRAME, child.enterFrameHandler);
View
BIN test/swfs/flash_filters_GlowFilter.swf
Binary file not shown.
View
2 test/swfs/flash_geom_ColorTransform.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf ColorTransformTest,100,100,10 test/swfs/flash_geom_ColorTransform.as
+ node utils/compileabc.js --swf ColorTransformTest,100,100,60 -p test/swfs/flash_geom_ColorTransform.as
*/
package {
View
BIN test/swfs/flash_geom_ColorTransform.swf
Binary file not shown.
View
4 test/swfs/flash_geom_Point.as
@@ -1,7 +1,7 @@
/* -*- Mode: java; indent-tabs-mode: nil -*- */
/*
Compiled with:
- java -jar utils/asc.jar -import playerglobal.abc -swf Class,100,100,2 test/swfs/flash_geom_Point.as
+ node utils/compileabc.js --swf PointTest,100,100,60 -p test/swfs/flash_geom_Point.as
*/
package {
@@ -20,7 +20,7 @@ package {
import flash.display.*;
import flash.events.*;
-import flash.net.*;
+import flash.geom.Point;
class TestObject extends Sprite {
private var bgColor: uint = 0xFFCC00;
View
BIN test/swfs/flash_geom_Point.swf
Binary file not shown.
View
BIN test/swfs/timeline/scene/Scene_1_MainTimeline.fla
Binary file not shown.
View
BIN test/swfs/timeline/scene/Scene_1_MainTimeline.swf
Binary file not shown.
View
BIN test/swfs/timeline/scene/Scene_2_MovieClipTimeline.fla
Binary file not shown.
View
BIN test/swfs/timeline/scene/Scene_2_MovieClipTimeline.swf
Binary file not shown.
View
4 utils/compileabc.js
@@ -120,7 +120,7 @@ ensureDir(build_dir);
var playerglobalPath = path.join(shumwayRoot, 'build/playerglobal/playerglobal-single.abc');
var builtinPath = path.join(shumwayRoot, 'src/avm2/generated/builtin/builtin.abc');
-var ascjar = './asc.jar';
+var ascjar = path.join(shumwayRoot, 'utils/asc.jar');
if (!outputPath) {
outputPath = files[files.length - 1];
@@ -207,7 +207,7 @@ function checkHashes() {
if (needsPlayerglobal) {
console.log('Verifing playerglobal-single.abc ...');
- var proc = spawn(process.argv[0], ['single'], {cwd: 'playerglobal-builder', stdio: 'inherit'} );
+ var proc = spawn(process.argv[0], ['single'], {cwd: path.join(shumwayRoot, 'utils/playerglobal-builder'), stdio: 'inherit'} );
proc.on('close', function (code) {
if (code !== 0 || !fs.existsSync(playerglobalPath)) {
console.log('Error during playerglobal-single.abc build');

0 comments on commit 6e3c7d3

Please sign in to comment.