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

Unified Diff: test/webkit/array-sort-small-sparse-array-with-large-length.js

Issue 18068003: Migrated several tests from blink to V8 repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/array-sort-small-sparse-array-with-large-length.js
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/array-sort-small-sparse-array-with-large-length.js
similarity index 79%
copy from test/webkit/concat-while-having-a-bad-time.js
copy to test/webkit/array-sort-small-sparse-array-with-large-length.js
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..05478d6f8ca2117838ae59702e01ea6d76e19fa7 100644
--- a/test/webkit/concat-while-having-a-bad-time.js
+++ b/test/webkit/array-sort-small-sparse-array-with-large-length.js
@@ -22,10 +22,19 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
-"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating."
+"Tests that we can quickly sort a small sparse array that has a large length."
);
-Object.defineProperty(Array.prototype, 0, { writable: false });
-shouldBe("[42].concat()", "[42]");
-
-
+var array = [];
+array[10000000] = 42;
+array.sort();
+var result = "";
+for (var s in array) {
+ debug("array[" + s + "] = " + array[s]);
+ if (result)
+ result += ",";
+ result += array[s];
+}
+shouldBe("result", "\"42\"");
+shouldBe("array.length", "10000001");
+shouldBe("array[0]", "42");

Powered by Google App Engine
This is Rietveld 408576698