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

Unified Diff: test/webkit/fast/js/object-prototype-toLocaleString.js

Issue 20280003: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: test/webkit/fast/js/object-prototype-toLocaleString.js
diff --git a/test/webkit/array-iterate-backwards.js b/test/webkit/fast/js/object-prototype-toLocaleString.js
similarity index 65%
copy from test/webkit/array-iterate-backwards.js
copy to test/webkit/fast/js/object-prototype-toLocaleString.js
index 301cbd5290c9dfafcf44c22b351483aa219212f3..213b5b9715f9be63de8ea7ea30e022e0707ed607 100644
--- a/test/webkit/array-iterate-backwards.js
+++ b/test/webkit/fast/js/object-prototype-toLocaleString.js
@@ -22,34 +22,17 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
-"This test checks that iterating a large array backwards works correctly."
+'Tests: Object.prototype.toLocaleString(). Related bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=3989">3989 JSC doesn\'t implement Object.prototype.toLocaleString()</a>'
);
-var bytes = new Array();
+var o = new Object();
+shouldBe("o.toLocaleString()", "o.toString()");
+o.toLocaleString = function () { return "Dynamic toLocaleString()"; }
+shouldBe("o.toLocaleString()", '"Dynamic toLocaleString()"');
-function prepare(nbytes) {
- var i = nbytes - 1;
- while (i >= 0) {
- bytes[i] = new Number(i);
- i -= 1;
- }
-}
+shouldBe("Object.prototype.toLocaleString.call('Hello, world!')", '"Hello, world!"');
-function verify(nbytes) {
- var i = nbytes - 1;
- while (i >= 0) {
- if (bytes[i] != i)
- return false;
- i -= 1;
- }
- return true;
-}
-
-prepare(32768);
-shouldBeTrue('verify(32768)');
-
-prepare(65536);
-shouldBeTrue('verify(65536)');
-
-prepare(120000);
-shouldBeTrue('verify(120000)');
+var stringPrototypeToString = String.prototype.toString;
+String.prototype.toString = (function(){ return "stringPrototypeToString"; });
+shouldBe("Object.prototype.toLocaleString.call('Hello, world!')", '"stringPrototypeToString"');
+String.prototype.toString = stringPrototypeToString;

Powered by Google App Engine
This is Rietveld 408576698