| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium 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 "gin/test/file_runner.h" | 5 #include "gin/test/file_runner.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/run_loop.h" |
| 10 #include "gin/array_buffer.h" | 11 #include "gin/array_buffer.h" |
| 11 #include "gin/converter.h" | 12 #include "gin/converter.h" |
| 12 #include "gin/modules/console.h" | 13 #include "gin/modules/console.h" |
| 13 #include "gin/modules/module_registry.h" | 14 #include "gin/modules/module_registry.h" |
| 14 #include "gin/public/context_holder.h" | 15 #include "gin/public/context_holder.h" |
| 15 #include "gin/public/isolate_holder.h" | 16 #include "gin/public/isolate_holder.h" |
| 16 #include "gin/test/file.h" | 17 #include "gin/test/file.h" |
| 17 #include "gin/test/gc.h" | 18 #include "gin/test/gc.h" |
| 18 #include "gin/test/gtest.h" | 19 #include "gin/test/gtest.h" |
| 19 #include "gin/try_catch.h" | 20 #include "gin/try_catch.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 gin::ArrayBufferAllocator::SharedInstance()); | 70 gin::ArrayBufferAllocator::SharedInstance()); |
| 70 | 71 |
| 71 gin::IsolateHolder instance; | 72 gin::IsolateHolder instance; |
| 72 gin::ShellRunner runner(delegate, instance.isolate()); | 73 gin::ShellRunner runner(delegate, instance.isolate()); |
| 73 { | 74 { |
| 74 gin::Runner::Scope scope(&runner); | 75 gin::Runner::Scope scope(&runner); |
| 75 instance.isolate()->SetCaptureStackTraceForUncaughtExceptions(true); | 76 instance.isolate()->SetCaptureStackTraceForUncaughtExceptions(true); |
| 76 runner.Run(source, path.AsUTF8Unsafe()); | 77 runner.Run(source, path.AsUTF8Unsafe()); |
| 77 | 78 |
| 78 if (run_until_idle) { | 79 if (run_until_idle) { |
| 79 message_loop.RunUntilIdle(); | 80 base::RunLoop().RunUntilIdle(); |
| 80 } else { | 81 } else { |
| 81 message_loop.Run(); | 82 base::RunLoop().Run(); |
| 82 } | 83 } |
| 83 | 84 |
| 84 v8::Local<v8::Value> result = runner.global()->Get( | 85 v8::Local<v8::Value> result = runner.global()->Get( |
| 85 StringToSymbol(runner.GetContextHolder()->isolate(), "result")); | 86 StringToSymbol(runner.GetContextHolder()->isolate(), "result")); |
| 86 EXPECT_EQ("PASS", V8ToString(result)); | 87 EXPECT_EQ("PASS", V8ToString(result)); |
| 87 } | 88 } |
| 88 } | 89 } |
| 89 | 90 |
| 90 } // namespace gin | 91 } // namespace gin |
| OLD | NEW |