From: Cheng Zhao Date: Mon, 2 Sep 2013 08:54:54 +0000 (+0800) Subject: Update specs to match the documents. X-Git-Tag: v0.4.3~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=75a24a2e675bd7f882604292144c3cfa5022eef8;p=electron.git Update specs to match the documents. --- diff --git a/spec/api/window.coffee b/spec/api/window.coffee index 4226817c..a291af59 100644 --- a/spec/api/window.coffee +++ b/spec/api/window.coffee @@ -74,6 +74,12 @@ describe 'window module', -> done() w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-true.html') + it 'returning non-empty string would not prevent close', (done) -> + w = new BrowserWindow(show: false) + w.on 'closed', -> + done() + w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-string.html') + it 'returning false would prevent close', (done) -> w = new BrowserWindow(show: false) w.on 'onbeforeunload', -> @@ -81,9 +87,9 @@ describe 'window module', -> done() w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-false.html') - it 'returning non-empty string would prevent close', (done) -> + it 'returning empty string would prevent close', (done) -> w = new BrowserWindow(show: false) w.on 'onbeforeunload', -> w.destroy() done() - w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-string.html') + w.loadUrl 'file://' + path.join(fixtures, 'api', 'close-beforeunload-empty-string.html') diff --git a/spec/fixtures/api/close-beforeunload-empty-string.html b/spec/fixtures/api/close-beforeunload-empty-string.html new file mode 100644 index 00000000..0027c55b --- /dev/null +++ b/spec/fixtures/api/close-beforeunload-empty-string.html @@ -0,0 +1,13 @@ + + + + +