[M120 Migration] Set IO|GPU thread type with higher priorites
[platform/framework/web/chromium-efl.git] / gin / shell_runner_unittest.cc
1 // Copyright 2014 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gin/shell_runner.h"
6
7 #include "gin/converter.h"
8 #include "gin/public/isolate_holder.h"
9 #include "gin/test/v8_test.h"
10
11 namespace gin {
12
13 typedef V8Test RunnerTest;
14
15 TEST_F(RunnerTest, Run) {
16   std::string source = "this.result = 'PASS';\n";
17
18   ShellRunnerDelegate delegate;
19   v8::Isolate* isolate = instance_->isolate();
20   ShellRunner runner(&delegate, isolate);
21   Runner::Scope scope(&runner);
22   runner.Run(source, "test_data.js");
23
24   std::string result;
25   EXPECT_TRUE(Converter<std::string>::FromV8(
26       isolate,
27       runner.global()
28           ->Get(isolate->GetCurrentContext(), StringToV8(isolate, "result"))
29           .ToLocalChecked(),
30       &result));
31   EXPECT_EQ("PASS", result);
32 }
33
34 }  // namespace gin