Skip to content

Commit 02d78f4

Browse files
committed
Merge pull request nwjs#401 from owenc4a4/test
test case for plugin nwjs#399
2 parents 5cb3c14 + 2e728f1 commit 02d78f4

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3+
<head>
4+
<title>SWFObject - step 1</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
6+
</head>
7+
<body>
8+
<div>
9+
10+
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
11+
<param name="movie" value="relog.swf" />
12+
<!--[if !IE]>-->
13+
<object type="application/x-shockwave-flash" data="relog.swf" width="780" height="420">
14+
<!--<![endif]-->
15+
<p>Alternative content</p>
16+
<!--[if !IE]>-->
17+
</object>
18+
<!--<![endif]-->
19+
20+
21+
<script>
22+
var gui = require('nw.gui');
23+
var result = { ok: true };
24+
25+
var client = require('../../../nw_test_app').createClient({
26+
argv: gui.App.argv,
27+
data: result,
28+
});
29+
30+
</script>
31+
32+
</object>
33+
</div>
34+
</body>
35+
</html>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"main": "index.html",
3+
"name": "nw-demo",
4+
"description": "demo app of node-webkit",
5+
"version": "0.1",
6+
"keywords": [ "demo", "node-webkit" ],
7+
"window": {
8+
"toolbar": true,
9+
"width": 800,
10+
"height": 500,
11+
"position": "mouse",
12+
"min_width": 400,
13+
"min_height": 200,
14+
"max_width": 800,
15+
"max_height": 600
16+
},
17+
"webkit": {
18+
"plugin": true
19+
}
20+
}
1.78 KB
Binary file not shown.

tests/app_tests/plugin/mocha_test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var path = require('path');
2+
var app_test = require('./nw_test_app');
3+
4+
describe('Plugin', function() {
5+
describe('flash', function(){
6+
it('should not crash', function(done) {
7+
8+
setTimeout(function(){ done('nw crash.')}, 1800);
9+
var child = app_test.createChildProcess({
10+
execPath: process.execPath,
11+
appPath: path.join('app_tests', 'plugin', 'flash'),
12+
end: function(data, app) {
13+
done();
14+
app.kill();
15+
}
16+
});
17+
})
18+
})
19+
})

0 commit comments

Comments
 (0)