Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90abcc8

Browse files
committed
Merge pull request nwjs#658 from owenc4a4/test
[Test] fix bug of some test, add test case for nwjs#655
2 parents ec27874 + 5904672 commit 90abcc8

5 files changed

Lines changed: 19 additions & 14 deletions

File tree

tests/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
## Prerequisite
22

3-
node-webkit didn't ship third party node modules required for testing, you
4-
need to install them. We use `nw-gyp` to build native modules. So please run this:
3+
* node-webkit didn't ship third party node modules required for testing, you
4+
need to install them.
5+
* We use `nw-gyp` to build native modules.
6+
* We have test case that needs a http server e.g. apache. Please open port 80 and 8080 then put `tests/automatic_tests/node-remote/node_remote_test.html`to the http server document root.
7+
8+
So please run this:
59

610
````bash
711
$ npm install -g nw-gyp
@@ -20,11 +24,11 @@ $ /path-to-node-webkit src/content/nw/tests
2024
## Command line options
2125

2226
$ /path-to-node-webkit src/content/nw/tests --help
23-
27+
2428
Usage: nw-test [options]
25-
29+
2630
Options:
27-
31+
2832
-h, --help output usage information
2933
-V, --version output the version number
3034
-S, --silent hide the browser window and quit when done (run silently)

tests/manual_tests/menu/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<head>
3-
<script type="text/javascript" src="../zepto.min.js"></script>
4-
<script type="text/javascript" src="../assert.js"></script>
3+
<script type="text/javascript" src="../../zepto.min.js"></script>
4+
<script type="text/javascript" src="../../assert.js"></script>
55
</head>
66
<body>
77
<script>
@@ -176,13 +176,13 @@
176176
document.body.appendChild(element);
177177
}
178178
}));
179-
179+
180180
sub1.append(new gui.MenuItem({
181181
type: 'checkbox',
182182
checked: true, //<------------------------------------------------!!!!!!
183183
label: 'Test CheckBox'
184184
}));
185-
185+
186186
var sub2 = new gui.Menu();
187187
sub2.append(new gui.MenuItem({
188188
label: 'Test2',
@@ -199,7 +199,7 @@
199199
gc();
200200
</script>
201201
<script>
202-
document.body.addEventListener('contextmenu', function(ev) {
202+
document.body.addEventListener('contextmenu', function(ev) {
203203
ev.preventDefault();
204204
menu.popup(ev.x, ev.y);
205205
return false;

tests/manual_tests/test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h2>file dialog</h2>
3737
var list = document.getElementsByName('file');
3838
for (var i = 0; i < list.length; i++) {
3939
if (process.platform == 'win32') {
40-
list[i].nwworkingdir = dir_win;
40+
list[i].nwworkingdir = dir_win[i];
4141
} else {
4242
list[i].nwworkingdir = dir_unix[i];
4343
}

tests/manual_tests/tray/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<head>
3-
<script type="text/javascript" src="../zepto.min.js"></script>
4-
<script type="text/javascript" src="../assert.js"></script>
3+
<script type="text/javascript" src="../../zepto.min.js"></script>
4+
<script type="text/javascript" src="../../assert.js"></script>
55
</head>
66
<body>
77
<script>

tests/manual_tests/window/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
<button onclick="win.setResizable(true)">setResizable(true)</button>
8484
<button onclick="win.setResizable(false)">(false)</button>
8585
<br/>
86-
<button onclick="win.setAlwaysOnTop(true)">setAlwaysOnTop(true)</button>
86+
<p>Focus another application within 2sec, popup window should on top.</p>
87+
<button onclick="setTimeout(function(){win.setAlwaysOnTop(true);},2000)">setAlwaysOnTop(true)</button>
8788
<button onclick="win.setAlwaysOnTop(false)">(false)</button>
8889
<br/>
8990
<button onclick="win.zoomLevel = 2">set zoomLevel to 2</button>

0 commit comments

Comments
 (0)