Skip to content

Commit

Permalink
4808884: Major overhaul of ExceptionState in the v8 bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Sep 12, 2023
1 parent 2b21d17 commit 4441816
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions spec/api-browser-window-spec.ts
Expand Up @@ -3542,12 +3542,13 @@ describe('BrowserWindow module', () => {
// so let's close it from here before we run any checks.
await closeWindow(popupWindow, { assertNotWindows: false });

const errorPattern = /Failed to read a named property 'document' from 'Window': Blocked a frame with origin "(.*?)" from accessing a cross-origin frame./;
expect(popupAccessMessage).to.be.a('string',
'child\'s .document is accessible from its parent window');
expect(popupAccessMessage).to.match(/^Blocked a frame with origin/);
expect(popupAccessMessage).to.match(errorPattern);
expect(openerAccessMessage).to.be.a('string',
'opener .document is accessible from a popup window');
expect(openerAccessMessage).to.match(/^Blocked a frame with origin/);
expect(openerAccessMessage).to.match(errorPattern);
});

it('should inherit the sandbox setting in opened windows', async () => {
Expand Down Expand Up @@ -3754,7 +3755,7 @@ describe('BrowserWindow module', () => {
const answer = once(ipcMain, 'answer');
w.loadFile(path.join(fixtures, 'api', 'native-window-open-cross-origin.html'));
const [, content] = await answer;
expect(content).to.equal('Blocked a frame with origin "file://" from accessing a cross-origin frame.');
expect(content).to.equal('Failed to read a named property \'toString\' from \'Location\': Blocked a frame with origin "file://" from accessing a cross-origin frame.');
});
it('opens window from <iframe> tags', async () => {
const answer = once(ipcMain, 'answer');
Expand Down
4 changes: 2 additions & 2 deletions spec/webview-spec.ts
Expand Up @@ -669,9 +669,9 @@ describe('<webview> tag', function () {

const [, content] = await once(ipcMain, 'answer');
const expectedContent =
'Blocked a frame with origin "file://" from accessing a cross-origin frame.';
/Failed to read a named property 'toString' from 'Location': Blocked a frame with origin "(.*?)" from accessing a cross-origin frame./;

expect(content).to.equal(expectedContent);
expect(content).to.match(expectedContent);
});

it('emits a browser-window-created event', async () => {
Expand Down

0 comments on commit 4441816

Please sign in to comment.