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

Unified Diff: samples/third_party/dromaeo/tests/dom-query-htmlidiomatic.dart

Issue 9732019: dart:html perf optimization based on runing Dromaeo benchmarks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes Created 8 years, 9 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
Index: samples/third_party/dromaeo/tests/dom-query-htmlidiomatic.dart
diff --git a/samples/third_party/dromaeo/tests/dom-query-html.dart b/samples/third_party/dromaeo/tests/dom-query-htmlidiomatic.dart
similarity index 71%
copy from samples/third_party/dromaeo/tests/dom-query-html.dart
copy to samples/third_party/dromaeo/tests/dom-query-htmlidiomatic.dart
index 8e590ecd7e663fb26f8e48a1c434a4be7f55215e..0a657dbfc5cbe95f2ad707004d7a27c8fd98d1c1 100644
--- a/samples/third_party/dromaeo/tests/dom-query-html.dart
+++ b/samples/third_party/dromaeo/tests/dom-query-htmlidiomatic.dart
@@ -30,12 +30,12 @@ void main() {
})
.test('getElementById', () {
for (int i = 0; i < num * 30; i++) {
- ret = document.query('#testA$num').hidden;
- ret = document.query('#testB$num').hidden;
- ret = document.query('#testC$num').hidden;
- ret = document.query('#testD$num').hidden;
- ret = document.query('#testE$num').hidden;
- ret = document.query('#testF$num').hidden;
+ ret = document.query('#testA$num').$dom_nodeType;
+ ret = document.query('#testB$num').$dom_nodeType;
+ ret = document.query('#testC$num').$dom_nodeType;
+ ret = document.query('#testD$num').$dom_nodeType;
+ ret = document.query('#testE$num').$dom_nodeType;
+ ret = document.query('#testF$num').$dom_nodeType;
}
})
.test('getElementById (not in document)', () {
@@ -50,44 +50,44 @@ void main() {
})
.test('getElementsByTagName(div)', () {
for (int i = 0; i < num; i++) {
- var elems = document.queryAll('div');
- ret = elems.last().hidden;
+ final elems = document.queryAll('div');
+ ret = elems.last().$dom_nodeType;
}
})
.test('getElementsByTagName(p)', () {
for (int i = 0; i < num; i++) {
final elems = document.queryAll('p');
- ret = elems.last().hidden;
+ ret = elems.last().$dom_nodeType;
}
})
.test('getElementsByTagName(a)', () {
for (int i = 0; i < num; i++) {
- var elems = document.queryAll('a');
- ret = elems.last().hidden;
+ final elems = document.queryAll('a');
+ ret = elems.last().$dom_nodeType;
}
})
.test('getElementsByTagName(*)', () {
for (int i = 0; i < num; i++) {
- var elems = document.queryAll('*');
- ret = elems.last().hidden;
+ final elems = document.queryAll('*');
+ ret = elems.last().$dom_nodeType;
}
})
.test('getElementsByTagName (not in document)', () {
for (int i = 0; i < num; i++) {
- var elems = document.queryAll('strong');
- ret = elems.length == 0;
+ final elems = document.queryAll('strong');
+ ret = elems.last().$dom_nodeType;
}
})
.test('getElementsByName', () {
for (int i = 0; i < num * 20; i++) {
- var elems = document.queryAll('[name="test$num"]');
- ret = elems.last().hidden;
+ ElementList elems = document.queryAll('[name="test$num"]');
+ ret = elems.last().$dom_nodeType;
elems = document.queryAll('[name="test$num"]');
- ret = elems.last().hidden;
+ ret = elems.last().$dom_nodeType;
elems = document.queryAll('[name="test$num"]');
- ret = elems.last().hidden;
+ ret = elems.last().$dom_nodeType;
elems = document.queryAll('[name="test$num"]');
- ret = elems.last().hidden;
+ ret = elems.last().$dom_nodeType;
}
})
.test('getElementsByName (not in document)', () {

Powered by Google App Engine
This is Rietveld 408576698