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

Side by Side Diff: gin/runner_unittest.cc

Issue 74753002: Introduce gin_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix more header nits Created 7 years, 1 month 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
« no previous file with comments | « gin/runner.cc ('k') | gin/shell/gin_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/runner.h" 5 #include "gin/runner.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "gin/converter.h" 8 #include "gin/converter.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using v8::Handle;
12 using v8::Isolate; 11 using v8::Isolate;
13 using v8::Object; 12 using v8::Object;
14 using v8::Script; 13 using v8::Script;
15 using v8::String; 14 using v8::String;
16 15
17 namespace gin { 16 namespace gin {
18 17
19 TEST(RunnerTest, Run) { 18 TEST(RunnerTest, Run) {
20 std::string source = "this.result = 'PASS';\n"; 19 std::string source = "this.result = 'PASS';\n";
21 20
22 RunnerDelegate delegate; 21 RunnerDelegate delegate;
23 Isolate* isolate = Isolate::GetCurrent(); 22 Isolate* isolate = Isolate::GetCurrent();
24 Runner runner(&delegate, isolate); 23 Runner runner(&delegate, isolate);
25 Runner::Scope scope(&runner); 24 Runner::Scope scope(&runner);
26 runner.Run(source); 25 runner.Run(source);
27 26
28 std::string result; 27 std::string result;
29 EXPECT_TRUE(Converter<std::string>::FromV8( 28 EXPECT_TRUE(Converter<std::string>::FromV8(
30 runner.global()->Get(StringToV8(isolate, "result")), 29 runner.global()->Get(StringToV8(isolate, "result")),
31 &result)); 30 &result));
32 EXPECT_EQ("PASS", result); 31 EXPECT_EQ("PASS", result);
33 } 32 }
34 33
35 } // namespace gin 34 } // namespace gin
OLDNEW
« no previous file with comments | « gin/runner.cc ('k') | gin/shell/gin_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698