diff --git a/lib/core/utils/collect-results-from-frames.js b/lib/core/utils/collect-results-from-frames.js index 8ad27569a7..f1d80fe3a1 100644 --- a/lib/core/utils/collect-results-from-frames.js +++ b/lib/core/utils/collect-results-from-frames.js @@ -37,7 +37,12 @@ axe.utils.sendCommandToFrame = function(node, parameters, resolve, reject) { }, 500); // send 'axe.ping' to the frame - axe.utils.respondable(win, 'axe.ping', null, undefined, function() { + axe.utils.respondable(win, 'axe.ping', null, undefined, function( + pingResponse + ) { + if (!pingResponse || !pingResponse.axe === true) { + return; + } clearTimeout(timeout); // Give axe 60s (or user-supplied value) to respond to 'axe.start' diff --git a/test/integration/full/frame-tested/frame-tested-echoes-postmessage.html b/test/integration/full/frame-tested/frame-tested-echoes-postmessage.html new file mode 100644 index 0000000000..7c44b0d5f4 --- /dev/null +++ b/test/integration/full/frame-tested/frame-tested-echoes-postmessage.html @@ -0,0 +1,29 @@ + + + + frame-tested echoes postMessage test + + + + + + + + + +
+ + + + + diff --git a/test/integration/full/frame-tested/frame-tested-echoes-postmessage.js b/test/integration/full/frame-tested/frame-tested-echoes-postmessage.js new file mode 100644 index 0000000000..8842117b47 --- /dev/null +++ b/test/integration/full/frame-tested/frame-tested-echoes-postmessage.js @@ -0,0 +1,28 @@ +describe('frame-tested-echoes-postmessage test', function() { + 'use strict'; + + var results; + before(function(done) { + axe.testUtils.awaitNestedLoad(function() { + axe.run( + { + runOnly: { type: 'rule', values: ['frame-tested'] }, + checks: { + 'frame-tested': { options: { isViolation: true } } + } + }, + function(err, r) { + assert.isNull(err); + results = r; + done(); + } + ); + }); + }); + + describe('result', function() { + it('should not error', function() { + assert.lengthOf(results.violations, 0); + }); + }); +}); diff --git a/test/integration/full/frame-tested/frames/with-echo.html b/test/integration/full/frame-tested/frames/with-echo.html new file mode 100644 index 0000000000..963328b9c8 --- /dev/null +++ b/test/integration/full/frame-tested/frames/with-echo.html @@ -0,0 +1,19 @@ + + + + Frame without axe-core + + + +

Frame without axe-core

+ + +