mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Merge pull request #7561 from electron/windows-system-colors
Support retrieving Windows system colors
This commit is contained in:
@@ -15,6 +15,22 @@ describe('systemPreferences module', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('systemPreferences.getColor(id)', function () {
|
||||
if (process.platform !== 'win32') {
|
||||
return
|
||||
}
|
||||
|
||||
it('throws an error when the id is invalid', function () {
|
||||
assert.throws(function () {
|
||||
systemPreferences.getColor('not-a-color')
|
||||
}, /Unknown color: not-a-color/)
|
||||
})
|
||||
|
||||
it('returns a hex RGB color string', function () {
|
||||
assert.equal(/^#[0-9A-F]{6}$/i.test(systemPreferences.getColor('window')), true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('systemPreferences.getUserDefault(key, type)', function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user