From df86c9dac1f55ee0d063f3eccdff20ff4ba2697f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 4 Mar 2014 22:04:41 +0800 Subject: [PATCH] Add spec for sanbox attribute of iframe. --- spec/chromium-spec.coffee | 18 ++++++++++++++++++ spec/fixtures/pages/change-parent.html | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 spec/fixtures/pages/change-parent.html diff --git a/spec/chromium-spec.coffee b/spec/chromium-spec.coffee index d23294210c2f..91461a3e00a2 100644 --- a/spec/chromium-spec.coffee +++ b/spec/chromium-spec.coffee @@ -1,6 +1,9 @@ assert = require 'assert' +path = require 'path' describe 'chromium feature', -> + fixtures = path.resolve __dirname, 'fixtures' + describe 'heap snapshot', -> it 'does not crash', -> process.atomBinding('v8_util').takeHeapSnapshot() @@ -21,3 +24,18 @@ describe 'chromium feature', -> b = window.open 'about:blank', 'test', 'show=no' assert.equal b.constructor.name, 'BrowserWindow' b.destroy() + + describe 'iframe with sandbox attribute', -> + it 'can not modify parent', (done) -> + page = path.join fixtures, 'pages', 'change-parent.html' + global.changedByIframe = false + + iframe = $('