summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/chromeos/login/test_util.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/chromeos/login/test_util.js')
-rw-r--r--chromium/chrome/browser/resources/chromeos/login/test_util.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/chromium/chrome/browser/resources/chromeos/login/test_util.js b/chromium/chrome/browser/resources/chromeos/login/test_util.js
new file mode 100644
index 00000000000..5a0399ef236
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/login/test_util.js
@@ -0,0 +1,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();