Chromium Code Reviews| 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/gtest.h" | 5 #include "gin/test/gtest.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "gin/arguments.h" | 9 #include "gin/arguments.h" |
| 10 #include "gin/converter.h" | 10 #include "gin/converter.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 v8::Local<v8::Value> GTest::GetModule(v8::Isolate* isolate) { | 46 v8::Local<v8::Value> GTest::GetModule(v8::Isolate* isolate) { |
| 47 PerIsolateData* data = PerIsolateData::From(isolate); | 47 PerIsolateData* data = PerIsolateData::From(isolate); |
| 48 v8::Local<v8::ObjectTemplate> templ = | 48 v8::Local<v8::ObjectTemplate> templ = |
| 49 data->GetObjectTemplate(&g_wrapper_info); | 49 data->GetObjectTemplate(&g_wrapper_info); |
| 50 if (templ.IsEmpty()) { | 50 if (templ.IsEmpty()) { |
| 51 templ = ObjectTemplateBuilder(isolate) | 51 templ = ObjectTemplateBuilder(isolate) |
| 52 .SetMethod("fail", Fail) | 52 .SetMethod("fail", Fail) |
| 53 .SetMethod("expectTrue", ExpectTrue) | 53 .SetMethod("expectTrue", ExpectTrue) |
| 54 .SetMethod("expectFalse", ExpectFalse) | 54 .SetMethod("expectFalse", ExpectFalse) |
| 55 .SetMethod("expectEqual", ExpectEqual) | 55 .SetMethod("expectEqual", ExpectEqual) |
| 56 .SetMethod("collectGarbage", v8::V8::LowMemoryNotification) | |
|
abarth-chromium
2014/03/29 01:56:17
Did you mean to expose this function in two places
Matt Perry
2014/03/31 19:34:17
Oops, thanks. I put it here first as a hack. Remov
| |
| 56 .Build(); | 57 .Build(); |
| 57 data->SetObjectTemplate(&g_wrapper_info, templ); | 58 data->SetObjectTemplate(&g_wrapper_info, templ); |
| 58 } | 59 } |
| 59 return templ->NewInstance(); | 60 return templ->NewInstance(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 } // namespace gin | 63 } // namespace gin |
| OLD | NEW |