aboutsummaryrefslogtreecommitdiff
path: root/contexts/data/lib/closure-library/closure/goog/debug/reflect_test.html
diff options
context:
space:
mode:
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/debug/reflect_test.html')
-rw-r--r--contexts/data/lib/closure-library/closure/goog/debug/reflect_test.html101
1 files changed, 0 insertions, 101 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/debug/reflect_test.html b/contexts/data/lib/closure-library/closure/goog/debug/reflect_test.html
deleted file mode 100644
index 1fa4c8e..0000000
--- a/contexts/data/lib/closure-library/closure/goog/debug/reflect_test.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-Copyright 2011 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.
--->
-<head>
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<title>Closure Unit Tests - goog.debug.reflect</title>
-<script src="../base.js"></script>
-<script>
- goog.require('goog.debug.reflect');
- goog.require('goog.testing.jsunit');
- goog.require('goog.userAgent');
-</script>
-</head>
-<body>
-<script>
-
-var typeOf = goog.debug.reflect.typeOf;
-var className = goog.debug.reflect.className;
-
-function testBasicTypes() {
- assertEquals('undefined', typeOf(undefined));
- assertEquals('null', typeOf(null));
- assertEquals('boolean', typeOf(false));
- assertEquals('number', typeOf(0));
- assertEquals('string', typeOf(''));
-
- assertUndefined(className(undefined));
- assertUndefined(className(null));
- assertUndefined(className(false));
- assertUndefined(className(0));
- assertUndefined(className(''));
-}
-
-function testWrapperTypes() {
- assertEquals('Boolean', typeOf(new Boolean(false)));
- assertEquals('Number', typeOf(new Number(0)));
- assertEquals('String', typeOf(new String('')));
-
- assertEquals('Boolean', className(Boolean));
- assertEquals('Number', className(Number));
- assertEquals('String', className(String));
-}
-
-function testBuiltInTypes() {
- assertEquals('Array', typeOf([]));
- assertEquals('Date', typeOf(new Date));
- assertEquals('Error', typeOf(new Error));
- assertEquals('Function', typeOf(function() {}));
- assertEquals('Object', typeOf({}));
- assertEquals('RegExp', typeOf(/./));
-
- assertEquals('Array', className(Array));
- assertEquals('Date', className(Date));
- assertEquals('Error', className(Error));
- assertEquals('Object', className(Object));
-}
-
-function testGoogProvidedTypes() {
- // Force type map reinitialization with the goog.provided types.
- delete goog.debug.reflect.typeMap_;
-
- goog.provide('x.a');
- x.a = function() {};
- x.a.b = function() {};
-
- assertEquals('Object', typeOf(x));
- assertEquals('x.a', typeOf(new x.a));
- assertEquals('Object', typeOf(new x.a.b));
-
- assertUndefined(className(x));
- assertEquals('x.a', className(x.a));
- assertUndefined(className(x.a.b));
-}
-
-function testUnregisteredTypes() {
- var oldIE = goog.userAgent.IE && !goog.userAgent.isVersion(8);
- assertEquals(oldIE ? 'ActiveXObject' : 'HTMLDocument', typeOf(document));
-
- var expectedTypeOfBody = oldIE ? 'ActiveXObject' : 'HTMLBodyElement';
- assertEquals(expectedTypeOfBody, typeOf(document.body));
-
- var expectedTypeOfWindow = 'Window';
- if (goog.userAgent.WEBKIT || goog.userAgent.OPERA) {
- // Note: window.constructor.name is 'DOMWindow' in Chrome but the type
- // DOMWindow is not exposed to JavaScript.
- expectedTypeOfWindow = 'Object';
- }
- if (oldIE) {
- expectedTypeOfWindow = 'ActiveXObject';
- }
- assertEquals(expectedTypeOfWindow, typeOf(window));
-}
-
-</script>
-</body>
-</html>