Merge "Added PixelBuffer for image loading and operations." into devel/master
[platform/core/uifw/dali-adaptor.git] / adaptors / emscripten / wrappers / tests / signals.js
1
2 QUnit.module("Signals", {
3     setup : function() {
4         QUnit.stop();
5         var that = this;
6         this.cb = function(e) {
7           QUnit.ok(true, "Scene loaded");
8           var iframe = document.getElementById('daliframe');
9           that.doc =  iframe.contentDocument || iframe.contentWindow.document;
10           that.doc.Module.postDaliWrapperRun = function() {
11             dali = that.doc.Module;
12             QUnit.start();
13           };
14         };
15         loadDocument("dali-page.html"+window.location.search, this.cb);
16     },
17     teardown : function() {
18         var v = document.getElementById("daliframe");
19         v.removeEventListener("load", this.cb, true);
20     }
21 });
22
23 QUnit.test( "hello test", function( assert ) {
24   var done = false;
25
26   function onStage() {
27     done = true;
28   }
29
30   var actor = new dali.Actor();
31   actor.parentOrigin = [0.5, 0.5, 0.5];
32   actor.anchorPoint = [0.5, 0.5, 0.5];
33   actor.text = "actor";
34   actor.name = actor.text;
35   actor.size = [100, 100, 1];
36   actor.position = [0, 0, 10];
37
38   actor.connect("onStage", onStage);
39
40   dali.stage.add(actor);
41
42   dali.updateFrame();
43
44   assert.ok(done === true);
45
46 });