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

Side by Side Diff: LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js

Issue 746433002: Revive tests for Attr.ownerElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « LayoutTests/fast/dom/Attr/access-after-element-destruction-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 description("Tests that accessing Attr after its Element has been destroyed work s without crashing."); 1 description("Tests that accessing Attr after its Element has been destroyed work s without crashing.");
2 2
3 jsTestIsAsync = true; 3 jsTestIsAsync = true;
4 4
5 var element = document.createElement("p"); 5 var element = document.createElement("p");
6 element.setAttribute("a", "b"); 6 element.setAttribute("a", "b");
7 var attributes = element.attributes; 7 var attributes = element.attributes;
8 element = null; 8 element = null;
9 var attr = null; 9 var attr = null;
10 10
11 asyncGC(function() { 11 asyncGC(function() {
12 shouldBe("attributes.length", "1"); 12 shouldBe("attributes.length", "1");
13 shouldBe("attributes[0]", "attributes.item(0)"); 13 shouldBe("attributes[0]", "attributes.item(0)");
14 shouldBe("attributes.getNamedItem('a')", "attributes.item(0)"); 14 shouldBe("attributes.getNamedItem('a')", "attributes.item(0)");
15 15
16 shouldBe("attributes.item(0).name", "'a'"); 16 shouldBe("attributes.item(0).name", "'a'");
17 shouldBe("attributes.item(0).value", "'b'"); 17 shouldBe("attributes.item(0).value", "'b'");
18 shouldBe("attributes.item(0).ownerElement.tagName", "'P'");
18 19
19 attributes.item(0).value = 'c'; 20 attributes.item(0).value = 'c';
20 21
21 shouldBe("attributes.item(0).value", "'c'"); 22 shouldBe("attributes.item(0).value", "'c'");
22 23
23 attributes.removeNamedItem('a'); 24 attributes.removeNamedItem('a');
24 25
25 shouldBe("attributes.length", "0"); 26 shouldBe("attributes.length", "0");
26 27
27 element = document.createElement("p"); 28 element = document.createElement("p");
28 element.setAttribute("a", "b"); 29 element.setAttribute("a", "b");
29 attr = element.attributes.item(0); 30 attr = element.attributes.item(0);
30 element = null; 31 element = null;
31 32
32 asyncGC(function() { 33 asyncGC(function() {
33 34
34 shouldBe("attr.name", "'a'"); 35 shouldBe("attr.name", "'a'");
35 shouldBe("attr.value", "'b'"); 36 shouldBe("attr.value", "'b'");
37 shouldBe("attr.ownerElement.tagName", "'P'");
36 38
37 attr.value = 'c'; 39 attr.value = 'c';
38 40
39 shouldBe("attr.value", "'c'"); 41 shouldBe("attr.value", "'c'");
40 42
41 finishJSTest(); 43 finishJSTest();
42 }); 44 });
43 }); 45 });
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/Attr/access-after-element-destruction-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698