]> khamidou — GitHub mirrors - electron.git/commitdiff
spec: Improve the test for resizable
authorCheng Zhao <zcbenz@gmail.com>
Sat, 23 Jan 2016 11:38:19 +0000 (03:38 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 24 Jan 2016 06:31:37 +0000 (14:31 +0800)
spec/api-browser-window-spec.js

index 0cd0422afbbbd6c1473a85c0d1afd04602535f1b..b54efdde9a03506845b4cfbda3a76d6697623681 100644 (file)
@@ -194,19 +194,6 @@ describe('browser-window module', function() {
       return assert.equal(w.id, BrowserWindow.fromId(w.id).id);
     });
   });
-  describe('BrowserWindow.setResizable(resizable)', function() {
-    return it('does not change window size for frameless window', function() {
-      var s;
-      w.destroy();
-      w = new BrowserWindow({
-        show: true,
-        frame: false
-      });
-      s = w.getSize();
-      w.setResizable(!w.isResizable());
-      return assert.deepEqual(s, w.getSize());
-    });
-  });
   describe('"useContentSize" option', function() {
     it('make window created with content size when used', function() {
       var contentSize;
@@ -578,10 +565,6 @@ describe('browser-window module', function() {
     });
 
     describe('closable state', function() {
-      // Only implemented on OS X.
-      if (process.platform != 'darwin')
-        return;
-
       it('can be changed with closable option', function() {
         w.destroy();
         w = new BrowserWindow({show: false, closable: false});
@@ -597,5 +580,20 @@ describe('browser-window module', function() {
       });
     });
 
+    describe('resizable state', function() {
+      it('can be changed with resizable option', function() {
+        w.destroy();
+        w = new BrowserWindow({show: false, resizable: false});
+        assert.equal(w.isResizable(), false);
+      });
+
+      it('can be changed with setResizable method', function() {
+        assert.equal(w.isResizable(), true);
+        w.setResizable(false);
+        assert.equal(w.isResizable(), false);
+        w.setResizable(true);
+        assert.equal(w.isResizable(), true);
+      });
+    });
   });
 });