~ubuntu-branches/ubuntu/karmic/gnash/karmic

« back to all changes in this revision

Viewing changes to testsuite/misc-swfc.all/movieclip_destruction_test3.sc

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-03-05 18:09:23 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080305180923-w5qdihnavdgn3k6x
Tags: 0.8.2-0ubuntu1
* package 0.8.2 release (Freeze exception, LP: #195443)
* drop pkglibs that don't exist anymore from gnash-common.install
  and add new libgnashmedia-*.so to package
  - update debian/gnash-common.install
* update binaries installed by gnash-tools.install: drop usr/bin/gparser
  and add usr/bin/soldumper as well as usr/bin/dumpshm
  - update debian/gnash-tools.install
* disable tests by configure flags and drop obsolete disable-testsuite
  patch
  - update debian/rules
  - drop debian/patches/disable-testsuite
  - update debian/patches/series
* run make install-plugins to install the plugins and use /usr/lib/gnash
  as --with-npapi-plugindir= in during configure
  - update debian/rules
* unfold Build-Depends: to multi-line layout to improve readability/
  diffability
  - update debian/control
* support firefox 3 and xulrunner 1.9 by setting gnash plugin up as
  xulrunner-addons alternative
  - update debian/mozilla-plugin-gnash.postinst

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 
3
 * 
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 3 of the License, or
 
7
 * (at your option) any later version.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program; if not, write to the Free Software
 
15
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
16
 *
 
17
 */ 
 
18
 
 
19
/*
 
20
 * Zou Lunkai, zoulunkai@gmail.com
 
21
 * 
 
22
 * Test destruction of nested movieClips.
 
23
 *
 
24
 * Description:
 
25
 *   frame2: Define a nested movieclip mc1(mc1.mc11.mc111.mc111)
 
26
 *   frame3: attach the nested movieclip to stage with a name 'nestedMovieClip'
 
27
 *   frame10: nestedMovieClip get removed by one of its child(mc111)
 
28
 *   
 
29
 * Expected behaviour:
 
30
 *   TODO: add it here.
 
31
 * 
 
32
 */
 
33
 
 
34
 
 
35
.flash  bbox=800x600 filename="movieclip_destruction_test3.swf" background=white version=7 fps=12
 
36
 
 
37
.frame 1
 
38
  .action:
 
39
   #include "Dejagnu.sc"
 
40
   _root.as_order = '0+';
 
41
  .end
 
42
  
 
43
  // Define 3 shapes(b1, b2, b3)
 
44
  .box green_square fill=green width=100 height=100  
 
45
 
 
46
.frame 2
 
47
  
 
48
  .sprite mc1111 
 
49
    .frame 1 
 
50
      .put green_square x=300 y=300
 
51
    .frame 8
 
52
      .action:
 
53
        _root.x = 400;
 
54
        _root.as_order += '1+';
 
55
      .end
 
56
  .end 
 
57
  
 
58
  .sprite mc111 
 
59
    .frame 1  
 
60
      .put mc1111 
 
61
    .frame 8
 
62
      .action:
 
63
        _root.note("nestedMovieClip removed at frame " + _root._currentframe);
 
64
        _root.x = 300;
 
65
        _root.as_order += '2+';
 
66
        _parent._parent['removeMovieClip']();
 
67
        _root.note("actions here should not be executed");
 
68
         _root.x = 'as_should_be_discarded';
 
69
      .end
 
70
  .end
 
71
  
 
72
  .sprite mc11
 
73
    .frame 1  
 
74
      .put mc111 
 
75
    .frame 8
 
76
      .action:
 
77
        _root.x = 200;
 
78
        _root.as_order += '3+';
 
79
      .end
 
80
    
 
81
  .end
 
82
  
 
83
  .sprite mc1
 
84
    .frame 1 
 
85
      .put mc11 
 
86
    .frame 8
 
87
      .action:
 
88
        _root.x = 100;
 
89
        _root.as_order += '4+';
 
90
      .end
 
91
  .end
 
92
  
 
93
  
 
94
.frame 3
 
95
  .action:
 
96
    _root.attachMovie("mc1", "nestedMovieClip", 10);
 
97
    check_equals(typeof(nestedMovieClip), 'movieclip');
 
98
    check_equals(nestedMovieClip.getDepth(), 10);
 
99
    check_equals(typeof(nestedMovieClip.mc11), 'movieclip');
 
100
    check_equals(typeof(nestedMovieClip.mc11.mc111), 'movieclip');
 
101
    check_equals(typeof(nestedMovieClip.mc11.mc111.mc1111), 'movieclip');
 
102
  .end
 
103
 
 
104
#define DEFINE_ONUNLOAD
 
105
#ifdef DEFINE_ONUNLOAD
 
106
  .action:
 
107
    // Define onUnload(for deduction)
 
108
     nestedMovieClip.onUnload = function () {};
 
109
     nestedMovieClip.mc11.mc111.onUnload = function () {};
 
110
     nestedMovieClip.mc11.mc111.mc1111.onUnload = function () {};
 
111
  .end
 
112
 
 
113
.frame 10
 
114
  .action:
 
115
    // Check 'nestedMovieClip' has unloaded but not destroyed
 
116
     check_equals(nestedMovieClip.getDepth(), -32779);
 
117
  .end
 
118
#endif 
 
119
 
 
120
 
 
121
.frame 12
 
122
  .action:  
 
123
    check_equals(_root.x, 300);
 
124
    check_equals(typeof(nestedMovieClip), 'undefined');
 
125
    check_equals(_root.as_order, "0+1+2+");
 
126
  .end
 
127
 
 
128
 
 
129
.frame 15
 
130
  .action:
 
131
    _root.createEmptyMovieClip("mcA", 10);
 
132
    mcARef = mcA;
 
133
    mcA.onUnload = function () {
 
134
      _root.check_equals(mcA['_root'], _level0);
 
135
    };
 
136
    mcA['removeMovieClip']();
 
137
    _root.check_equals(mcARef.getDepth(), -32779);
 
138
    _root.check_equals(mcARef['_root'], _level0);
 
139
  .end
 
140
 
 
141
.frame 16
 
142
  .action:  
 
143
    stop();
 
144
    totals(12);
 
145
  .end
 
146
 
 
147
.end
 
148