<commit_before>'use strict';

describe('XMLHttpRequest', function () {

  it('should work with onreadystatechange', function (done) {
    var req = new XMLHttpRequest();
    req.onreadystatechange = function () {
      expect(window.zone.parent).toBeDefined();
      done();
    };
    req.open('get', '/', true);
    req.send();
  });

  it('should work with onprogress', function (done) {
    var req = new XMLHttpRequest();
    req.onprogress = function () {
      expect(window.zone.parent).toBeDefined();
      done();
    };
    req.open('get', '/', true);
    req.send();
  });<commit_msg>test(XmlHttpRequest): fix expect() being called after done()<commit_after>'use strict';

describe('XMLHttpRequest', function () {

  it('should work with onreadystatechange', function (done) {
    var req = new XMLHttpRequest();
    var firstCall = true;
    req.onreadystatechange = function () {
      // Make sure that the callback will only be called once
      req.onreadystatechange = null;
      expect(window.zone.parent).toBeDefined();
      done();
    };
    req.open('get', '/', true);
    req.send();
  });

  it('should work with onprogress', function (done) {
    var req = new XMLHttpRequest();
    req.onprogress = function () {
      // Make sure that the callback will only be called once
      req.onprogress = null;
      expect(window.zone.parent).toBeDefined();
      done();
    };
    req.open('get', '/', true);
    req.send();
  });
{'fraction_non_alphanumeric': 0.16013745704467353, 'fraction_numerical': 0.0, 'mean_word_length': 3.033240997229917, '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': '4376828', 'n_tokens_mistral': 439, 'n_tokens_neox': 427, 'n_words': 109}