Add specs for window.open frameName argument
authorKevin Sawicki <kevinsawicki@gmail.com>
Tue, 25 Apr 2017 20:52:56 +0000 (13:52 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Wed, 26 Apr 2017 17:14:11 +0000 (10:14 -0700)
spec/chromium-spec.js

index b0ae69a..1b88d78 100644 (file)
@@ -371,6 +371,26 @@ describe('chromium feature', function () {
         window.open('', '', {toString: 3})
       }, /Cannot convert object to primitive value/)
     })
+
+    it('sets the window title to the specified frameName', function (done) {
+      let b
+      app.once('browser-window-created', (event, createdWindow) => {
+        assert.equal(createdWindow.getTitle(), 'hello')
+        b.close()
+        done()
+      })
+      b = window.open('', 'hello')
+    })
+
+    it('does not throw an exception when the frameName is a built-in object property', function (done) {
+      let b
+      app.once('browser-window-created', (event, createdWindow) => {
+        assert.equal(createdWindow.getTitle(), '__proto__')
+        b.close()
+        done()
+      })
+      b = window.open('', '__proto__')
+    })
   })
 
   describe('window.opener', function () {