diff --git a/spec/theme-manager-spec.coffee b/spec/theme-manager-spec.coffee index 318aca32b..b8050a1d5 100644 --- a/spec/theme-manager-spec.coffee +++ b/spec/theme-manager-spec.coffee @@ -310,3 +310,17 @@ describe "ThemeManager", -> runs -> expect(console.warn.callCount).toBe 1 expect(console.warn.argsForCall[0][0].length).toBeGreaterThan 0 + + describe "when in safemode", -> + beforeEach -> + themeManager = new ThemeManager({packageManager: atom.packages, resourcePath, configDirPath, safeMode: true}) + + it "loads the defaults themes", -> + waitsForPromise -> + themeManager.activateThemes() + + runs -> + activeThemeNames = themeManager.getActiveNames() + expect(activeThemeNames.length).toBe(2) + expect(activeThemeNames).toContain('atom-dark-ui') + expect(activeThemeNames).toContain('atom-dark-syntax') diff --git a/src/atom.coffee b/src/atom.coffee index 63d4ee7e8..00c9e92a1 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -156,7 +156,7 @@ class Atom extends Model @keymaps = new KeymapManager({configDirPath, resourcePath}) @keymap = @keymaps # Deprecated @packages = new PackageManager({devMode, configDirPath, resourcePath, safeMode}) - @themes = new ThemeManager({packageManager: @packages, configDirPath, resourcePath}) + @themes = new ThemeManager({packageManager: @packages, configDirPath, resourcePath, safeMode}) @contextMenu = new ContextMenuManager(devMode) @menu = new MenuManager({resourcePath}) @clipboard = new Clipboard() diff --git a/src/theme-manager.coffee b/src/theme-manager.coffee index a2ae01763..fdf7b006f 100644 --- a/src/theme-manager.coffee +++ b/src/theme-manager.coffee @@ -16,7 +16,7 @@ module.exports = class ThemeManager Emitter.includeInto(this) - constructor: ({@packageManager, @resourcePath, @configDirPath}) -> + constructor: ({@packageManager, @resourcePath, @configDirPath, @safeMode}) -> @lessCache = null @packageManager.registerPackageActivator(this, ['theme']) @@ -46,6 +46,7 @@ class ThemeManager # # Returns an array of theme names in the order that they should be activated. getEnabledThemeNames: -> + return ['atom-dark-ui', 'atom-dark-syntax'] if @safeMode themeNames = atom.config.get('core.themes') ? [] themeNames = [themeNames] unless _.isArray(themeNames) themeNames = themeNames.filter (themeName) ->