Application-Settings: Non-blocking changes (#5091)

* fix(app-settings): changes are now non-blocking

* chore(app-settings): return result of flush to disk

* chore(app-settings): added test for flush
This commit is contained in:
Daniel Freiling
2017-12-05 22:38:18 +01:00
committed by Svetoslav
parent 634cf9a822
commit 1615061591
4 changed files with 30 additions and 10 deletions

View File

@@ -102,6 +102,16 @@ export var testClear = function () {
TKUnit.assert(!appSettings.hasKey(numberKey), "Failed to remove key: " + numberKey);
};
export var testFlush = function () {
appSettings.setString(stringKey, "String value");
// >> application-settings-flush
var flushed = appSettings.flush();
// will return boolean indicating whether flush to disk was successful
// << application-settings-flush
TKUnit.assert(flushed, "Flush failed: "+ flushed);
TKUnit.assert(appSettings.hasKey(stringKey), "There is no key: " + stringKey);
};
export var testInvalidKey = function () {
try {
appSettings.hasKey(undefined);