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

Side by Side Diff: LayoutTests/fast/dom/MicroData/itemref-add-remove-tokens.html

Issue 14028014: Remove MicroData implementation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Also delete all the tests Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 <script src="resources/microdata-common.js"></script>
6 </head>
7 <body>
8 <p>This tests that itemRef attribute must update correctly when token have been added or removed.</p>
9 <div id="console"></div>
10 <script>
11 var element = createElement('div', {});
12
13 debug("itemRef.add must reflect correctly.");
14 element.itemRef.add('foo');
15 element.itemRef.add('FOO');
16 shouldBeTrue("element.itemRef.length == 2");
17 shouldBe("element.itemRef.toString()", "'foo FOO'");
18 shouldBe("element.itemRef[0]", "'foo'");
19 shouldBe("element.itemRef[1]", "'FOO'");
20
21 debug("<br>itemRef.add must not make any changes if an existing token is added." );
22 element.itemRef.add('foo');
23 shouldBeTrue("element.itemRef.length == 2");
24 shouldBe("element.itemRef.toString()", "'foo FOO'");
25
26 debug("<br>itemRef.remove must reflect correctly.");
27 element.itemRef.remove('foo');
28 shouldBeTrue("element.itemRef.length == 1");
29 shouldBe("element.itemRef.toString()", "'FOO'");
30 shouldBeFalse("element.itemRef.contains('foo')");
31
32 debug("<br>itemRef.remove must not make any changes if a non-existing token is r emoved.");
33 element.itemRef.remove('foo');
34 shouldBeTrue("element.itemRef.length == 1");
35 shouldBe("element.itemRef.toString()", "'FOO'");
36 shouldBeFalse("element.itemRef.contains('foo')");
37
38 debug("<br>itemRef.length must be 0 when all tokens are removed.");
39 element.itemRef.remove('FOO');
40 shouldBeTrue("element.itemRef.length == 0");
41 shouldBeFalse("element.itemRef.contains('foo')");
42 shouldBeFalse("element.itemRef.contains('FOO')");
43
44 </script>
45 <script src="../../js/resources/js-test-post.js"></script>
46 </body>
47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698