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

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: Fix nits. 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
« no previous file with comments | « chrome/test/data/webui/array_data_model_test.html ('k') | chrome/test/data/webui/grid_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..80dfc2a685960d421da16de26ef302755bc8351b 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;
+/* @const */ var EventTarget;
+/* @const */ 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() {
« no previous file with comments | « chrome/test/data/webui/array_data_model_test.html ('k') | chrome/test/data/webui/grid_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698