Skip to content

test: asyncawaitify one of sandbox related tests - #15252

Merged
MarshallOfSound merged 1 commit into
masterfrom
rewrite-a-test
Oct 19, 2018
Merged

MarshallOfSound merged 1 commit into
masterfrom
rewrite-a-test

Conversation

@alexeykuzmin

Copy link
Copy Markdown
Contributor

Description of Change

Make it more readable.
/cc @ppontes

Checklist

Release Notes

Notes: no notes

@alexeykuzmin
alexeykuzmin requested review from a team and tarruda October 18, 2018 17:48

// Wait for a message from the popup's preload script.
const [, openerIsNull, html, locationHref] = await emittedOnce(ipcMain, 'child-loaded')
expect(openerIsNull).to.be.true('window.opener is not null')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When sandbox: false this check fails.

// so let's close it from here before we run any checks.
await closeWindow(popupWindow, { assertSingleWindow: false })

expect(exceptionMessage).to.be.a('string',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When sandbox: false and the openerIsNull check is disabled, the test fails here getting null as exceptionMessage.

} catch (error) {
errorMessage = error.message
}
ipcRenderer.send('answer', errorMessage)

@alexeykuzmin alexeykuzmin Oct 18, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message should be sent no matter if we got an exception or not.

w.webContents.once('new-window', (e, url, frameName, disposition, options) => {
assert.strictEqual(url, 'http://www.google.com/#q=electron')
assert.strictEqual(options.width, 505)
assert.strictEqual(options.height, 605)

@alexeykuzmin alexeykuzmin Oct 18, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those width/height checks are irrelevant to cross-scripting.

@MarshallOfSound
MarshallOfSound merged commit b3f134d into master Oct 19, 2018
@release-clerk

release-clerk Bot commented Oct 19, 2018

Copy link
Copy Markdown

No Release Notes

@MarshallOfSound
MarshallOfSound deleted the rewrite-a-test branch October 19, 2018 03:28
@alexeykuzmin

Copy link
Copy Markdown
Contributor Author

/trop run backport

@trop

trop Bot commented Oct 19, 2018

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated, here we go! :D

@trop

trop Bot commented Oct 19, 2018

Copy link
Copy Markdown
Contributor

We have automatically backported this PR to "4-0-x", please check out #15278

@alexeykuzmin

Copy link
Copy Markdown
Contributor Author

/trop run backport

@trop

trop Bot commented Oct 19, 2018

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated, here we go! :D

@alexeykuzmin

Copy link
Copy Markdown
Contributor Author

Backporting this to 3-0-x and 4-0-x to make verifying of #15216 easier.

@alexeykuzmin

Copy link
Copy Markdown
Contributor Author

/trop run backport-to 3-0-x

@trop

trop Bot commented Oct 19, 2018

Copy link
Copy Markdown
Contributor

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "3-0-x" here we go! :D

alexeykuzmin added a commit that referenced this pull request Oct 19, 2018
alexeykuzmin added a commit that referenced this pull request Oct 19, 2018
codebytere pushed a commit that referenced this pull request Oct 19, 2018
…15281)

* test: asyncawaitify one of sandbox related tests (#15252)

(cherry picked from commit b3f134d)

* test: backport "openTheWindow" function to "BrowserWindow module" specs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants