Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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('DocumentFragmentTest'); | 5 #library('DocumentFragmentTest'); |
| 6 #import('../../lib/unittest/unittest.dart'); | 6 #import('../../lib/unittest/unittest.dart'); |
| 7 #import('../../lib/unittest/html_config.dart'); | 7 #import('../../lib/unittest/html_config.dart'); |
| 8 #import('dart:html'); | 8 #import('dart:html'); |
| 9 #source('util.dart'); | 9 #source('util.dart'); |
| 10 | 10 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 test('beforeEnd inserts the HTML', () { | 273 test('beforeEnd inserts the HTML', () { |
| 274 var fragment = getFragment(); | 274 var fragment = getFragment(); |
| 275 fragment.insertAdjacentHTML("beforeEnd", "<br>foo"); | 275 fragment.insertAdjacentHTML("beforeEnd", "<br>foo"); |
| 276 Expect.equals("<a>foo</a><br>foo", fragment.innerHTML); | 276 Expect.equals("<a>foo</a><br>foo", fragment.innerHTML); |
| 277 }); | 277 }); |
| 278 }); | 278 }); |
| 279 | 279 |
| 280 // Just test that these methods don't throw errors | 280 // Just test that these methods don't throw errors |
| 281 test("no-op methods don't throw errors", () { | 281 test("no-op methods don't throw errors", () { |
| 282 var fragment = new DocumentFragment(); | 282 var fragment = new DocumentFragment(); |
| 283 fragment.on.click.add((e) => null); | 283 fragment.on['click'].add((e) => null); |
|
sra1
2012/05/14 17:29:15
Why does on.click. no longer work?
podivilov
2012/05/15 10:24:26
It looks like DocumentFragment shouldn't declare o
| |
| 284 fragment.blur(); | 284 fragment.blur(); |
| 285 fragment.focus(); | 285 fragment.focus(); |
| 286 fragment.click(); | 286 fragment.click(); |
| 287 fragment.scrollByLines(2); | 287 fragment.scrollByLines(2); |
| 288 fragment.scrollByPages(2); | 288 fragment.scrollByPages(2); |
| 289 fragment.scrollIntoView(); | 289 fragment.scrollIntoView(); |
| 290 fragment.webkitRequestFullScreen(2); | 290 fragment.webkitRequestFullScreen(2); |
| 291 }); | 291 }); |
| 292 | 292 |
| 293 asyncTest('default values', 1, () { | 293 asyncTest('default values', 1, () { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 // // assertConstError(() => fragment.classes.add('foo')); | 346 // // assertConstError(() => fragment.classes.add('foo')); |
| 347 // }); | 347 // }); |
| 348 | 348 |
| 349 test('query searches the fragment', () { | 349 test('query searches the fragment', () { |
| 350 var fragment = new DocumentFragment.html( | 350 var fragment = new DocumentFragment.html( |
| 351 "<div class='foo'><a>foo</a><b>bar</b></div>"); | 351 "<div class='foo'><a>foo</a><b>bar</b></div>"); |
| 352 Expect.equals("A", fragment.query(".foo a").tagName); | 352 Expect.equals("A", fragment.query(".foo a").tagName); |
| 353 Expect.listEquals(["A", "B"], _nodeStrings(fragment.queryAll(".foo *"))); | 353 Expect.listEquals(["A", "B"], _nodeStrings(fragment.queryAll(".foo *"))); |
| 354 }); | 354 }); |
| 355 } | 355 } |
| OLD | NEW |