Skip to content

Commit a0de620

Browse files
committed
Merge pull request nwjs#1408 from kingFighter/test_#1391
[test] test case for fast open&close devtools from nwjs#1391
2 parents 8d93f37 + fb73009 commit a0de620

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Test Case For Fast Open&Close Devtools Crashes</title>
6+
</head>
7+
<body>
8+
<script type="text/javascript">
9+
var win = require('nw.gui').Window.get();
10+
win.showDevTools();
11+
win.closeDevTools();
12+
win.showDevTools();
13+
var gui = require('nw.gui');
14+
gui.App.quit();
15+
</script>
16+
</body>
17+
</html>
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 assert = require('assert');
3+
var spawn = require('child_process').spawn;
4+
var result = false;
5+
describe('Fast open&close devtools from #1391', function() {
6+
before(function(done) {
7+
this.timeout(0);
8+
var app = spawn(process.execPath, [path.join(global.tests_dir, 'fast_open_and_close_devtools')]);
9+
app.on('exit', function(code) {
10+
if (code != null)
11+
result = true;
12+
done();
13+
});
14+
});
15+
16+
it('should not crash', function() {
17+
assert.equal(result, true);
18+
});
19+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "nw",
3+
"main": "index.html"
4+
}

0 commit comments

Comments
 (0)