Skip to content

Commit

Permalink
Add more origin comparison specs
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Nov 28, 2016
1 parent 41dea03 commit 145e40c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/chromium-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,15 @@ describe('chromium feature', function () {
w = window.open(url, '', 'show=no')
})

it('works when origin matches', function (done) {
listener = function (event) {
assert.equal(event.data, location.href)
done()
}
window.addEventListener('message', listener)
w = window.open(`file://${fixtures}/pages/window-opener-location.html`, '', 'show=no')
})

it('works when origin does not match opener but has node integration', function (done) {
listener = function (event) {
assert.equal(event.data, location.href)
Expand Down Expand Up @@ -397,6 +406,24 @@ describe('chromium feature', function () {
document.body.appendChild(webview)
})

it('works when origin matches', function (done) {
webview = new WebView()
webview.addEventListener('console-message', function (e) {
assert.equal(e.message, webview.src)
done()
})
webview.setAttribute('allowpopups', 'on')
webview.src = url.format({
pathname: srcPath,
protocol: 'file',
query: {
p: pageURL
},
slashes: true
})
document.body.appendChild(webview)
})

it('works when origin does not match opener but has node integration', function (done) {
webview = new WebView()
webview.addEventListener('console-message', function (e) {
Expand Down

0 comments on commit 145e40c

Please sign in to comment.