aboutsummaryrefslogtreecommitdiff
path: root/contexts/data/lib/closure-library/closure/goog/debug/entrypointregistry_test.html
diff options
context:
space:
mode:
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/debug/entrypointregistry_test.html')
-rw-r--r--contexts/data/lib/closure-library/closure/goog/debug/entrypointregistry_test.html87
1 files changed, 0 insertions, 87 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/debug/entrypointregistry_test.html b/contexts/data/lib/closure-library/closure/goog/debug/entrypointregistry_test.html
deleted file mode 100644
index 0323491..0000000
--- a/contexts/data/lib/closure-library/closure/goog/debug/entrypointregistry_test.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-Copyright 2010 The Closure Library Authors. All Rights Reserved.
-
-Use of this source code is governed by the Apache License, Version 2.0.
-See the COPYING file for details.
--->
-<!--
- Author: nicksantos@google.com (Nick Santos)
--->
-<head>
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<title>Closure Unit Tests - goog.debug.entryPointRegistry</title>
-<script src="../base.js"></script>
-<script>
- goog.require('goog.testing.jsunit');
- goog.require('goog.debug.ErrorHandler');
- goog.require('goog.debug.entryPointRegistry');
-</script>
-</head>
-<body>
-<script>
-
-var lastError;
-var errorHandler;
-var errorFn;
-
-function setUp() {
- lastError = null;
- errorFn = function(message) {
- throw {message: message};
- };
- errorHandler = new goog.debug.ErrorHandler(function(ex) {
- lastError = ex;
- });
- goog.debug.entryPointRegistry.refList_ = [];
-}
-
-function testMonitorAndUnmonitor() {
- goog.debug.entryPointRegistry.register(function(transformer) {
- errorFn = transformer(errorFn);
- });
- goog.debug.entryPointRegistry.monitorAll(errorHandler);
-
- var e = assertThrows('expected error', goog.partial(errorFn, 'Hello!'));
- assertEquals('Error in protected function: Hello!', e.message);
- assertEquals('Hello!', lastError.message);
-
- goog.debug.entryPointRegistry.unmonitorAllIfPossible(errorHandler);
-
- e = assertThrows('expected error', goog.partial(errorFn, 'Goodbye!'));
- assertEquals('Goodbye!', e.message);
- assertEquals('Hello!', lastError.message);
-}
-
-function testRegisterAfterMonitor() {
- goog.debug.entryPointRegistry.monitorAll(errorHandler);
- goog.debug.entryPointRegistry.register(function(transformer) {
- errorFn = transformer(errorFn);
- });
-
- var e = assertThrows('expected error', goog.partial(errorFn, 'Hello!'));
- assertEquals('Error in protected function: Hello!', e.message);
- assertEquals('Hello!', lastError.message);
-
- goog.debug.entryPointRegistry.unmonitorAllIfPossible(errorHandler);
-
- e = assertThrows('expected error', goog.partial(errorFn, 'Goodbye!'));
- assertEquals('Goodbye!', e.message);
- assertEquals('Hello!', lastError.message);
-}
-
-function testInvalidUnmonitor() {
- goog.debug.entryPointRegistry.monitorAll(errorHandler);
- var e = assertThrows('expected error', goog.partial(
- goog.debug.entryPointRegistry.unmonitorAllIfPossible,
- new goog.debug.ErrorHandler()));
- assertEquals(
- 'Assertion failed: Only the most recent monitor can be unwrapped.',
- e.message);
- goog.debug.entryPointRegistry.unmonitorAllIfPossible(errorHandler);
-}
-
-</script>
-</body>
-</html>