Add systemPreferences.isInvertedColorScheme API

This commit is contained in:
Kevin Sawicki 2016-10-06 15:27:24 -07:00
parent 2efb7a12cb
commit 7b49d94e9f
2 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include "atom/common/native_mate_converters/value_converter.h"
#include "atom/common/node_includes.h"
#include "native_mate/dictionary.h"
#include "ui/gfx/color_utils.h"
namespace atom {
@ -60,6 +61,8 @@ void SystemPreferences::BuildPrototype(
.SetMethod("isSwipeTrackingFromScrollEventsEnabled",
&SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled)
#endif
.SetMethod("isInvertedColorScheme",
&color_utils::IsInvertedColorScheme)
.SetMethod("isDarkMode", &SystemPreferences::IsDarkMode);
}

View file

@ -30,4 +30,10 @@ describe('systemPreferences module', function () {
assert(languages.length > 0)
})
})
describe('systemPreferences.isInvertedColorScheme()', function () {
it('returns a boolean', function () {
assert.equal(typeof systemPreferences.isInvertedColorScheme(), 'boolean')
})
})
})