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

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

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Forgot to upload before committing 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/corelib/set_retainAll_test.dart ('k') | tests/lib/async/stream_first_where_test.dart » ('j') | 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 custom_element_bindings_test; 5 library custom_element_bindings_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'package:mdv_observe/mdv_observe.dart'; 9 import 'package:mdv_observe/mdv_observe.dart';
10 import 'package:unittest/html_config.dart'; 10 import 'package:unittest/html_config.dart';
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 void unbindAll() => real.unbindAll(); 254 void unbindAll() => real.unbindAll();
255 } 255 }
256 256
257 // TODO(jmesserly): would be nice to use mocks when mirrors work on dart2js. 257 // TODO(jmesserly): would be nice to use mocks when mirrors work on dart2js.
258 class AttributeMapWrapper<K, V> implements Map<K, V> { 258 class AttributeMapWrapper<K, V> implements Map<K, V> {
259 final List log = []; 259 final List log = [];
260 Map<K, V> _map; 260 Map<K, V> _map;
261 261
262 AttributeMapWrapper(this._map); 262 AttributeMapWrapper(this._map);
263 263
264 bool containsValue(V value) => _map.containsValue(value); 264 bool containsValue(Object value) => _map.containsValue(value);
265 bool containsKey(K key) => _map.containsKey(key); 265 bool containsKey(Object key) => _map.containsKey(key);
266 V operator [](K key) => _map[key]; 266 V operator [](Object key) => _map[key];
267 267
268 void operator []=(K key, V value) { 268 void operator []=(K key, V value) {
269 log.add(['[]=', key, value]); 269 log.add(['[]=', key, value]);
270 _map[key] = value; 270 _map[key] = value;
271 } 271 }
272 272
273 V putIfAbsent(K key, V ifAbsent()) => _map.putIfAbsent(key, ifAbsent); 273 V putIfAbsent(K key, V ifAbsent()) => _map.putIfAbsent(key, ifAbsent);
274 274
275 V remove(K key) { 275 V remove(Object key) {
276 log.add(['remove', key]); 276 log.add(['remove', key]);
277 _map.remove(key); 277 _map.remove(key);
278 } 278 }
279 279
280 void clear() => _map.clear(); 280 void clear() => _map.clear();
281 void forEach(void f(K key, V value)) => _map.forEach(f); 281 void forEach(void f(K key, V value)) => _map.forEach(f);
282 Iterable<K> get keys => _map.keys; 282 Iterable<K> get keys => _map.keys;
283 Iterable<V> get values => _map.values; 283 Iterable<V> get values => _map.values;
284 int get length => _map.length; 284 int get length => _map.length;
285 bool get isEmpty => _map.isEmpty; 285 bool get isEmpty => _map.isEmpty;
286 bool get isNotEmpty => _map.isNotEmpty; 286 bool get isNotEmpty => _map.isNotEmpty;
287 } 287 }
OLDNEW
« no previous file with comments | « tests/corelib/set_retainAll_test.dart ('k') | tests/lib/async/stream_first_where_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698