Merge pull request #7561 from electron/windows-system-colors

Support retrieving Windows system colors
This commit is contained in:
Cheng Zhao
2016-10-12 15:35:18 +09:00
committed by GitHub
8 changed files with 161 additions and 7 deletions

View File

@@ -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