OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 <div id="test"> | 5 <div id="test"> |
6 </div> | 6 </div> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description('Test the extraction of the text surrounding an element.'); | 10 description('Test the extraction of the text surrounding an element.'); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 0, 100)', '12345 6789 12345 6789'); | 48 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 0, 100)', '12345 6789 12345 6789'); |
49 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 5, 6)', '89 123'); | 49 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 5, 6)', '89 123'); |
50 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 5, 0)', ''); | 50 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 5, 0)', ''); |
51 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 5, 1)', '1'); | 51 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 5, 1)', '1'); |
52 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 6, 2)', '12'); | 52 shouldBeEqualToString('surroundingText(\'<button>.</button>12345<p id="here"
>6789 12345</p>6789<button>.</button>\', 6, 2)', '12'); |
53 shouldBeEqualToString('surroundingText(\'<select>.</select><div>57th Street
and Lake Shore Drive</div> <span>Chicago</span> <span id="here">IL</span> <span>
60637</span><select>.</select>\', 0, 100)', '57th Street and Lake Shore Drive Ch
icago IL 60637'); | 53 shouldBeEqualToString('surroundingText(\'<select>.</select><div>57th Street
and Lake Shore Drive</div> <span>Chicago</span> <span id="here">IL</span> <span>
60637</span><select>.</select>\', 0, 100)', '57th Street and Lake Shore Drive Ch
icago IL 60637'); |
54 shouldBeEqualToString('surroundingText(\'<fieldset>.</fieldset>12345<button>
abc</button><p>6789<br id="here"/>12345</p>6789<textarea>abc</textarea>0123<fiel
dset>.</fieldset>\', 0, 100)', '6789 12345 6789'); | 54 shouldBeEqualToString('surroundingText(\'<fieldset>.</fieldset>12345<button>
abc</button><p>6789<br id="here"/>12345</p>6789<textarea>abc</textarea>0123<fiel
dset>.</fieldset>\', 0, 100)', '6789 12345 6789'); |
55 shouldBeEqualToString('surroundingText(\'<button>.</button><div id="here">Th
is is <!-- comment --!>a test <\' + \'script language="javascript"><\' + \'/scri
pt>example<button>.</button>\', 0, 100)', 'This is a test example'); | 55 shouldBeEqualToString('surroundingText(\'<button>.</button><div id="here">Th
is is <!-- comment --!>a test <\' + \'script language="javascript"><\' + \'/scri
pt>example<button>.</button>\', 0, 100)', 'This is a test example'); |
56 shouldBeEqualToString('surroundingText(\'<button>.</button><div id="here">01
2345678901234567890123456789</div><button>.</button>\', 15, 12)', '901234567890'
); | 56 shouldBeEqualToString('surroundingText(\'<button>.</button><div id="here">01
2345678901234567890123456789</div><button>.</button>\', 15, 12)', '901234567890'
); |
57 shouldBeEqualToString('surroundingText(\'<option>.</option>12345<button id="
here">test</button><option>.</option>\', 0, 100)', ''); | 57 shouldBeEqualToString('surroundingText(\'<option>.</option>12345<button id="
here">test</button><option>.</option>\', 1, 100)', ''); |
58 shouldBeEqualToString('surroundingText(\'<option>.</option>12345<button>te<s
pan id="here">st</span></button><option>.</option>\', 0, 100)', ''); | 58 shouldBeEqualToString('surroundingText(\'<option>.</option>12345<button>te<s
pan id="here">st</span></button><option>.</option>\', 1, 100)', ''); |
59 shouldBeEqualToString('surroundingText(\'<p id="here">.</p>\', 0, 2)', '.'); | 59 shouldBeEqualToString('surroundingText(\'<p id="here">.</p>\', 0, 2)', '.'); |
60 | 60 |
61 document.body.removeChild(document.getElementById('test')); | 61 document.body.removeChild(document.getElementById('test')); |
62 finishJSTest(); | 62 finishJSTest(); |
63 } | 63 } |
64 | 64 |
65 window.onload = run; | 65 window.onload = run; |
66 window.jsTestIsAsync = true; | 66 window.jsTestIsAsync = true; |
67 window.successfullyParsed = true; | 67 window.successfullyParsed = true; |
68 </script> | 68 </script> |
69 </body> | 69 </body> |
70 </html> | 70 </html> |
OLD | NEW |