-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1408 from kingFighter/test_#1391
[test] test case for fast open&close devtools from #1391
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
tests/automatic_tests/fast_open_and_close_devtools/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
19
tests/automatic_tests/fast_open_and_close_devtools/mocha_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |||
}); | |||
}); |
4 changes: 4 additions & 0 deletions
4
tests/automatic_tests/fast_open_and_close_devtools/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
{ | |||
"name": "nw", | |||
"main": "index.html" | |||
} |