Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
test: enable inspector tests
Browse files Browse the repository at this point in the history
Enabled tests for inspector and updated them to account for
differences between V8 and ChakraCore.

PR-URL: #247
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
Reviewed-By: Kunal Pathak <Kunal.Pathak@microsoft.com>
  • Loading branch information
kfarnung committed May 19, 2017
1 parent fb4e1e6 commit 91a9798
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
3 changes: 0 additions & 3 deletions test/inspector/inspector.status
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ prefix inspector
[true] # This section applies to all platforms

[$system==win32]

[$jsEngine==chakracore]
* : PASS,FLAKY
36 changes: 27 additions & 9 deletions test/inspector/test-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ function checkVersion(err, response) {
}

function checkBadPath(err, response) {
assert(err instanceof SyntaxError);
assert(/Unexpected token/.test(err.message));
assert(/WebSockets request was expected/.test(err.response));
assert(err instanceof SyntaxError, 'Expected SyntaxError');
assert(
common.engineSpecificMessage({
v8: /Unexpected token/,
chakracore: /JSON\.parse Error: Invalid character at position:1/})
.test(err.message),
'Unexpected message: ' + err.message);
assert(/WebSockets request was expected/.test(err.response),
'Unexpected response: ' + err.response);
}

function expectMainScriptSource(result) {
Expand All @@ -56,6 +62,12 @@ function setupExpectBreakOnLine(line, url, session, scopeIdCallback) {
function setupExpectConsoleOutput(type, values) {
if (!(values instanceof Array))
values = [ values ];

if (process.jsEngine === 'chakracore') {
// Only the first parameter is returned by ChakraCore
values = values.slice(0, 1);
}

return function(message) {
if ('Runtime.consoleAPICalled' === message['method']) {
const params = message['params'];
Expand Down Expand Up @@ -103,14 +115,20 @@ function testBreakpointOnStart(session) {
{ 'method': 'Debugger.setPauseOnExceptions',
'params': {'state': 'none'} },
{ 'method': 'Debugger.setAsyncCallStackDepth',
'params': {'maxDepth': 0} },
{ 'method': 'Profiler.enable' },
{ 'method': 'Profiler.setSamplingInterval',
'params': {'interval': 100} },
'params': {'maxDepth': 0} }
];

if (process.jsEngine !== 'chakracore') {
commands.push(
{ 'method': 'Profiler.enable' },
{ 'method': 'Profiler.setSamplingInterval',
'params': {'interval': 100} });
}

commands.push(
{ 'method': 'Debugger.setBlackboxPatterns',
'params': {'patterns': []} },
{ 'method': 'Runtime.runIfWaitingForDebugger' }
];
{ 'method': 'Runtime.runIfWaitingForDebugger' });

session
.sendInspectorCommands(commands)
Expand Down
4 changes: 2 additions & 2 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
if /i "%1"=="noetw" set noetw=1&goto arg-ok
if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
if /i "%1"=="test" set test_args=%test_args% doctool known_issues message parallel sequential addons addons-napi -J&set cpplint=1&set jslint=1&set build_addons=1&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap doctool inspector known_issues message sequential parallel addons addons-napi&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test" set test_args=%test_args% doctool known_issues message parallel sequential addons addons-napi inspector -J&set cpplint=1&set jslint=1&set build_addons=1&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap doctool inspector known_issues message sequential parallel addons addons-napi inspector&set cctest_args=%cctest_args% --gtest_output=tap:cctest.tap&set build_addons=1&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok
if /i "%1"=="test-addons-napi" set test_args=%test_args% addons-napi&set build_addons_napi=1&goto arg-ok
if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok
Expand Down

0 comments on commit 91a9798

Please sign in to comment.