Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4910)

Unified Diff: chrome/test/data/webui/event_target_test.html

Issue 17315020: Port passing closure tests for cr.ui framework to browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer feedback fixes. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698