| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" | 7 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" |
| 8 #include "src/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
| 9 #include "test/unittests/test-utils.h" | 9 #include "test/unittests/test-utils.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 typedef TestWithContext CompilerDispatcherJobTest; | 15 typedef TestWithContext CompilerDispatcherJobTest; |
| 16 | 16 |
| 17 TEST_F(CompilerDispatcherJobTest, Construct) { | 17 TEST_F(CompilerDispatcherJobTest, Construct) { |
| 18 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate()); | 18 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate()); |
| 19 std::unique_ptr<CompilerDispatcherJob> job( | 19 std::unique_ptr<CompilerDispatcherJob> job( |
| 20 new CompilerDispatcherJob(i_isolate, i_isolate->object_function())); | 20 new CompilerDispatcherJob(i_isolate, i_isolate->object_function())); |
| 21 } | 21 } |
| 22 | 22 |
| 23 TEST_F(CompilerDispatcherJobTest, PrepareToParse) { |
| 24 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate()); |
| 25 std::unique_ptr<CompilerDispatcherJob> job( |
| 26 new CompilerDispatcherJob(i_isolate, i_isolate->object_function())); |
| 27 |
| 28 ASSERT_TRUE(job->status() == CompileJobStatus::kInitial); |
| 29 job->PrepareToParseOnMainThread(); |
| 30 ASSERT_TRUE(job->status() == CompileJobStatus::kReadyToParse); |
| 31 } |
| 32 |
| 23 } // namespace internal | 33 } // namespace internal |
| 24 } // namespace v8 | 34 } // namespace v8 |
| OLD | NEW |