Skip to content

Commit 9237e4d

Browse files
committed
Merge pull request nwjs#1267 from kingFighter/crash_dump_test
[test] fix crashBrowser case
2 parents f090bd3 + a39a02c commit 9237e4d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

tests/automatic_tests/after_close_previous_window_then_open_new/mocha_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var fs_extra = require('fs-extra');
66
var spawn = require('child_process').spawn;
77
var result;
88

9-
describe('afterpp close previous window then open new', function() {
9+
describe('after close previous window then open new', function() {
1010
after(function () {
1111
fs_extra.remove('./automatic_tests/after_close_previous_window_then_open_new/tmp', function (er) {
1212
if (er) throw er;

tests/automatic_tests/crash_dump/mocha_test.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ var fs = require('fs');
55
var fs_extra = require('fs-extra');
66
var results;
77
describe('crash dump', function() {
8-
8+
before(function(done) {
9+
fs.mkdirSync('./automatic_tests/crash_dump/tmp');
10+
done();
11+
});
12+
913
after(function () {
10-
fs_extra.remove('./automatic_tests/crash_dump/tmp', function (er) {
14+
fs_extra.remove('./automatic_tests/crash_dump/tmp', function (er) {
1115
if (er) throw er;
12-
});
16+
});
1317
});
1418

1519
describe('crashBrowser()', function() {
@@ -20,8 +24,10 @@ describe('crash dump', function() {
2024
appPath: path.join(global.tests_dir, 'crash_dump'),
2125
args:[0],
2226
end: function(data, app) {
23-
result = fs.readdirSync('./automatic_tests/crash_dump/tmp');
24-
done();
27+
setTimeout(function() {
28+
result = fs.readdirSync('./automatic_tests/crash_dump/tmp');
29+
done();
30+
}, 2000);
2531
}
2632
});
2733
});

0 commit comments

Comments
 (0)