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

Unified Diff: client/html/benchmarks/dromaeo/tests/DomQuery.dart

Issue 9845043: Rename client/{dom,html} to lib/{dom,html} . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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: client/html/benchmarks/dromaeo/tests/DomQuery.dart
===================================================================
--- client/html/benchmarks/dromaeo/tests/DomQuery.dart (revision 5796)
+++ client/html/benchmarks/dromaeo/tests/DomQuery.dart (working copy)
@@ -1,101 +0,0 @@
-class Main {
- static void main() {
- final int num = 40;
-
- // Try to force real results.
- var ret;
- window.on.load.add((Event evt) {
- String html = document.body.innerHTML;
-
- new Suite('dom-query')
- .prep(() {
- html = BenchUtil.replaceAll(html, 'id="test(\\w).*?"', (Match match) {
- final group = match.group(1);
- return 'id="test${group}${num}"';
- });
- html = BenchUtil.replaceAll(html, 'name="test.*?"', (Match match) {
- return 'name="test${num}"';
- });
- html = BenchUtil.replaceAll(html, 'class="foo.*?"', (Match match) {
- return 'class="foo test${num} bar"';
- });
- final div = new Element.tag('div');
- div.innerHTML = html;
- document.body.nodes.add(div);
- })
- .test('getElementById', () {
- for (int i = 0; i < num * 30; i++) {
- ret = document.query('#testA' + num).tagName;
- ret = document.query('#testB' + num).tagName;
- ret = document.query('#testC' + num).tagName;
- ret = document.query('#testD' + num).tagName;
- ret = document.query('#testE' + num).tagName;
- ret = document.query('#testF' + num).tagName;
- }
- })
- .test('getElementById (not in document)', () {
- for (int i = 0; i < num * 30; i++) {
- ret = document.query('#testA');
- ret = document.query('#testB');
- ret = document.query('#testC');
- ret = document.query('#testD');
- ret = document.query('#testE');
- ret = document.query('#testF');
- }
- })
- .test('getElementsByTagName(div)', () {
- for (int i = 0; i < num; i++) {
- var elems = document.queryAll('div');
- ret = elems[elems.length-1].nodeType;
- }
- })
- .test('getElementsByTagName(p)', () {
- for (int i = 0; i < num; i++) {
- final elems = document.queryAll('p');
- ret = elems[elems.length-1].nodeType;
- }
- })
- .test('getElementsByTagName(a)', () {
- for (int i = 0; i < num; i++) {
- var elems = document.queryAll('a');
- ret = elems[elems.length-1].nodeType;
- }
- })
- .test('getElementsByTagName(*)', () {
- for (int i = 0; i < num; i++) {
- var elems = document.queryAll('*');
- ret = elems[elems.length-1].nodeType;
- }
- })
- .test('getElementsByTagName (not in document)', () {
- for (int i = 0; i < num; i++) {
- var elems = document.queryAll('strong');
- ret = elems.length == 0;
- }
- })
- .test('getElementsByName', () {
- for (int i = 0; i < num * 20; i++) {
- var elems = document.queryAll('[name=test$num]');
- ret = elems[elems.length-1].nodeType;
- elems = document.queryAll('[name=test$num]');
- ret = elems[elems.length-1].nodeType;
- elems = document.queryAll('[name=test$num]');
- ret = elems[elems.length-1].nodeType;
- elems = document.queryAll('[name=test$num]');
- ret = elems[elems.length-1].nodeType;
- }
- })
- .test('getElementsByName (not in document)', () {
- for (int i = 0; i < num * 20; i++) {
- ret = document.queryAll('[name=test]').length == 0;
- ret = document.queryAll('[name=test]').length == 0;
- ret = document.queryAll('[name=test]').length == 0;
- ret = document.queryAll('[name=test]').length == 0;
- ret = document.queryAll('[name=test]').length == 0;
- }
- })
- .end();
- });
- }
-}
-
« no previous file with comments | « client/html/benchmarks/dromaeo/tests/DomModify.dart ('k') | client/html/benchmarks/dromaeo/tests/DomTraverse.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698