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

Unified Diff: client/tests/client/dom/HTMLElementTest.dart

Issue 10191033: test renaming overhaul: step 4 client tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « client/tests/client/dom/HTMLCollectionTest.dart ('k') | client/tests/client/dom/HiddenDom1Test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/client/dom/HTMLElementTest.dart
diff --git a/client/tests/client/dom/HTMLElementTest.dart b/client/tests/client/dom/HTMLElementTest.dart
deleted file mode 100644
index f97e07052852aed616d746482b54d23f93765a84..0000000000000000000000000000000000000000
--- a/client/tests/client/dom/HTMLElementTest.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-#library('HTMLElementTest');
-#import('../../../../lib/unittest/unittest.dart');
-#import('../../../../lib/unittest/dom_config.dart');
-#import('dart:dom');
-
-main() {
- useDomConfiguration();
- test('InnerHTML', () {
- HTMLElement element = document.createElement('div');
- element.id = 'test';
- element.innerHTML = 'Hello World';
- document.body.appendChild(element);
-
- element = document.getElementById('test');
- Expect.stringEquals('Hello World', element.innerHTML);
- document.body.removeChild(element);
- });
- test('HTMLTable', () {
- HTMLElement table = document.createElement('table');
-
- HTMLTableRowElement row = document.createElement('tr');
- table.appendChild(row);
-
- row.appendChild(document.createElement('td'));
- row.appendChild(document.createElement('td'));
-
- Expect.equals(2, row.cells.length);
-
- HTMLTableRowElement headerRow = table.rows.item(0);
- Expect.equals(2, headerRow.cells.length);
- });
- test('Dataset', () {
- HTMLElement div = document.createElement('div');
-
- Expect.isTrue(div.dataset.isEmpty());
- Expect.equals('', div.dataset['foo']);
- Expect.isTrue(div.dataset.isEmpty());
-
- div.dataset['foo'] = 'foo-value';
- Expect.equals('foo-value', div.dataset['foo']);
- Expect.isFalse(div.dataset.isEmpty());
-
- Expect.isTrue(div.dataset.containsValue('foo-value'));
- Expect.isFalse(div.dataset.containsValue('bar-value'));
- Expect.isTrue(div.dataset.containsKey('foo'));
- Expect.isFalse(div.dataset.containsKey('bar'));
-
- bool hasBeenInvoked;
- String f() {
- hasBeenInvoked = true;
- return 'bar-value';
- }
-
- hasBeenInvoked = false;
- Expect.equals('bar-value', div.dataset.putIfAbsent('bar', f));
- Expect.isTrue(hasBeenInvoked);
-
- hasBeenInvoked = false;
- Expect.equals('bar-value', div.dataset.putIfAbsent('bar', f));
- Expect.isFalse(hasBeenInvoked);
-
- final keys = <String> [];
- final values = <String> [];
- div.dataset.forEach(void f(String key, String value) {
- keys.add(key);
- values.add(value);
- });
- Expect.setEquals(const <String> ['foo', 'bar'], keys);
- Expect.setEquals(const <String> ['foo-value', 'bar-value'], values);
-
- Expect.setEquals(const <String> ['foo', 'bar'],
- new List<String>.from(div.dataset.getKeys()));
- Expect.setEquals(const <String> ['foo-value', 'bar-value'],
- new List<String>.from(div.dataset.getValues()));
-
- Expect.equals(2, div.dataset.length);
- Expect.isFalse(div.dataset.isEmpty());
-
- Expect.isNull(div.dataset.remove('qux'));
- Expect.equals(2, div.dataset.length);
- Expect.isFalse(div.dataset.isEmpty());
-
- Expect.equals('foo-value', div.dataset.remove('foo'));
- Expect.equals(1, div.dataset.length);
- Expect.isFalse(div.dataset.isEmpty());
-
- div.dataset.clear();
- Expect.equals(0, div.dataset.length);
- Expect.isTrue(div.dataset.isEmpty());
- });
-}
« no previous file with comments | « client/tests/client/dom/HTMLCollectionTest.dart ('k') | client/tests/client/dom/HiddenDom1Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698