mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Tweak cookie set failure message and add spec
This commit is contained in:
@@ -30,7 +30,7 @@ struct Converter<atom::api::Cookies::Error> {
|
||||
if (val == atom::api::Cookies::SUCCESS)
|
||||
return v8::Null(isolate);
|
||||
else
|
||||
return v8::Exception::Error(StringToV8(isolate, "failed"));
|
||||
return v8::Exception::Error(StringToV8(isolate, "Setting cookie failed"));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -69,6 +69,17 @@ describe('session module', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('calls back with an error when setting a cookie with missing required fields', function (done) {
|
||||
session.defaultSession.cookies.set({
|
||||
url: '',
|
||||
name: '1',
|
||||
value: '1'
|
||||
}, function (error) {
|
||||
assert.equal(error.message, 'Setting cookie failed')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should over-write the existent cookie', function (done) {
|
||||
session.defaultSession.cookies.set({
|
||||
url: url,
|
||||
|
||||
Reference in New Issue
Block a user