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

Unified Diff: test/cctest/test-api.cc

Issue 114943004: Reland "Handlify concat string and substring." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix test case. Created 7 years 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
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/string-slices.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 91f37367dae9d0ec815cbd4738bc62484e1df80f..c2917470d569a381556db29b31cd2228effa1275 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -4400,6 +4400,11 @@ TEST(OutOfMemoryNested) {
}
+void OOMCallback(const char* location, const char* message) {
+ exit(0);
+}
+
+
TEST(HugeConsStringOutOfMemory) {
// It's not possible to read a snapshot into a heap with different dimensions.
if (i::Snapshot::IsEnabled()) return;
@@ -4411,19 +4416,17 @@ TEST(HugeConsStringOutOfMemory) {
v8::SetResourceConstraints(CcTest::isolate(), &constraints);
// Execute a script that causes out of memory.
- v8::V8::IgnoreOutOfMemoryException();
+ v8::V8::SetFatalErrorHandler(OOMCallback);
LocalContext context;
v8::HandleScope scope(context->GetIsolate());
// Build huge string. This should fail with out of memory exception.
- Local<Value> result = CompileRun(
+ CompileRun(
"var str = Array.prototype.join.call({length: 513}, \"A\").toUpperCase();"
"for (var i = 0; i < 22; i++) { str = str + str; }");
- // Check for out of memory state.
- CHECK(result.IsEmpty());
- CHECK(context->HasOutOfMemoryException());
+ CHECK(false); // Should not return.
}
@@ -6925,11 +6928,6 @@ static const char* js_code_causing_huge_string_flattening =
"str.match(/X/);";
-void OOMCallback(const char* location, const char* message) {
- exit(0);
-}
-
-
TEST(RegexpOutOfMemory) {
// Execute a script that causes out of memory when flattening a string.
v8::HandleScope scope(CcTest::isolate());
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/string-slices.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698