<commit_before>// freedom-mocks.js
/* global console: false */
"use strict";

function MockStorage(init_store) {
  this._store = init_store;
}
MockStorage.prototype.get = function(key) {
  var v = this._store[key];
  //console.log("\nMockStorage.prototype.get(" + key + "): " + this._store[key]);
  return { done: function (callback) { if(callback) callback(v); } };
};
MockStorage.prototype.set = function(key, value) {
  this._store[key] = value;
  //console.log("\nMockStorage.prototype.set(" + key + "): " + this._store[key]);
  return { done: function (callback) { if(callback) callback(); } };
};
MockStorage.prototype.remove = function(key) {
  //console.log("\nMockStorage.prototype.remove(" + key + ").");
  delete this._store[key];
  return { done: function (callback) { if(callback) callback(); } };
};
MockStorage.prototype.clear = function() {
  this._store = {};
  //console.log("\nMockStorage.prototype.clear.");
  return { done: function (callback) { if(callback) callback(); } };
};

// --
function MockChannel() {}
MockChannel.prototype.on = function (eventTypeString, callback) {
  return null;
};
MockChannel.prototype.emit = function (eventTypeString, value) {
  return null;
};

var freedom = new MockChannel();
freedom.storage = function () { return new MockStorage({}); };

freedom.identity = function () { return new MockChannel(); };
freedom.uproxyclient = function () { return new MockChannel(); };
freedom.uproxyserver = function () { return new MockChannel(); };

var DEBUG = true;

var log = console;
<commit_msg>fix jasmine test for socksrtc<commit_after>// freedom-mocks.js
/* global console: false */
"use strict";

function MockStorage(init_store) {
  this._store = init_store;
}
MockStorage.prototype.get = function(key) {
  var v = this._store[key];
  //console.log("\nMockStorage.prototype.get(" + key + "): " + this._store[key]);
  return { done: function (callback) { if(callback) callback(v); } };
};
MockStorage.prototype.set = function(key, value) {
  this._store[key] = value;
  //console.log("\nMockStorage.prototype.set(" + key + "): " + this._store[key]);
  return { done: function (callback) { if(callback) callback(); } };
};
MockStorage.prototype.remove = function(key) {
  //console.log("\nMockStorage.prototype.remove(" + key + ").");
  delete this._store[key];
  return { done: function (callback) { if(callback) callback(); } };
};
MockStorage.prototype.clear = function() {
  this._store = {};
  //console.log("\nMockStorage.prototype.clear.");
  return { done: function (callback) { if(callback) callback(); } };
};

// --
function MockChannel() {}
MockChannel.prototype.on = function (eventTypeString, callback) {
  return null;
};
MockChannel.prototype.emit = function (eventTypeString, value) {
  return null;
};

var freedom = new MockChannel();
freedom.storage = function () { return new MockStorage({}); };

freedom.identity = function () { return new MockChannel(); };
freedom['SocksToRtc'] = function () { return new MockChannel(); };
freedom['RtcToNet'] = function () { return new MockChannel(); };

var DEBUG = true;

var log = console;

{'fraction_non_alphanumeric': 0.18117343649258544, 'fraction_numerical': 0.0, 'mean_word_length': 4.550983899821109, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3846372', 'n_tokens_mistral': 947, 'n_tokens_neox': 943, 'n_words': 214}