summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/login/test_util.js
blob: 5a0399ef236e95c2d4396691a7b0d285116a2d1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

cr.define('cr', function() {
  function ErrorStore() {
    var self = this;
    window.addEventListener('error', function(e) {
      self.store_.push(e);
    });
  }

  cr.addSingletonGetter(ErrorStore);

  ErrorStore.prototype = {
    store_: [],

    get length() {
      return this.store_.length;
    },
  };

  return {
    ErrorStore: ErrorStore,
  };
});

cr.ErrorStore.getInstance();