window.localStorage.setItem(`__chrome.storage.${storageType}__`, json)
}
+const scheduleCallback = (items, callback) => {
+ setTimeout(function () {
+ callback(items)
+ })
+}
+
const getStorageManager = (storageType) => {
return {
get (keys, callback) {
const storage = getStorage(storageType)
- if (keys == null) return storage
+ if (keys == null) return scheduleCallback(storage, callback)
let defaults = {}
switch (typeof keys) {
}
break
}
- if (keys.length === 0) return {}
+ if (keys.length === 0) return scheduleCallback({}, callback)
let items = {}
keys.forEach(function (key) {
if (value == null) value = defaults[key]
items[key] = value
})
-
- setTimeout(function () {
- callback(items)
- })
+ scheduleCallback(items, callback)
},
set (items, callback) {
}, /Unexpected token }/)
})
- describe.only('when the devtools is docked', function () {
+ describe('when the devtools is docked', function () {
it('creates the extension', function (done) {
w.webContents.openDevTools({mode: 'bottom'})