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

Side by Side Diff: client/tests/client/samples/dartcombat/dartcombat_tests.dart

Issue 8835006: New version of dart:html (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 #library('dartcombat_tests'); 6 #library('dartcombat_tests');
7 7
8 #import('dart:html'); 8 #import('dart:html');
9 #import('../../../../testing/unittest/unittest.dart'); 9 #import('../../../../testing/unittest/unittest.dart');
10 #import('../../../../samples/dartcombat/dartcombatlib.dart'); 10 #import('../../../../samples/dartcombat/dartcombatlib.dart');
11 11
12 ReceivePort testPort; 12 ReceivePort testPort;
13 13
14 main() { 14 main() {
15 testPort = new ReceivePort(); 15 testPort = new ReceivePort();
16 16
17 setupUI(); 17 setupUI();
18 // add relative URL to stylesheet to the correct location. Note: The CSS is 18 // add relative URL to stylesheet to the correct location. Note: The CSS is
19 // needed because the app uses a flexbox layout, which is then used to 19 // needed because the app uses a flexbox layout, which is then used to
20 // interpret UI events (mousedown/up/click). 20 // interpret UI events (mousedown/up/click).
21 var link = document.createElement('link'); 21 var link = new Element.tag('link');
22 link.rel = 'stylesheet'; 22 link.rel = 'stylesheet';
23 link.type = 'text/css'; 23 link.type = 'text/css';
24 link.href = '../../samples/dartcombat/dartcombat.css'; 24 link.href = '../../samples/dartcombat/dartcombat.css';
25 document.head.nodes.add(link); 25 document.head.nodes.add(link);
26 26
27 asyncTest('wait until setup', 1, () { 27 asyncTest('wait until setup', 1, () {
28 int playersReady = 0; 28 int playersReady = 0;
29 testPort.receive((message, SendPort reply) { 29 testPort.receive((message, SendPort reply) {
30 if (message[0] == '_TEST:handleSetup') { 30 if (message[0] == '_TEST:handleSetup') {
31 playersReady++; 31 playersReady++;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 doMouseEvent(String type, var targetCell) { 142 doMouseEvent(String type, var targetCell) {
143 final point = window.webkitConvertPointFromNodeToPage(targetCell, 143 final point = window.webkitConvertPointFromNodeToPage(targetCell,
144 new Point(5, 5)); 144 new Point(5, 5));
145 145
146 MouseEvent e = new MouseEvent(type, window, 0, 0, 0, point.x, point.y, 0, 146 MouseEvent e = new MouseEvent(type, window, 0, 0, 0, point.x, point.y, 0,
147 relatedTarget: targetCell); 147 relatedTarget: targetCell);
148 targetCell.on[type].dispatch(e); 148 targetCell.on[type].dispatch(e);
149 } 149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698