Chromium Code Reviews| Index: gin/test/file_runner.cc |
| diff --git a/gin/test/file_runner.cc b/gin/test/file_runner.cc |
| index dd0ca66688653ddde456c1cc599c4fd0a080f2fd..020912da89b7fb78c43ada4491488dd164b1fe7b 100644 |
| --- a/gin/test/file_runner.cc |
| +++ b/gin/test/file_runner.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/message_loop/message_loop.h" |
| #include "base/path_service.h" |
| #include "gin/converter.h" |
| +#include "gin/gin.h" |
| #include "gin/modules/module_registry.h" |
| #include "gin/test/gtest.h" |
| #include "gin/try_catch.h" |
| @@ -46,17 +47,20 @@ void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate) { |
| base::MessageLoop message_loop; |
| - gin::Runner runner(delegate, v8::Isolate::GetCurrent()); |
| - gin::Runner::Scope scope(&runner); |
| - runner.Run(source); |
| + scoped_ptr<gin::Gin> instance(new gin::Gin); |
|
abarth-chromium
2013/11/19 16:48:58
Why not on the stack?
|
| + gin::Runner runner(delegate, instance->isolate()); |
| + { |
| + gin::Runner::Scope scope(&runner); |
| + runner.Run(source); |
| - message_loop.RunUntilIdle(); |
| + message_loop.RunUntilIdle(); |
| - v8::Handle<v8::Value> result = runner.context()->Global()->Get( |
| - StringToSymbol(runner.isolate(), "result")); |
| - std::string result_string; |
| - ASSERT_TRUE(ConvertFromV8(result, &result_string)); |
| - EXPECT_EQ("PASS", result_string); |
| + v8::Handle<v8::Value> result = runner.context()->Global()->Get( |
| + StringToSymbol(runner.isolate(), "result")); |
| + std::string result_string; |
| + ASSERT_TRUE(ConvertFromV8(result, &result_string)); |
| + EXPECT_EQ("PASS", result_string); |
| + } |
| } |
| } // namespace gin |