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

Unified Diff: pkg/mdv/test/node_bindings_test.dart

Issue 26734004: use symbol literals instead of const ctor in packages (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/mdv/test/mdv_test_utils.dart ('k') | pkg/mdv/test/template_element_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mdv/test/node_bindings_test.dart
diff --git a/pkg/mdv/test/node_bindings_test.dart b/pkg/mdv/test/node_bindings_test.dart
index 2609d9ce066c21f4f766c3077e4ee1411dc00048..c13e5881409ee2aabe12e7d421213238461b4ffc 100644
--- a/pkg/mdv/test/node_bindings_test.dart
+++ b/pkg/mdv/test/node_bindings_test.dart
@@ -19,8 +19,6 @@ main() {
group('Node Bindings', nodeBindingTests);
}
-sym(x) => new Symbol(x);
-
nodeBindingTests() {
var testDiv;
@@ -39,12 +37,12 @@ nodeBindingTests() {
text.bind('text', model, 'a');
expect(text.text, '1');
- model[sym('a')] = 2;
+ model[#a] = 2;
performMicrotaskCheckpoint();
expect(text.text, '2');
text.unbind('text');
- model[sym('a')] = 3;
+ model[#a] = 3;
performMicrotaskCheckpoint();
expect(text.text, '2');
@@ -61,17 +59,17 @@ nodeBindingTests() {
expect(element.attributes['hidden'], '');
expect(element.id, '2');
- model[sym('a')] = null;
+ model[#a] = null;
performMicrotaskCheckpoint();
expect(element.attributes, isNot(contains('hidden')),
reason: 'null is false-y');
- model[sym('a')] = false;
+ model[#a] = false;
performMicrotaskCheckpoint();
expect(element.attributes, isNot(contains('hidden')));
- model[sym('a')] = 'foo';
- model[sym('b')] = 'x';
+ model[#a] = 'foo';
+ model[#b] = 'x';
performMicrotaskCheckpoint();
expect(element.attributes, contains('hidden'));
expect(element.attributes['hidden'], '');
@@ -85,23 +83,23 @@ nodeBindingTests() {
el.bind('value', model, 'x');
expect(el.value, '42');
- model[sym('x')] = 'Hi';
+ model[#x] = 'Hi';
expect(el.value, '42', reason: 'changes delivered async');
performMicrotaskCheckpoint();
expect(el.value, 'Hi');
el.value = 'changed';
dispatchEvent('input', el);
- expect(model[sym('x')], 'changed');
+ expect(model[#x], 'changed');
el.unbind('value');
el.value = 'changed again';
dispatchEvent('input', el);
- expect(model[sym('x')], 'changed');
+ expect(model[#x], 'changed');
el.bind('value', model, 'x');
- model[sym('x')] = null;
+ model[#x] = null;
performMicrotaskCheckpoint();
expect(el.value, '');
}
@@ -116,20 +114,20 @@ nodeBindingTests() {
input.bind('checked', model, 'x');
expect(input.checked, true);
- model[sym('x')] = false;
+ model[#x] = false;
expect(input.checked, true);
performMicrotaskCheckpoint();
expect(input.checked, false,reason: 'model change should update checked');
input.checked = true;
dispatchEvent('change', input);
- expect(model[sym('x')], true, reason: 'input.checked should set model');
+ expect(model[#x], true, reason: 'input.checked should set model');
input.unbind('checked');
input.checked = false;
dispatchEvent('change', input);
- expect(model[sym('x')], true,
+ expect(model[#x], true,
reason: 'disconnected binding should not fire');
});
@@ -141,16 +139,16 @@ nodeBindingTests() {
input.bind('checked', model, 'x');
expect(input.checked, true);
- model[sym('x')] = false;
+ model[#x] = false;
expect(input.checked, true, reason: 'changes delivered async');
performMicrotaskCheckpoint();
expect(input.checked, false);
input.click();
- expect(model[sym('x')], true);
+ expect(model[#x], true);
performMicrotaskCheckpoint();
input.click();
- expect(model[sym('x')], false);
+ expect(model[#x], false);
});
}
« no previous file with comments | « pkg/mdv/test/mdv_test_utils.dart ('k') | pkg/mdv/test/template_element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698