Skip to content

Commit

Permalink
Merge pull request #1408 from kingFighter/test_#1391
Browse files Browse the repository at this point in the history
[test] test case for fast open&close devtools from #1391
  • Loading branch information
rogerwang committed Dec 22, 2013
2 parents 8d93f37 + fb73009 commit a0de620
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/automatic_tests/fast_open_and_close_devtools/index.html
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Test Case For Fast Open&Close Devtools Crashes</title>
</head>
<body>
<script type="text/javascript">
var win = require('nw.gui').Window.get();
win.showDevTools();
win.closeDevTools();
win.showDevTools();
var gui = require('nw.gui');
gui.App.quit();
</script>
</body>
</html>
19 changes: 19 additions & 0 deletions tests/automatic_tests/fast_open_and_close_devtools/mocha_test.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,19 @@
var path = require('path');
var assert = require('assert');
var spawn = require('child_process').spawn;
var result = false;
describe('Fast open&close devtools from #1391', function() {
before(function(done) {
this.timeout(0);
var app = spawn(process.execPath, [path.join(global.tests_dir, 'fast_open_and_close_devtools')]);
app.on('exit', function(code) {
if (code != null)
result = true;
done();
});
});

it('should not crash', function() {
assert.equal(result, true);
});
});
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "nw",
"main": "index.html"
}

0 comments on commit a0de620

Please sign in to comment.