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

Unified Diff: test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc

Issue 2198043002: Add a mode to completely deserialize scope chains (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 4 years, 4 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
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | tools/gcmole/run-gcmole.isolate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc
diff --git a/test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc b/test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc
index 480c3abe68181bbc67f647aa55d62706ee6ca8e0..d3beaeb3896828b8da67caf010f468978e1d7598 100644
--- a/test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc
+++ b/test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc
@@ -17,6 +17,8 @@ typedef TestWithContext CompilerDispatcherJobTest;
namespace {
+const char test_script[] = "x*x";
+
class ScriptResource : public v8::String::ExternalOneByteStringResource {
public:
ScriptResource(const char* data, size_t length)
@@ -42,14 +44,14 @@ Handle<JSFunction> CreateFunction(
->NewExternalStringFromOneByte(maybe_resource)
.ToHandleChecked();
} else {
- source = isolate->factory()->NewStringFromStaticChars("source");
+ source = isolate->factory()->NewStringFromAsciiChecked(test_script);
}
Handle<Script> script = isolate->factory()->NewScript(source);
Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo(
- isolate->factory()->NewStringFromStaticChars("f"), MaybeHandle<Code>(),
+ isolate->factory()->NewStringFromAsciiChecked("f"), MaybeHandle<Code>(),
false);
SharedFunctionInfo::SetScript(shared, script);
- shared->set_end_position(source->length() - 1);
+ shared->set_end_position(source->length());
Handle<JSFunction> function =
isolate->factory()->NewFunctionFromSharedFunctionInfo(
shared, handle(isolate->context(), isolate));
@@ -70,7 +72,7 @@ TEST_F(CompilerDispatcherJobTest, CanParseOnBackgroundThread) {
ASSERT_FALSE(job->can_parse_on_background_thread());
}
{
- ScriptResource script("script", strlen("script"));
+ ScriptResource script(test_script, strlen(test_script));
std::unique_ptr<CompilerDispatcherJob> job(new CompilerDispatcherJob(
i_isolate(), CreateFunction(i_isolate(), &script), FLAG_stack_size));
ASSERT_TRUE(job->can_parse_on_background_thread());
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | tools/gcmole/run-gcmole.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698