From feff3f923070bb001d40844a7ba8412992775fd6 Mon Sep 17 00:00:00 2001
From: libm
Date: Tue, 29 Apr 2014 22:43:15 +0800
Subject: [PATCH 001/487] Return non-zero when error to inform ninja of the
failure.
---
tools/package_binaries.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/package_binaries.py b/tools/package_binaries.py
index 6122aac774..0ffdda01db 100755
--- a/tools/package_binaries.py
+++ b/tools/package_binaries.py
@@ -26,11 +26,11 @@
tmp = sys.argv[sys.argv.index('-p') + 1]
if not os.path.isabs(tmp):
print 'the path is not an absolute path.\n'
- exit()
+ exit(-1)
if not os.path.exists(tmp):
print 'the directory does not exist.\n'
- exit()
+ exit(-1)
project_root = tmp
@@ -50,27 +50,27 @@
if platform_name == 'linux' and not os.path.exists(
os.path.join(project_root, 'nw')):
print 'nw file does not exist.\n'
- exit()
+ exit(-1)
if platform_name == 'win' and not os.path.exists(
os.path.join(project_root, 'nw.exe')):
print 'nw file does not exist.\n'
- exit()
+ exit(-1)
if platform_name == 'osx' and not os.path.exists(
os.path.join(project_root, 'node-webkit.app')):
print 'nw file does not exist.\n'
- exit()
+ exit(-1)
if platform_name != 'win' and not os.path.exists(
os.path.join(project_root, 'chromedriver2_server')):
print 'chromedriver2_server file does not exist.\n'
- exit()
+ exit(-1)
if platform_name == 'win' and not os.path.exists(
os.path.join(project_root, 'chromedriver2_server.exe')):
print 'chromedriver2_server file does not exist.\n'
- exit()
+ exit(-1)
required_file_linux = (
From 22e3610734976be030074b48d2ce79ec1efa4d79 Mon Sep 17 00:00:00 2001
From: libm
Date: Wed, 30 Apr 2014 13:01:43 +0800
Subject: [PATCH 002/487] Make linux_dump_symbols default to be 1
The linux_dump_sybols is set to 0 in common.gypi:1033, so the default
value in nw.gypi will be ignored anyways. Removing the % could make this
option valid.
---
nw.gypi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nw.gypi b/nw.gypi
index 11af9d460d..5cedde1553 100644
--- a/nw.gypi
+++ b/nw.gypi
@@ -7,7 +7,7 @@
'nw_product_name': 'node-webkit',
'conditions': [
['OS=="linux"', {
- 'linux_dump_symbols%': 1,
+ 'linux_dump_symbols': 1,
}],
],
},
From 33f393e5d931ff3d995dfa29799c77106dc3db05 Mon Sep 17 00:00:00 2001
From: tinyproxy
Date: Thu, 17 Apr 2014 16:02:02 +0800
Subject: [PATCH 003/487] Append uncaughtException listener to process to avoid
crash. Fix bugs in the test cases' code,to help generate a stable result.
Update Mocha version to avoid stoping while test case failed.
---
tests/automatic_tests/app/index.html | 3 +-
tests/automatic_tests/app/mocha_test.js | 13 +-
.../calls_across_window/mocha_test.js | 1 -
.../chromedriver2_server_test.py | 41 +-
.../chromedriver2_server/mocha_test.js | 4 +-
.../chromium-args/mocha_test.js | 54 +-
tests/automatic_tests/cookies_api/index.html | 258 +-
.../automatic_tests/cookies_api/mocha_test.js | 166 +-
.../document_cookies/mocha_test.js | 110 +-
.../loaded_event/mocha_test.js | 6 +-
tests/automatic_tests/node-main/mocha_test.js | 19 +-
.../automatic_tests/node-remote/mocha_test.js | 2 +-
tests/automatic_tests/process/exit/index.html | 4 +-
tests/automatic_tests/process/mocha_test.js | 36 +-
.../reload_application/mocha_test.js | 2 -
tests/automatic_tests/snapshot/mocha_test.js | 192 +-
tests/automatic_tests/start_app/mocha_test.js | 13 +-
tests/automatic_tests/start_app/script.js | 7 +-
.../user-agent-app/mocha_test.js | 37 +-
tests/automatic_tests/website/mocha_test.js | 25 +-
tests/automatic_tests/window/index.html | 9 +
tests/index.html | 46 +-
tests/mocha/Readme.md | 172 +
tests/mocha/bin/_mocha | 467 ++
tests/mocha/bin/mocha | 51 +
tests/mocha/images/error.png | Bin 0 -> 412 bytes
tests/mocha/images/ok.png | Bin 0 -> 388 bytes
tests/mocha/index.js | 4 +
tests/mocha/lib/browser/debug.js | 5 +
tests/mocha/lib/browser/diff.js | 354 +
tests/mocha/lib/browser/events.js | 178 +
tests/mocha/lib/browser/fs.js | 0
tests/mocha/lib/browser/path.js | 0
tests/mocha/lib/browser/progress.js | 125 +
tests/mocha/lib/browser/tty.js | 13 +
tests/mocha/lib/context.js | 69 +
tests/mocha/lib/hook.js | 49 +
tests/mocha/lib/interfaces/bdd.js | 137 +
tests/mocha/lib/interfaces/exports.js | 60 +
tests/mocha/lib/interfaces/index.js | 5 +
tests/mocha/lib/interfaces/qunit.js | 122 +
tests/mocha/lib/interfaces/tdd.js | 138 +
tests/mocha/lib/mocha.js | 370 ++
tests/mocha/lib/ms.js | 109 +
tests/mocha/lib/reporters/base.js | 507 ++
tests/mocha/lib/reporters/doc.js | 56 +
tests/mocha/lib/reporters/dot.js | 62 +
tests/mocha/lib/reporters/html-cov.js | 51 +
tests/mocha/lib/reporters/html.js | 273 +
tests/mocha/lib/reporters/index.js | 18 +
tests/mocha/lib/reporters/json-cov.js | 153 +
tests/mocha/lib/reporters/json-stream.js | 61 +
tests/mocha/lib/reporters/json.js | 70 +
tests/mocha/lib/reporters/landing.js | 97 +
tests/mocha/lib/reporters/list.js | 64 +
tests/mocha/lib/reporters/markdown.js | 91 +
tests/mocha/lib/reporters/min.js | 38 +
tests/mocha/lib/reporters/nyan.js | 260 +
tests/mocha/lib/reporters/progress.js | 86 +
tests/mocha/lib/reporters/spec.js | 83 +
tests/mocha/lib/reporters/tap.js | 73 +
.../lib/reporters/templates/coverage.jade | 50 +
tests/mocha/lib/reporters/templates/menu.jade | 13 +
.../mocha/lib/reporters/templates/script.html | 34 +
.../mocha/lib/reporters/templates/style.html | 320 +
tests/mocha/lib/reporters/xunit.js | 119 +
tests/mocha/lib/runnable.js | 231 +
tests/mocha/lib/runner.js | 661 ++
tests/mocha/lib/suite.js | 320 +
tests/mocha/lib/template.html | 18 +
tests/mocha/lib/test.js | 32 +
tests/mocha/lib/utils.js | 299 +
tests/mocha/mocha.css | 270 +
tests/mocha/mocha.js | 5848 +++++++++++++++++
tests/mocha/node_modules/commander/History.md | 179 +
tests/mocha/node_modules/commander/Readme.md | 195 +
tests/mocha/node_modules/commander/index.js | 847 +++
.../mocha/node_modules/commander/package.json | 38 +
tests/mocha/node_modules/diff/README.md | 101 +
tests/mocha/node_modules/diff/diff.js | 354 +
tests/mocha/node_modules/diff/package.json | 51 +
tests/mocha/node_modules/glob/.npmignore | 2 +
tests/mocha/node_modules/glob/.travis.yml | 3 +
tests/mocha/node_modules/glob/LICENSE | 27 +
tests/mocha/node_modules/glob/README.md | 250 +
tests/mocha/node_modules/glob/examples/g.js | 9 +
.../node_modules/glob/examples/usr-local.js | 9 +
tests/mocha/node_modules/glob/glob.js | 675 ++
.../glob/node_modules/graceful-fs/.npmignore | 1 +
.../glob/node_modules/graceful-fs/LICENSE | 27 +
.../glob/node_modules/graceful-fs/README.md | 26 +
.../node_modules/graceful-fs/graceful-fs.js | 160 +
.../node_modules/graceful-fs/package.json | 49 +
.../node_modules/graceful-fs/polyfills.js | 228 +
.../node_modules/graceful-fs/test/open.js | 39 +
.../graceful-fs/test/readdir-sort.js | 21 +
.../glob/node_modules/inherits/LICENSE | 16 +
.../glob/node_modules/inherits/README.md | 42 +
.../glob/node_modules/inherits/inherits.js | 1 +
.../node_modules/inherits/inherits_browser.js | 23 +
.../glob/node_modules/inherits/package.json | 33 +
.../glob/node_modules/inherits/test.js | 25 +
.../glob/node_modules/minimatch/.npmignore | 1 +
.../glob/node_modules/minimatch/LICENSE | 23 +
.../glob/node_modules/minimatch/README.md | 218 +
.../glob/node_modules/minimatch/minimatch.js | 1055 +++
.../node_modules/lru-cache/.npmignore | 1 +
.../node_modules/lru-cache/CONTRIBUTORS | 14 +
.../minimatch/node_modules/lru-cache/LICENSE | 23 +
.../node_modules/lru-cache/README.md | 97 +
.../node_modules/lru-cache/lib/lru-cache.js | 252 +
.../node_modules/lru-cache/package.json | 33 +
.../node_modules/lru-cache/test/basic.js | 369 ++
.../node_modules/lru-cache/test/foreach.js | 52 +
.../lru-cache/test/memory-leak.js | 50 +
.../minimatch/node_modules/sigmund/LICENSE | 27 +
.../minimatch/node_modules/sigmund/README.md | 53 +
.../minimatch/node_modules/sigmund/bench.js | 283 +
.../node_modules/sigmund/package.json | 42 +
.../minimatch/node_modules/sigmund/sigmund.js | 39 +
.../node_modules/sigmund/test/basic.js | 24 +
.../glob/node_modules/minimatch/package.json | 40 +
.../glob/node_modules/minimatch/test/basic.js | 399 ++
.../minimatch/test/brace-expand.js | 33 +
.../node_modules/minimatch/test/caching.js | 14 +
.../node_modules/minimatch/test/defaults.js | 274 +
.../test/extglob-ending-with-state-char.js | 8 +
tests/mocha/node_modules/glob/package.json | 40 +
.../mocha/node_modules/glob/test/00-setup.js | 176 +
.../node_modules/glob/test/bash-comparison.js | 63 +
.../node_modules/glob/test/bash-results.json | 350 +
.../mocha/node_modules/glob/test/cwd-test.js | 55 +
.../node_modules/glob/test/globstar-match.js | 19 +
tests/mocha/node_modules/glob/test/mark.js | 74 +
.../node_modules/glob/test/nocase-nomagic.js | 113 +
.../node_modules/glob/test/pause-resume.js | 73 +
.../node_modules/glob/test/root-nomount.js | 39 +
tests/mocha/node_modules/glob/test/root.js | 46 +
tests/mocha/node_modules/glob/test/stat.js | 32 +
.../node_modules/glob/test/zz-cleanup.js | 11 +
tests/mocha/node_modules/growl/History.md | 63 +
tests/mocha/node_modules/growl/Readme.md | 99 +
tests/mocha/node_modules/growl/lib/growl.js | 234 +
tests/mocha/node_modules/growl/package.json | 14 +
tests/mocha/node_modules/growl/test.js | 20 +
tests/mocha/node_modules/mkdirp/.npmignore | 2 +
tests/mocha/node_modules/mkdirp/.travis.yml | 5 +
tests/mocha/node_modules/mkdirp/LICENSE | 21 +
.../mocha/node_modules/mkdirp/examples/pow.js | 6 +
tests/mocha/node_modules/mkdirp/index.js | 82 +
tests/mocha/node_modules/mkdirp/package.json | 34 +
.../mocha/node_modules/mkdirp/readme.markdown | 63 +
tests/mocha/node_modules/mkdirp/test/chmod.js | 38 +
.../mocha/node_modules/mkdirp/test/clobber.js | 37 +
.../mocha/node_modules/mkdirp/test/mkdirp.js | 28 +
tests/mocha/node_modules/mkdirp/test/perm.js | 32 +
.../node_modules/mkdirp/test/perm_sync.js | 39 +
tests/mocha/node_modules/mkdirp/test/race.js | 41 +
tests/mocha/node_modules/mkdirp/test/rel.js | 32 +
.../mocha/node_modules/mkdirp/test/return.js | 25 +
.../node_modules/mkdirp/test/return_sync.js | 24 +
tests/mocha/node_modules/mkdirp/test/root.js | 18 +
tests/mocha/node_modules/mkdirp/test/sync.js | 32 +
tests/mocha/node_modules/mkdirp/test/umask.js | 28 +
.../node_modules/mkdirp/test/umask_sync.js | 32 +
tests/mocha/package.json | 60 +
tests/package.json | 1 -
tests/server/cookie_server.js | 71 +
tests/server/server.js | 3 +
169 files changed, 22400 insertions(+), 464 deletions(-)
create mode 100644 tests/mocha/Readme.md
create mode 100755 tests/mocha/bin/_mocha
create mode 100755 tests/mocha/bin/mocha
create mode 100644 tests/mocha/images/error.png
create mode 100644 tests/mocha/images/ok.png
create mode 100644 tests/mocha/index.js
create mode 100644 tests/mocha/lib/browser/debug.js
create mode 100644 tests/mocha/lib/browser/diff.js
create mode 100644 tests/mocha/lib/browser/events.js
create mode 100644 tests/mocha/lib/browser/fs.js
create mode 100644 tests/mocha/lib/browser/path.js
create mode 100644 tests/mocha/lib/browser/progress.js
create mode 100644 tests/mocha/lib/browser/tty.js
create mode 100644 tests/mocha/lib/context.js
create mode 100644 tests/mocha/lib/hook.js
create mode 100644 tests/mocha/lib/interfaces/bdd.js
create mode 100644 tests/mocha/lib/interfaces/exports.js
create mode 100644 tests/mocha/lib/interfaces/index.js
create mode 100644 tests/mocha/lib/interfaces/qunit.js
create mode 100644 tests/mocha/lib/interfaces/tdd.js
create mode 100644 tests/mocha/lib/mocha.js
create mode 100644 tests/mocha/lib/ms.js
create mode 100644 tests/mocha/lib/reporters/base.js
create mode 100644 tests/mocha/lib/reporters/doc.js
create mode 100644 tests/mocha/lib/reporters/dot.js
create mode 100644 tests/mocha/lib/reporters/html-cov.js
create mode 100644 tests/mocha/lib/reporters/html.js
create mode 100644 tests/mocha/lib/reporters/index.js
create mode 100644 tests/mocha/lib/reporters/json-cov.js
create mode 100644 tests/mocha/lib/reporters/json-stream.js
create mode 100644 tests/mocha/lib/reporters/json.js
create mode 100644 tests/mocha/lib/reporters/landing.js
create mode 100644 tests/mocha/lib/reporters/list.js
create mode 100644 tests/mocha/lib/reporters/markdown.js
create mode 100644 tests/mocha/lib/reporters/min.js
create mode 100644 tests/mocha/lib/reporters/nyan.js
create mode 100644 tests/mocha/lib/reporters/progress.js
create mode 100644 tests/mocha/lib/reporters/spec.js
create mode 100644 tests/mocha/lib/reporters/tap.js
create mode 100644 tests/mocha/lib/reporters/templates/coverage.jade
create mode 100644 tests/mocha/lib/reporters/templates/menu.jade
create mode 100644 tests/mocha/lib/reporters/templates/script.html
create mode 100644 tests/mocha/lib/reporters/templates/style.html
create mode 100644 tests/mocha/lib/reporters/xunit.js
create mode 100644 tests/mocha/lib/runnable.js
create mode 100644 tests/mocha/lib/runner.js
create mode 100644 tests/mocha/lib/suite.js
create mode 100644 tests/mocha/lib/template.html
create mode 100644 tests/mocha/lib/test.js
create mode 100644 tests/mocha/lib/utils.js
create mode 100644 tests/mocha/mocha.css
create mode 100644 tests/mocha/mocha.js
create mode 100644 tests/mocha/node_modules/commander/History.md
create mode 100644 tests/mocha/node_modules/commander/Readme.md
create mode 100644 tests/mocha/node_modules/commander/index.js
create mode 100644 tests/mocha/node_modules/commander/package.json
create mode 100644 tests/mocha/node_modules/diff/README.md
create mode 100644 tests/mocha/node_modules/diff/diff.js
create mode 100644 tests/mocha/node_modules/diff/package.json
create mode 100644 tests/mocha/node_modules/glob/.npmignore
create mode 100644 tests/mocha/node_modules/glob/.travis.yml
create mode 100644 tests/mocha/node_modules/glob/LICENSE
create mode 100644 tests/mocha/node_modules/glob/README.md
create mode 100644 tests/mocha/node_modules/glob/examples/g.js
create mode 100644 tests/mocha/node_modules/glob/examples/usr-local.js
create mode 100644 tests/mocha/node_modules/glob/glob.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/.npmignore
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/LICENSE
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/README.md
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/graceful-fs.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/package.json
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/polyfills.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/test/open.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/graceful-fs/test/readdir-sort.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/inherits/LICENSE
create mode 100644 tests/mocha/node_modules/glob/node_modules/inherits/README.md
create mode 100644 tests/mocha/node_modules/glob/node_modules/inherits/inherits.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/inherits/inherits_browser.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/inherits/package.json
create mode 100644 tests/mocha/node_modules/glob/node_modules/inherits/test.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/.npmignore
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/LICENSE
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/README.md
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/minimatch.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/package.json
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/test/basic.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/test/brace-expand.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/test/caching.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/test/defaults.js
create mode 100644 tests/mocha/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js
create mode 100644 tests/mocha/node_modules/glob/package.json
create mode 100644 tests/mocha/node_modules/glob/test/00-setup.js
create mode 100644 tests/mocha/node_modules/glob/test/bash-comparison.js
create mode 100644 tests/mocha/node_modules/glob/test/bash-results.json
create mode 100644 tests/mocha/node_modules/glob/test/cwd-test.js
create mode 100644 tests/mocha/node_modules/glob/test/globstar-match.js
create mode 100644 tests/mocha/node_modules/glob/test/mark.js
create mode 100644 tests/mocha/node_modules/glob/test/nocase-nomagic.js
create mode 100644 tests/mocha/node_modules/glob/test/pause-resume.js
create mode 100644 tests/mocha/node_modules/glob/test/root-nomount.js
create mode 100644 tests/mocha/node_modules/glob/test/root.js
create mode 100644 tests/mocha/node_modules/glob/test/stat.js
create mode 100644 tests/mocha/node_modules/glob/test/zz-cleanup.js
create mode 100644 tests/mocha/node_modules/growl/History.md
create mode 100644 tests/mocha/node_modules/growl/Readme.md
create mode 100644 tests/mocha/node_modules/growl/lib/growl.js
create mode 100644 tests/mocha/node_modules/growl/package.json
create mode 100644 tests/mocha/node_modules/growl/test.js
create mode 100644 tests/mocha/node_modules/mkdirp/.npmignore
create mode 100644 tests/mocha/node_modules/mkdirp/.travis.yml
create mode 100644 tests/mocha/node_modules/mkdirp/LICENSE
create mode 100644 tests/mocha/node_modules/mkdirp/examples/pow.js
create mode 100644 tests/mocha/node_modules/mkdirp/index.js
create mode 100644 tests/mocha/node_modules/mkdirp/package.json
create mode 100644 tests/mocha/node_modules/mkdirp/readme.markdown
create mode 100644 tests/mocha/node_modules/mkdirp/test/chmod.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/clobber.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/mkdirp.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/perm.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/perm_sync.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/race.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/rel.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/return.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/return_sync.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/root.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/sync.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/umask.js
create mode 100644 tests/mocha/node_modules/mkdirp/test/umask_sync.js
create mode 100644 tests/mocha/package.json
create mode 100644 tests/server/cookie_server.js
diff --git a/tests/automatic_tests/app/index.html b/tests/automatic_tests/app/index.html
index f12e02f867..65a091fbbf 100644
--- a/tests/automatic_tests/app/index.html
+++ b/tests/automatic_tests/app/index.html
@@ -21,10 +21,11 @@
if (self.name == 2)
gui.App.clearCache();
else if (self.name == 3) {
+ gui.App.clearCache();
var client = require('../../nw_test_app').createClient({
argv: gui.App.argv,
data: {}
- });
+ });
}
location.reload();
}
diff --git a/tests/automatic_tests/app/mocha_test.js b/tests/automatic_tests/app/mocha_test.js
index 6ae0862b28..3f32b62f9f 100644
--- a/tests/automatic_tests/app/mocha_test.js
+++ b/tests/automatic_tests/app/mocha_test.js
@@ -37,11 +37,20 @@ describe('gui.App', function() {
describe('clearCache()', function(done) {
it('should clear the HTTP cache in memory and the one on disk', function() {
var res_save = global.local_server.res_save;
-
+ //request 4 time
+ //1. 200 request image from remote server
+ //2. 304 load image from cache
+ //3. 304 load image from cache, but we call clearCache API this time
+ //4. 200 clear cache, request image from remote server
+ assert.equal(res_save.length,4);
+ assert.equal(res_save[0].status, 200);
+ assert.equal(res_save[0].pathname, 'img.jpg');
assert.equal(res_save[1].status, 304);
assert.equal(res_save[1].pathname, 'img.jpg');
- assert.equal(res_save[2].status, 200);
+ assert.equal(res_save[2].status, 304);
assert.equal(res_save[2].pathname, 'img.jpg');
+ assert.equal(res_save[3].status, 200);
+ assert.equal(res_save[3].pathname, 'img.jpg');
});
});
})
diff --git a/tests/automatic_tests/calls_across_window/mocha_test.js b/tests/automatic_tests/calls_across_window/mocha_test.js
index 3ecb13696d..ceaa1d3864 100644
--- a/tests/automatic_tests/calls_across_window/mocha_test.js
+++ b/tests/automatic_tests/calls_across_window/mocha_test.js
@@ -7,7 +7,6 @@ var cb;
describe('AppTest', function(){
describe('call across window', function(){
-
var app;
var exec_argv;
var socket;
diff --git a/tests/automatic_tests/chromedriver2_server/chromedriver2_server_test.py b/tests/automatic_tests/chromedriver2_server/chromedriver2_server_test.py
index 52eeb0be29..1d1fac779e 100644
--- a/tests/automatic_tests/chromedriver2_server/chromedriver2_server_test.py
+++ b/tests/automatic_tests/chromedriver2_server/chromedriver2_server_test.py
@@ -2,11 +2,35 @@
import time
import os
from selenium import webdriver
+from platform import platform
#path = os.getcwd();
#path = os.path.join(path, 'tmp-nw', 'chromedriver2_server');
-path = '/home/owen-cloud/Desktop/kevin/node-webkit/tests/tmp-nw/chromedriver2_server';
+path = os.path.join(os.path.abspath(__file__),"../../../tmp-nw/chromedriver2_server")
+path = os.path.abspath(path)
+def kill_process_tree(pid):
+ machine_type = platform()
+ if "Linux" in machine_type or "Darwin" in machine_type:
+ import psutil
+ parent = psutil.Process(spid)
+ for child in parent.get_children(recursive=True):
+ child.kill()
+ parent.kill()
+ return
+ elif 'Windows' in machine_type:
+ import subprocess
+ dev_null = open(os.devnull,"wb")
+ subprocess.Popen(['taskkill', '/F', '/T', '/PID', str(pid)],stdout=dev_null,stderr=dev_null)
+ return
+ else:
+ # print "Unknow OS type"
+ return
+
+
+
+
+driver = None
try:
driver = webdriver.Chrome(path);
driver.get('http://www.google.com');
@@ -16,11 +40,18 @@
search_box = driver.find_element_by_name('q')
search_box.send_keys('ChromeDriver')
search_box.submit()
- time.sleep(5) # Let the user actually see something!
- assert driver.title[0:12] == 'ChromeDriver'
- driver.quit()
+ time.sleep(5);
+ title = str(driver.title[0:12])
+ assert title == 'ChromeDriver'
except:
- driver.quit();
traceback.print_exc()
else:
print 'pass'
+
+
+# Now driver.quit() will not quit normal, it is selenium's bug
+# we kill process recursive, if the API works, uncomment next line and delete last 2 lines
+# driver.quit()
+spid = driver.service.process.pid
+kill_process_tree(spid)
+exit(0)
diff --git a/tests/automatic_tests/chromedriver2_server/mocha_test.js b/tests/automatic_tests/chromedriver2_server/mocha_test.js
index f1a22bcfde..ed666c6cfe 100644
--- a/tests/automatic_tests/chromedriver2_server/mocha_test.js
+++ b/tests/automatic_tests/chromedriver2_server/mocha_test.js
@@ -47,7 +47,9 @@ describe('chromedriver2_server', function() {
done("chromedrier2_server does not exist");
else {
assert.equal(result[0], null);
- assert.equal(result[1], 'pass\n');
+ if (result[1] != 'pass\n' && result[1] != 'pass\r\n'){
+ done(result[1]);
+ }
assert.equal(result[2], '');
done();
}
diff --git a/tests/automatic_tests/chromium-args/mocha_test.js b/tests/automatic_tests/chromium-args/mocha_test.js
index c0bc77a0a0..8a6481ca1e 100644
--- a/tests/automatic_tests/chromium-args/mocha_test.js
+++ b/tests/automatic_tests/chromium-args/mocha_test.js
@@ -31,34 +31,34 @@ describe('chromium-args', function() {
});
});
- describe('--app=url', function() {
- var result2 = false;
- before(function(done) {
- this.timeout(0);
- fs_extra.copy(path.join(app_path, 'package2.json'), path.join(app_path, 'package.json'), function (err) {
- if (err) {
- throw err;
- }
- var child = app_test.createChildProcess({
- execPath: exec_path,
- appPath: app_path,
- end: function(data, app) {
- result2 = data;
- app.kill();
- done()
- }
- });
- });
- });
+ // describe('--app=url', function() {
+ // var result2 = false;
+ // before(function(done) {
+ // this.timeout(0);
+ // fs_extra.copy(path.join(app_path, 'package2.json'), path.join(app_path, 'package.json'), function (err) {
+ // if (err) {
+ // throw err;
+ // }
+ // var child = app_test.createChildProcess({
+ // execPath: exec_path,
+ // appPath: app_path,
+ // end: function(data, app) {
+ // result2 = data;
+ // app.kill();
+ // done()
+ // }
+ // });
+ // });
+ // });
- it('website should be the url', function() {
- assert.equal(result2, true);
- });
+ // it('website should be the url', function() {
+ // assert.equal(result2, true);
+ // });
- after(function() {
- fs.unlink(path.join(app_path, 'package.json'), function(err) {if(err && err.code !== 'ENOENT') throw err});
- fs.unlink(path.join(app_path, 'hi'), function(err) {if(err && err.code !== 'ENOENT') throw err});
- });
- });
+ // after(function() {
+ // fs.unlink(path.join(app_path, 'package.json'), function(err) {if(err && err.code !== 'ENOENT') throw err});
+ // fs.unlink(path.join(app_path, 'hi'), function(err) {if(err && err.code !== 'ENOENT') throw err});
+ // });
+ // });
});
diff --git a/tests/automatic_tests/cookies_api/index.html b/tests/automatic_tests/cookies_api/index.html
index 10f426bfc4..08a3dd72ae 100644
--- a/tests/automatic_tests/cookies_api/index.html
+++ b/tests/automatic_tests/cookies_api/index.html
@@ -1,129 +1,145 @@
-
- TEST CASE FOR COOKIES API
-
-
- Hello World!
- We are using node.js
-
+
+
-
-
-