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

Side by Side Diff: tests/html/js_test.dart

Issue 25138003: Cache the context proxy. Don't use window for global 'this'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/js/dartium/js_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library jsTest; 5 library jsTest;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'dart:js'; 9 import 'dart:js';
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 static final BLUE = new Color._("blue"); 144 static final BLUE = new Color._("blue");
145 String _value; 145 String _value;
146 Color._(this._value); 146 Color._(this._value);
147 String toJs() => this._value; 147 String toJs() => this._value;
148 } 148 }
149 149
150 main() { 150 main() {
151 _injectJs(); 151 _injectJs();
152 useHtmlConfiguration(); 152 useHtmlConfiguration();
153 153
154 test('context instances should be identical', () {
155 var c1 = context;
156 var c2 = context;
157 expect(identical(c1, c2), isTrue);
158 });
159
154 test('read global field', () { 160 test('read global field', () {
155 expect(context['x'], equals(42)); 161 expect(context['x'], equals(42));
156 expect(context['y'], isNull); 162 expect(context['y'], isNull);
157 }); 163 });
158 164
159 test('read global field with underscore', () { 165 test('read global field with underscore', () {
160 expect(context['_x'], equals(123)); 166 expect(context['_x'], equals(123));
161 expect(context['y'], isNull); 167 expect(context['y'], isNull);
162 }); 168 });
163 169
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 context['dartDate'] = date; 466 context['dartDate'] = date;
461 expect(context['dartDate'], equals(date)); 467 expect(context['dartDate'], equals(date));
462 }); 468 });
463 469
464 test('usage of Serializable', () { 470 test('usage of Serializable', () {
465 final red = Color.RED; 471 final red = Color.RED;
466 context['color'] = red; 472 context['color'] = red;
467 expect(context['color'], equals(red._value)); 473 expect(context['color'], equals(red._value));
468 }); 474 });
469 } 475 }
OLDNEW
« no previous file with comments | « sdk/lib/js/dartium/js_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698