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

Side by Side Diff: LayoutTests/fast/xpath/substring-nan-position.html

Issue 48903019: Delete js-test-post.js. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../js/resources/js-test-pre.js"></script> 4 <script src="../js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=41862">bug 41862</a> : 7 <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=41862">bug 41862</a> :
8 XPath substring function is broken when passing NaN as the position parameter.</ p> 8 XPath substring function is broken when passing NaN as the position parameter.</ p>
9 <div id="console"></div> 9 <div id="console"></div>
10 10
11 <script> 11 <script>
12 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'))\", documen t, null, XPathResult.STRING_TYPE, null).stringValue", "''"); 12 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'))\", documen t, null, XPathResult.STRING_TYPE, null).stringValue", "''");
13 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), 3)\", docu ment, null, XPathResult.STRING_TYPE, null).stringValue", "''"); 13 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), 3)\", docu ment, null, XPathResult.STRING_TYPE, null).stringValue", "''");
14 14
15 <!-- -2147483645 represents MIN_INT-3 which when passed through the original substring function before the fix for 41862 landed caused an overflow and wrap to 2. That meant that this case was effectively calling substring('12345', MIN_I NT, 2) and returning 12, rather than the empty string which the NaN should have triggered.. --> 15 <!-- -2147483645 represents MIN_INT-3 which when passed through the original substring function before the fix for 41862 landed caused an overflow and wrap to 2. That meant that this case was effectively calling substring('12345', MIN_I NT, 2) and returning 12, rather than the empty string which the NaN should have triggered.. -->
16 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), -214748364 5)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''"); 16 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), -214748364 5)\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
17 17
18 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), number(\'N aN\'))\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''"); 18 shouldBe("document.evaluate(\"substring('12345', number(\'NaN\'), number(\'N aN\'))\", document, null, XPathResult.STRING_TYPE, null).stringValue", "''");
19 19
20 </script> 20 </script>
21 <script src="../js/resources/js-test-post.js"></script>
22 </body> 21 </body>
23 </html> 22 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/xpath/substring-after.html ('k') | LayoutTests/fast/xpath/substring-non-positive-postion.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698