annotate _test/Test/Web/View.pm @ 191:78a18a2b6266

IMPL::Web::View improvements (unstable)
author cin
date Thu, 05 Apr 2012 17:51:51 +0400
parents cd1ff7029a63
children 4d0e1962161c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
1 package Test::Web::View;
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
2 use IMPL::Profiler::Memory;
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
3 use strict;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
4 use warnings;
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
5 use utf8;
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
6
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
7 use parent qw(IMPL::Test::Unit);
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
8 __PACKAGE__->PassThroughArgs;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
9
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
10 use File::Slurp;
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
11 use Scalar::Util qw(weaken);
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
12
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
13 use IMPL::Test qw(assert test GetCallerSourceLine);
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
14 use IMPL::Web::View::TTLoader();
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
15
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
16 use constant {
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
17 TTLoader => typeof IMPL::Web::View::TTLoader,
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
18 MProfiler => 'IMPL::Profiler::Memory'
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
19 };
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
20
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
21 sub AssertMemoryLeak {
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
22 my $code = shift;
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
23 my $dump = shift;
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
24
190
cd1ff7029a63 IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
cin
parents: 189
diff changeset
25 my $data = MProfiler->Monitor($code);
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
26
189
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
27 if ($data->isLeak and $dump) {
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
28 write_file("dump.out", { binmode => ':utf8' }, $data->Dump() );
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
29 }
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
30
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
31 assert( not($data->isLeak), "Memory leak detected", GetCallerSourceLine() , @{$data->{objects}} );
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
32 }
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
33
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
34 sub templatesDir {
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
35 $_[0]->GetResourceDir('Resources','TTView');
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
36 }
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
37
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
38 sub CreateLoader {
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
39 my ($this) = @_;
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
40
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
41 my $loader = TTLoader->new(
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
42 {
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
43 INCLUDE_PATH => [
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
44 $this->templatesDir
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
45 ],
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
46 INTERPOLATE => 1,
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
47 POST_CHOMP => 1,
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
48 ENCODING => 'utf-8'
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
49 },
184
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
50 ext => '.tt',
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
51 initializer => 'global.tt'
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
52 );
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
53 }
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
54
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
55 test TTLoaderTests => sub {
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
56 my ($this) = @_;
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
57
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
58 my $loader = $this->CreateLoader();
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
59
184
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
60 # test the loader to be able to find a desired resource
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
61 assert( defined($loader->template('simple') ) );
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
62
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
63 # loader should be initialized on demand
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
64 assert( not $loader->isInitialized );
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
65
184
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
66 # loader should be able to load a document
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
67 my $doc = $loader->document('simple');
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
68 assert(defined $doc);
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
69
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
70 assert( $loader->isInitialized );
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
71 assert( $loader->context->stash->get('user') eq 'test_user');
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
72
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
73 # document should inherit loader's context
7525ea9a071a IMPL::Web::View::TTLoader tests
sergey
parents: 183
diff changeset
74 assert( $doc->context->stash->get('user') eq 'test_user');
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
75
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
76 # document should not have 'this' template variable
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
77 assert( not $doc->templateVars('this') );
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
78
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
79 assert( $doc->context != $loader->context); # document should have an own context
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
80 };
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
81
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
82 test TTDocumentTests => sub {
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
83 my ($this) = @_;
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
84 my $loader = $this->CreateLoader();
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
85
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
86 my $doc = $loader->document('simple');
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
87
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
88 assert(defined $doc);
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
89
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
90 assert($doc->nodeName eq 'document');
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
91 assert(not $doc->can('notexists')); # autoloaded property should be ignored
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
92 assert(not defined $doc->notexists); # nonexisting property
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
93 assert($doc->template->version == 10); # static metadata
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
94 assert($doc->templateVars('notexists') eq ''); #nonexisting template variable
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
95 assert($doc->templateVars('user') eq 'test_user'); # global data
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
96 assert($doc->templateVars('templateVar') eq 'initialized by the constructor'); # defined in CTOR block
185
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
97
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
98 my $text = $doc->Render();
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
99 my $expected = read_file($this->GetResourceFile('Resources','TTView.Output','simple.txt'), binmode => ':utf8');
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
100
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
101 assert($text eq $expected, "Bad Render() output","Got: $text", "Expected: $expected");
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
102
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
103 };
ae8072f2f2a3 IMPL::Web::View::TTDocument tests, fixes
cin
parents: 184
diff changeset
104
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
105 test TTControlTests => sub {
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
106 my ($this) = @_;
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
107
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
108 my $loader = $this->CreateLoader();
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
109
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
110 my $doc = $loader->document('simple');
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
111
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
112 assert(defined $doc);
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
113
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
114 my $factory = $doc->require('My/Org/Panel');
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
115
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
116 assert(defined $factory);
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
117
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
118
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
119 assert($factory->context->stash != $doc->context->stash);
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
120
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
121 assert($factory == $doc->require('My/Org/Panel'), "Control should be loaded only once");
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
122
191
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
123 my $ctl = $factory->new('information', { visualClass => 'simple', data => ['one','two','hello world'] } );
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
124
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
125 assert(defined $ctl);
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
126
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
127 assert($ctl->nodeName eq 'information', "Created control should have a name", "Got: ".$ctl->nodeName, "Expected: information");
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
128
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
129 assert($ctl->nodeProperty('visualClass') eq 'simple');
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
130
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
131 assert($factory->instances == 1);
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
132
189
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
133 $doc->appendChild($ctl);
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
134
191
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
135 assert($doc->templateVars('dojo.require'));
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
136 assert(ref $doc->templateVars('dojo.require') eq 'ARRAY');
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
137 assert($doc->templateVars('dojo.require')->[0] eq 'dijit.form.Input' );
190
cd1ff7029a63 IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
cin
parents: 189
diff changeset
138
cd1ff7029a63 IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
cin
parents: 189
diff changeset
139 my $text = $ctl->Render();
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
140
191
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
141 my $expected = read_file($this->GetResourceFile('Resources', 'TTView.Output', 'Panel.txt'), binmode => ':utf8');
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
142 assert($text eq $expected, '$ctl->Render(): Bad output', "Got: $text", "Expected: $expected");
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
143
191
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
144
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
145
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
146 };
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
147
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
148 test TestDocumentLayout => sub {
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
149 my ($this) = @_;
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
150
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
151 my $loader = $this->CreateLoader();
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
152
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
153 my $doc = $loader->document('complex');
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
154 assert($doc->layout eq 'Layout/default');
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
155
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
156 my $expected = read_file($this->GetResourceFile('Resources', 'TTView.Output', 'complex.default.txt'), binmode => ':utf8' );
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
157
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
158 assert($doc->templateVars('dojo.require')->[0]);
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
159
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
160 my $text = $doc->Render({ data => [qw(one two three)] });
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
161
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
162 assert($text eq $expected, '$doc->Render(): Bad output', "Got: $text", "Expected: $expected");
186
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
163 };
6c0fee769b0c IMPL::Web::View::TTControl tests, fixes
cin
parents: 185
diff changeset
164
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
165 test TestMemoryLeaks => sub {
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
166 my ($this) = @_;
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
167
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
168 my $loader = $this->CreateLoader();
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
169 $loader->document('simple'); # force loader initialization
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
170
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
171 AssertMemoryLeak(sub {
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
172 my $doc = $loader->document('simple');
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
173 });
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
174
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
175 AssertMemoryLeak(sub {
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
176 my $doc = $loader->document('simple');
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
177 $doc->Render( { self => $doc } );
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
178 });
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
179
191
78a18a2b6266 IMPL::Web::View improvements (unstable)
cin
parents: 190
diff changeset
180 $loader->template('Layout/default');
189
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
181 $loader->template('My/Org/Panel');
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
182 $loader->template('My/Org/TextPreview');
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
183 AssertMemoryLeak(sub {
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
184 my $doc = $loader->document('simple');
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
185 my $factory = $doc->require('My/Org/Panel');
189
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
186 my $ctl = $doc->AppendChild($factory->new('information', { visualClass => 'complex' }) );
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
187 });
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
188
189
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
189 $loader->template('complex');
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
190 AssertMemoryLeak(sub {
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
191 my $doc = $loader->document('complex');
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
192 $doc->Render();
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
193 },'dump');
08015e2803f1 IMPL::Vew::Web - fixed memory leaks, more tests
cin
parents: 188
diff changeset
194
188
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
195 };
029c9610528c Memory leak tests in IMPL::Web::View
cin
parents: 186
diff changeset
196
183
2184fa28b49e IMPL::Web::View::TTLoader tests
cin
parents:
diff changeset
197 1;