fix styling and add spec

This commit is contained in:
Shelley Vohr 2018-02-28 00:22:42 -08:00
parent 2abc69780e
commit bf491de9fe
No known key found for this signature in database
GPG key ID: F13993A75599653C
3 changed files with 8 additions and 3 deletions

View file

@ -1086,7 +1086,7 @@ void BrowserWindow::AddTabbedWindow(NativeWindow* window,
mate::Arguments* args) { mate::Arguments* args) {
const bool windowAdded = window_->AddTabbedWindow(window); const bool windowAdded = window_->AddTabbedWindow(window);
if (!windowAdded) if (!windowAdded)
args->ThrowError("AddTabbedWindow cannot be called by a window on itself"); args->ThrowError("AddTabbedWindow cannot be called by a window on itself.");
} }
void BrowserWindow::SetVibrancy(mate::Arguments* args) { void BrowserWindow::SetVibrancy(mate::Arguments* args) {

View file

@ -918,7 +918,6 @@ NativeWindowMac::NativeWindowMac(
} }
if (transparent()) { if (transparent()) {
NSLog(@"Setting transparent");
// Setting the background color to clear will also hide the shadow. // Setting the background color to clear will also hide the shadow.
[window_ setBackgroundColor:[NSColor clearColor]]; [window_ setBackgroundColor:[NSColor clearColor]];
} }

View file

@ -733,6 +733,12 @@ describe('BrowserWindow module', () => {
done() done()
}) })
}) })
it('throws when called on itself', () => {
assert.throws(() => {
w.addTabbedWindow(w)
}, /AddTabbedWindow cannot be called by a window on itself./)
})
}) })
describe('BrowserWindow.setVibrancy(type)', () => { describe('BrowserWindow.setVibrancy(type)', () => {