Add systemPreferences.isInvertedColorScheme API
authorKevin Sawicki <kevinsawicki@gmail.com>
Thu, 6 Oct 2016 22:27:24 +0000 (15:27 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 10 Oct 2016 17:43:08 +0000 (10:43 -0700)
atom/browser/api/atom_api_system_preferences.cc
spec/api-system-preferences-spec.js

index 6d3897b197be4c564c43701f4e8d9a8f3a07599b..0c7cbe2fba8d3915bc5e711404a7ea6bc22b7fbf 100644 (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);
 }
 
index 16992c31e1121fd51f04c05ec557ebe48ceeffcf..03bff26ad82e3239e38dfa94ab3c04529e7a061f 100644 (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')
+    })
+  })
 })