<commit_before>var STORAGE_INTEGRATION_SPEC = function(storageId) { 
  var freedom, helper;

  beforeEach(function(done) {
    freedom = setupModule("relative://spec/helper/providers.json");
    helper = new ProviderHelper(freedom);
    helper.createProvider("s", storageId);
    helper.call("s", "clear", [], done);
  });

  afterEach(function() {
    cleanupIframes();
  });

  it("sets and gets keys", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "get", ["key"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      expect(ret).toEqual("myvalue");
      helper.call("s", "clear", [], done);
    };
    helper.call("s", "set", ["key", "myvalue"], callbackOne);
  });

  it("removes a key", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "remove", ["key"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      helper.call("s", "keys", [], callbackThree);
    };
    var callbackThree = function(ret) {
      expect(ret).toEqual([]);
      helper.call("s", "clear", [], done);
    };
    helper.call("s", "set", ["key", "myvalue"], callbackOne);
  });

  it("lists keys that have been set", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "set", ["k2", "v2"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      helper.call("s", "keys", [], callbackThree);
    };
    var callbackThree = function(ret) {
      expect(ret.length).toEqual(2);
      expect(ret).toContain("k1");
      expect(ret).toContain("k2");
      helper.call("s", "clear", [], done);
    };
    helper.call("s", "set", ["k1", "v1"], callbackOne);
  });

  it("clears the store", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "clear", [], callbackTwo);
    };
    var callbackTwo = function(ret) {
      helper.call("s", "keys", [], callbackThree);
    };
    var callbackThree = function(ret) {
      expect(ret.length).toEqual(0);
      done();
    };
    helper.call("s", "set", ["key", "value"], callbackOne);
  });

  it("shares data between different instances", function() {
    var callbackOne = function(ret) {
      helper.call("s2", "get", ["key"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      expect(ret).toEqual("value");
      helper.call("s", "clear", [], callbackThree);
    };
    var callbackThree = function(ret) {
      helper.call("s2", "clear", [], done);
    };
    helper.createProvider("s2", storageId);
    helper.call("s", "set", ["key", "value"], callbackOne);
  });
};<commit_msg>Fix bug in storage integration test<commit_after>var STORAGE_INTEGRATION_SPEC = function(storageId) { 
  var freedom, helper;

  beforeEach(function(done) {
    freedom = setupModule("relative://spec/helper/providers.json");
    helper = new ProviderHelper(freedom);
    helper.createProvider("s", storageId);
    helper.call("s", "clear", [], done);
  });

  afterEach(function() {
    cleanupIframes();
  });

  it("sets and gets keys", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "get", ["key"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      expect(ret).toEqual("myvalue");
      helper.call("s", "clear", [], done);
    };
    helper.call("s", "set", ["key", "myvalue"], callbackOne);
  });

  it("removes a key", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "remove", ["key"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      helper.call("s", "keys", [], callbackThree);
    };
    var callbackThree = function(ret) {
      expect(ret).toEqual([]);
      helper.call("s", "clear", [], done);
    };
    helper.call("s", "set", ["key", "myvalue"], callbackOne);
  });

  it("lists keys that have been set", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "set", ["k2", "v2"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      helper.call("s", "keys", [], callbackThree);
    };
    var callbackThree = function(ret) {
      expect(ret.length).toEqual(2);
      expect(ret).toContain("k1");
      expect(ret).toContain("k2");
      helper.call("s", "clear", [], done);
    };
    helper.call("s", "set", ["k1", "v1"], callbackOne);
  });

  it("clears the store", function(done) {
    var callbackOne = function(ret) {
      helper.call("s", "clear", [], callbackTwo);
    };
    var callbackTwo = function(ret) {
      helper.call("s", "keys", [], callbackThree);
    };
    var callbackThree = function(ret) {
      expect(ret.length).toEqual(0);
      done();
    };
    helper.call("s", "set", ["key", "value"], callbackOne);
  });

  it("shares data between different instances", function(done) {
    var callbackOne = function(ret) {
      helper.call("s2", "get", ["key"], callbackTwo);
    };
    var callbackTwo = function(ret) {
      expect(ret).toEqual("value");
      helper.call("s", "clear", [], callbackThree);
    };
    var callbackThree = function(ret) {
      helper.call("s2", "clear", [], done);
    };
    helper.createProvider("s2", storageId);
    helper.call("s", "set", ["key", "value"], callbackOne);
  });
};
{'fraction_non_alphanumeric': 0.2066822066822067, 'fraction_numerical': 0.004273504273504274, 'mean_word_length': 3.3341750841750843, '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': '1882596', 'n_tokens_mistral': 1646, 'n_tokens_neox': 1639, 'n_words': 337}