diff --git a/libaxolotl/test/fake_api.js b/libaxolotl/test/fake_api.js
new file mode 100644
index 000000000..722a33abc
--- /dev/null
+++ b/libaxolotl/test/fake_api.js
@@ -0,0 +1,43 @@
+'use strict';
+
+var testSessionMap = {};
+
+;(function() {
+ window.axolotl = window.axolotl || {};
+ window.axolotl.api = {
+ getMyRegistrationId: function() {
+ return window.myRegistrationId;
+ },
+ storage: {
+ put: function(key, value) {
+ if (value === undefined)
+ throw new Error("Tried to store undefined");
+ localStorage.setItem(key, textsecure.utils.jsonThing(value));
+ },
+ get: function(key, defaultValue) {
+ var value = localStorage.getItem(key);
+ if (value === null)
+ return defaultValue;
+ return JSON.parse(value);
+ },
+ remove: function(key) {
+ localStorage.removeItem(key);
+ },
+
+ sessions: {
+ get: function(identifier) {
+ return testSessionMap[identifier];
+ },
+ put: function(identifier, record) {
+ testSessionMap[identifier] = record;
+ }
+ }
+ },
+ updateKeys: function(keys) {
+ return textsecure.api.registerKeys(keys).catch(function(e) {
+ //TODO: Notify the user somehow?
+ console.error(e);
+ });
+ },
+ };
+})();
diff --git a/libaxolotl/test/index.html b/libaxolotl/test/index.html
index ec5143053..416814305 100644
--- a/libaxolotl/test/index.html
+++ b/libaxolotl/test/index.html
@@ -29,12 +29,22 @@
-
+
+
+
+
+
+
+
+
+
+
+