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

Side by Side Diff: gin/test/gtest.cc

Issue 120043008: Add a simple one shot and repeating timer API for Mojo.js. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 25 matching lines...) Expand all
36 const std::string& description) { 36 const std::string& description) {
37 EXPECT_TRUE(expected->StrictEquals(actual)) << description; 37 EXPECT_TRUE(expected->StrictEquals(actual)) << description;
38 } 38 }
39 39
40 WrapperInfo g_wrapper_info = { kEmbedderNativeGin }; 40 WrapperInfo g_wrapper_info = { kEmbedderNativeGin };
41 41
42 } // namespace 42 } // namespace
43 43
44 const char GTest::kModuleName[] = "gtest"; 44 const char GTest::kModuleName[] = "gtest";
45 45
46 v8::Local<v8::ObjectTemplate> GTest::GetTemplate(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 .Build(); 56 .Build();
57 data->SetObjectTemplate(&g_wrapper_info, templ); 57 data->SetObjectTemplate(&g_wrapper_info, templ);
58 } 58 }
59 return templ; 59 return templ->NewInstance();
60 } 60 }
61 61
62 } // namespace gin 62 } // namespace gin
OLDNEW
« gin/runner.cc ('K') | « gin/test/gtest.h ('k') | mojo/apps/js/bindings/core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698