]> khamidou — GitHub mirrors - electron.git/commitdiff
Hide window when running in CI.
authorCheng Zhao <zcbenz@gmail.com>
Wed, 21 Aug 2013 03:35:39 +0000 (11:35 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 21 Aug 2013 03:41:08 +0000 (11:41 +0800)
spec/index.html
spec/main.js

index eb40fc7e3740864d85abc5a18ba92c4911ff0349..45d7edeeccee2ef61b271a73267501e69da95f38 100644 (file)
@@ -8,6 +8,16 @@
 
 <script type="text/javascript" charset="utf-8">
 (function() {
+  // Check if we are running in CI.
+  var argv = require('remote').process.argv;
+  var isCi = argv[1] == '--ci';
+
+  if (!isCi) {
+    var win = require('remote').getCurrentWindow();
+    win.show();
+    win.focus();
+  }
+
   // Show DevTools.
   document.oncontextmenu = function(e) {
     require('remote').getCurrentWindow().inspectElement(e.clientX, e.clientY);
   var Mocha = require('mocha');
 
   var mocha = new Mocha();
-  mocha.ui('bdd').reporter('html');
+  mocha.ui('bdd').reporter(isCi ? 'tap' : 'html');
 
   var query = Mocha.utils.parseQuery(window.location.search || '');
   if (query.grep) mocha.grep(query.grep);
   if (query.invert) mocha.invert();
 
-  // Check if we are running in CI.
-  var argv = require('remote').process.argv;
-  var isCi = false;
-  if (argv[1] == '--ci') {
-    isCi = true;
-    mocha.reporter('tap');
-  }
-
   // Read all test files.
   var walker = require('walkdir').walk(__dirname);
 
index 7947bc063be1c3b6046831fe86891b6a77720590..6c2669355ca582090c0b0536fbc134a985060b17 100644 (file)
@@ -33,9 +33,9 @@ app.on('window-all-closed', function() {
 app.on('finish-launching', function() {
   window = new BrowserWindow({
     title: 'atom-shell tests',
+    show: false,
     width: 800,
     height: 600
   });
   window.loadUrl('file://' + __dirname + '/index.html');
-  window.focus();
 });