OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <link rel="import" href="resources/hello.html"> | 5 <link rel="import" href="resources/hello.html"> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <script> | 8 <script> |
9 description('Properties in imported dom nodes should be retained.'); | 9 description('Properties in imported dom nodes should be retained.'); |
10 | 10 |
| 11 var importedDocument; |
| 12 |
11 function getNodeInImport() { | 13 function getNodeInImport() { |
12 var importedDocument = document.querySelector('link').import; | 14 if (!importedDocument) |
| 15 importedDocument = document.querySelector('link').import; |
13 return importedDocument.querySelector('h1'); | 16 return importedDocument.querySelector('h1'); |
14 } | 17 } |
15 | 18 |
16 function test(gcFunction) { | 19 function test(gcFunction) { |
17 (function() { | 20 (function() { |
18 getNodeInImport().foo = 'Hello'; | 21 getNodeInImport().foo = 'Hello'; |
19 })(); | 22 })(); |
20 | 23 |
21 gcFunction(); | 24 gcFunction(); |
22 shouldBeEqualToString('getNodeInImport().foo', 'Hello'); | 25 shouldBeEqualToString('getNodeInImport().foo', 'Hello'); |
23 } | 26 } |
24 | 27 |
25 // The minor one should be first. The wrapped node is moved to older space other
wise. | 28 // The minor one should be first. The wrapped node is moved to older space other
wise. |
26 test(GCController.minorCollect.bind(GCController)); | 29 test(GCController.minorCollect.bind(GCController)); |
27 test(GCController.collectAll.bind(GCController)); | 30 test(GCController.collectAll.bind(GCController)); |
28 | 31 |
29 </script> | 32 </script> |
30 </body> | 33 </body> |
31 </html> | 34 </html> |
OLD | NEW |