From: Eran Tiktin Date: Thu, 27 Aug 2015 20:05:06 +0000 (+0300) Subject: Ignore native module tests on Windows debug build X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5337d8c23f732b7c600e3fa964df699aad08809b;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Ignore native module tests on Windows debug build This resolves #2558. There are no more errors when running test.py on the debug build in Windows. When running the release build the tests will be executed as usual. --- diff --git a/.gitignore b/.gitignore index 0c6f4cb..73bf6b2 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ node_modules/ *.pyc debug.log npm-debug.log +atom/common/chrome_version.h diff --git a/docs/development/build-instructions-windows.md b/docs/development/build-instructions-windows.md index ddf5510..840c809 100644 --- a/docs/development/build-instructions-windows.md +++ b/docs/development/build-instructions-windows.md @@ -54,7 +54,7 @@ You can also only build the Debug target: python script\build.py -c D ``` -After building is done, you can find `electron.exe` under `out\D` (debug +After building is done, you can find `electron.exe` under `out\D` (debug target) or under `out\R` (release target). ## 64bit build @@ -82,6 +82,15 @@ Test functionality using: python script\test.py ``` +Tests that include native modules (e.g. `runas`) can't be executed with the +debug build (see #2558 for details), but they will work with the release build. + +To run the tests with the release build use: + +```powershell +python script\test.py -R +``` + ## Troubleshooting ### Command xxxx not found diff --git a/spec/modules-spec.coffee b/spec/modules-spec.coffee index 545d55e..e7bdac3 100644 --- a/spec/modules-spec.coffee +++ b/spec/modules-spec.coffee @@ -7,16 +7,20 @@ describe 'third-party module', -> fixtures = path.join __dirname, 'fixtures' temp.track() - describe 'runas', -> - it 'can be required in renderer', -> - require 'runas' + # If the test is executed with the debug build on Windows, we will skip it + # because native modules don't work with the debug build (see issue #2558). + if process.platform isnt 'win32' or + process.execPath.toLowerCase().indexOf('\\out\\d\\') is -1 + describe 'runas', -> + it 'can be required in renderer', -> + require 'runas' - it 'can be required in node binary', (done) -> - runas = path.join fixtures, 'module', 'runas.js' - child = require('child_process').fork runas - child.on 'message', (msg) -> - assert.equal msg, 'ok' - done() + it 'can be required in node binary', (done) -> + runas = path.join fixtures, 'module', 'runas.js' + child = require('child_process').fork runas + child.on 'message', (msg) -> + assert.equal msg, 'ok' + done() describe 'q', -> Q = require 'q' diff --git a/spec/webview-spec.coffee b/spec/webview-spec.coffee index ba3478f..7c2cd1a 100644 --- a/spec/webview-spec.coffee +++ b/spec/webview-spec.coffee @@ -48,18 +48,22 @@ describe ' tag', -> webview.src = "file://#{fixtures}/pages/d.html" document.body.appendChild webview - it 'loads native modules when navigation happens', (done) -> - listener = (e) -> - webview.removeEventListener 'did-finish-load', listener - listener2 = (e) -> - assert.equal e.message, 'function' - done() - webview.addEventListener 'console-message', listener2 - webview.reload() - webview.addEventListener 'did-finish-load', listener - webview.setAttribute 'nodeintegration', 'on' - webview.src = "file://#{fixtures}/pages/native-module.html" - document.body.appendChild webview + # If the test is executed with the debug build on Windows, we will skip it + # because native modules don't work with the debug build (see issue #2558). + if process.platform isnt 'win32' or + process.execPath.toLowerCase().indexOf('\\out\\d\\') is -1 + it 'loads native modules when navigation happens', (done) -> + listener = (e) -> + webview.removeEventListener 'did-finish-load', listener + listener2 = (e) -> + assert.equal e.message, 'function' + done() + webview.addEventListener 'console-message', listener2 + webview.reload() + webview.addEventListener 'did-finish-load', listener + webview.setAttribute 'nodeintegration', 'on' + webview.src = "file://#{fixtures}/pages/native-module.html" + document.body.appendChild webview describe 'preload attribute', -> it 'loads the script before other scripts in window', (done) ->