Index: chrome/test/data/webui/event_target_test.html |
diff --git a/ui/webui/resources/js/cr/event_target_test.html b/chrome/test/data/webui/event_target_test.html |
similarity index 73% |
rename from ui/webui/resources/js/cr/event_target_test.html |
rename to chrome/test/data/webui/event_target_test.html |
index ec5f2f68695680e6d2ad1a4404c2180b59b45760..0bb11acbac23fb1d6a4e33fcf0e516bab115d431 100644 |
--- a/ui/webui/resources/js/cr/event_target_test.html |
+++ b/chrome/test/data/webui/event_target_test.html |
@@ -1,22 +1,18 @@ |
<!DOCTYPE html> |
<html> |
<head> |
-<!-- TODO(arv): Check in Closue unit tests and make this run as part of the |
- tests --> |
-<script src="http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js"></script> |
-<script src="../cr.js"></script> |
-<script src="event_target.js"></script> |
-<script> |
- |
-goog.require('goog.testing.jsunit'); |
- |
-</script> |
+<script src="webui_resource_test.js"></script> |
</head> |
<body> |
<script> |
-const EventTarget = cr.EventTarget; |
-const Event = cr.Event; |
+var EventTarget; |
Dan Beam
2013/06/20 17:57:46
nit: /** @const */
kevers
2013/06/20 18:41:37
Done.
|
+var Event; |
+ |
+function setUp(){ |
+ EventTarget = cr.EventTarget; |
+ Event = cr.Event; |
+} |
function testFunctionListener() { |
var fi = 0; |
@@ -36,15 +32,15 @@ function testFunctionListener() { |
// Adding again should not cause it to be called twice |
et.addEventListener('f', f); |
et.dispatchEvent(new Event('f')); |
- assertEquals('Should have been called once', 1, fi); |
+ assertEquals(1, fi, 'Should have been called once'); |
assertEquals(0, gi); |
et.removeEventListener('f', f); |
et.dispatchEvent(new Event('f')); |
- assertEquals('Should not have been called again', 1, fi); |
+ assertEquals(1, fi, 'Should not have been called again'); |
et.dispatchEvent(new Event('g')); |
- assertEquals('Should have been called once', 1, gi); |
+ assertEquals(1, gi, 'Should have been called once'); |
} |
function testHandleEvent() { |
@@ -69,15 +65,15 @@ function testHandleEvent() { |
// Adding again should not cause it to be called twice |
et.addEventListener('f', f); |
et.dispatchEvent(new Event('f')); |
- assertEquals('Should have been called once', 1, fi); |
+ assertEquals(1, fi, 'Should have been called once'); |
assertEquals(0, gi); |
et.removeEventListener('f', f); |
et.dispatchEvent(new Event('f')); |
- assertEquals('Should not have been called again', 1, fi); |
+ assertEquals(1, fi, 'Should not have been called again'); |
et.dispatchEvent(new Event('g')); |
- assertEquals('Should have been called once', 1, gi); |
+ assertEquals(1, gi, 'Should have been called once'); |
} |
function testPreventDefault() { |