forked from nwjs/nw.js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b1eecf
commit 55a4d63
Showing
13 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var os = require('os'); | ||
var path = require('path'); | ||
var exec = require('child_process').exec; | ||
var spawn = require('child_process').spawn; | ||
describe('nw in memory after quiting',function(){ | ||
it('nw.exe should not be in memory after gui.App.quit is called on windows',function(done){ | ||
this.timeout(0); | ||
if(os.platform() == "win32") { | ||
var app = spawn(process.execPath, [path.join(global.tests_dir,'nw-in-mem/package')]) | ||
app.on('close',function(){ | ||
var nwname = "nw.exe"; | ||
var nwcount = 0; | ||
exec("tasklist", function(err, stdout, stderr) { | ||
if(err){ return console.log(err); } | ||
stdout.split('\n').filter(function(line){ | ||
var p=line.trim().split(/\s+/),pname=p[0]; | ||
if(pname.toLowerCase().indexOf(nwname)>=0) | ||
nwcount++; | ||
}); | ||
|
||
if(nwcount == 2) | ||
done(); | ||
else if(nwcount > 2) | ||
done('nw.exe is still in memory after the quit of app'); | ||
}) | ||
}); | ||
} | ||
else | ||
done(); | ||
}) | ||
}) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
<title>Veille</title> | ||
|
||
<!-- Allow fullscreen mode on iOS devices. (These are Apple specific meta tags.) --> | ||
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" /> | ||
<meta name="apple-mobile-web-app-capable" content="yes" /> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
<meta name="HandheldFriendly" content="true" /> | ||
|
||
<!-- All margins and padding must be zero for the canvas to fill the screen. --> | ||
<style type="text/css"> | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
body { | ||
background: #000; | ||
color: #fff; | ||
overflow: hidden; | ||
-ms-touch-action: none; | ||
} | ||
canvas { | ||
-ms-touch-action: none; | ||
} | ||
</style> | ||
|
||
|
||
</head> | ||
|
||
<body> | ||
<div id="fb-root"></div> | ||
|
||
<!-- The canvas must be inside a div called c2canvasdiv --> | ||
<div id="c2canvasdiv"> | ||
|
||
<!-- The canvas the project will render to. If you change its ID, don't forget to change the | ||
ID the runtime looks for in the jQuery events above (ready() and cr_sizeCanvas()). --> | ||
<canvas id="c2canvas" width="800" height="600"></canvas> | ||
|
||
</div> | ||
|
||
<!-- For node-webkit to show file dialogs --> | ||
<input style="display:none;" id="c2nwOpenFileDialog" type="file" /> | ||
<input style="display:none;" id="c2nwChooseFolderDialog" type="file" nwdirectory /> | ||
<input style="display:none;" id="c2nwSaveDialog" type="file" nwsaveas /> | ||
|
||
<!-- Pages load faster with scripts at the bottom --> | ||
|
||
<!-- Construct 2 exported games require jQuery. --> | ||
<script src="jquery-2.0.0.min.js"></script> | ||
|
||
|
||
|
||
<!-- The runtime script. You can rename it, but don't forget to rename the reference here as well. | ||
This file will have been minified and obfuscated if you enabled "Minify script" during export. --> | ||
<script src="c2runtime.js"></script> | ||
|
||
<script> | ||
window["c2nodewebkit"] = true; | ||
window["nwgui"] = require("nw.gui"); | ||
|
||
// Uncomment to show dev tools on startup | ||
//window["nwgui"].Window.get().showDevTools(); | ||
|
||
// Size the canvas to fill the browser viewport. | ||
jQuery(window).resize(function() { | ||
cr_sizeCanvas(jQuery(window).width(), jQuery(window).height()); | ||
}); | ||
|
||
// Start the Construct 2 project running on window load. | ||
jQuery(document).ready(function () | ||
{ | ||
// Create new runtime using the c2canvas | ||
cr_createRuntime("c2canvas"); | ||
|
||
window["nwgui"].Window.get().show(); | ||
}); | ||
|
||
// Pause and resume on page becoming visible/invisible | ||
function onVisibilityChanged() { | ||
if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden) | ||
cr_setSuspended(true); | ||
else | ||
cr_setSuspended(false); | ||
}; | ||
|
||
document.addEventListener("visibilitychange", onVisibilityChanged, false); | ||
document.addEventListener("mozvisibilitychange", onVisibilityChanged, false); | ||
document.addEventListener("webkitvisibilitychange", onVisibilityChanged, false); | ||
document.addEventListener("msvisibilitychange", onVisibilityChanged, false); | ||
window["nwgui"].Window.get().on('loaded', function() { | ||
setTimeout(function() { | ||
simulateClick(); | ||
}, 1000); | ||
}); | ||
function simulateClick() { | ||
var evt = new Event('mousedown'); | ||
document.dispatchEvent(evt); | ||
} | ||
|
||
</script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"main": "index.html", | ||
"name": "Veille", | ||
"description": "Ecran de veille NW/C2", | ||
"version": "1.1", | ||
"window": { | ||
"icon": "logo.png", | ||
"toolbar": false, | ||
"width": 800, | ||
"height": 600, | ||
"position": "center", | ||
"show": false | ||
}, | ||
"dom_storage_quota": 50, | ||
"user-agent": "Mozilla/5.0 (%osinfo) AppleWebKit/%webkit_ver (KHTML, like Gecko, Chrome, Safari) NodeWebkit/%nwver", | ||
"chromium-args": "--disable-extensions --disable-plugins --disable-internal-flash --disable-popup-blocking --enable-gamepad --enable-html5-camera --allow-file-access-from-files" | ||
} |