Permalink
Browse files

Merge pull request #1408 from kingFighter/test_#1391

[test] test case for fast open&close devtools from #1391
  • Loading branch information...
2 parents 8d93f37 + fb73009 commit a0de620c94cf50dac2e76e5f0fbf7becd5acad63 @rogerwang rogerwang committed Dec 22, 2013
@@ -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>
@@ -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);
+ });
+});
@@ -0,0 +1,4 @@
+{
+ "name": "nw",
+ "main": "index.html"
+}

0 comments on commit a0de620

Please sign in to comment.