Split net::ClientCertStoreImpl into actual platform-specific classes.
[chromium-blink-merge.git] / gin / runner_unittest.cc
blob3723956df6a4ecdcf2a0aa611eb62f7b85828410
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
3 // found in the LICENSE file.
5 #include "gin/runner.h"
7 #include "base/compiler_specific.h"
8 #include "gin/converter.h"
9 #include "gin/public/isolate_holder.h"
10 #include "testing/gtest/include/gtest/gtest.h"
12 using v8::Isolate;
13 using v8::Object;
14 using v8::Script;
15 using v8::String;
17 namespace gin {
19 TEST(RunnerTest, Run) {
20 std::string source = "this.result = 'PASS';\n";
22 gin::IsolateHolder instance;
24 RunnerDelegate delegate;
25 Isolate* isolate = instance.isolate();
26 Runner runner(&delegate, isolate);
27 Runner::Scope scope(&runner);
28 runner.Run(source, "test_data.js");
30 std::string result;
31 EXPECT_TRUE(Converter<std::string>::FromV8(isolate,
32 runner.global()->Get(StringToV8(isolate, "result")),
33 &result));
34 EXPECT_EQ("PASS", result);
37 } // namespace gin