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

Side by Side Diff: gin/shell_runner_unittest.cc

Issue 1491083002: Set V8 extras mode in gin::V8Initializer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « gin/shell/gin_main.cc ('k') | gin/test/file_runner.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shell_runner.h" 5 #include "gin/shell_runner.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "gin/array_buffer.h" 9 #include "gin/array_buffer.h"
10 #include "gin/converter.h" 10 #include "gin/converter.h"
(...skipping 15 matching lines...) Expand all
26 TEST(RunnerTest, Run) { 26 TEST(RunnerTest, Run) {
27 base::MessageLoop message_loop; 27 base::MessageLoop message_loop;
28 std::string source = "this.result = 'PASS';\n"; 28 std::string source = "this.result = 'PASS';\n";
29 29
30 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 30 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
31 gin::V8Initializer::LoadV8Snapshot(); 31 gin::V8Initializer::LoadV8Snapshot();
32 gin::V8Initializer::LoadV8Natives(); 32 gin::V8Initializer::LoadV8Natives();
33 #endif 33 #endif
34 34
35 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, 35 gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
36 gin::IsolateHolder::kStableV8Extras,
36 gin::ArrayBufferAllocator::SharedInstance()); 37 gin::ArrayBufferAllocator::SharedInstance());
37 gin::IsolateHolder instance; 38 gin::IsolateHolder instance;
38 39
39 ShellRunnerDelegate delegate; 40 ShellRunnerDelegate delegate;
40 Isolate* isolate = instance.isolate(); 41 Isolate* isolate = instance.isolate();
41 ShellRunner runner(&delegate, isolate); 42 ShellRunner runner(&delegate, isolate);
42 Runner::Scope scope(&runner); 43 Runner::Scope scope(&runner);
43 runner.Run(source, "test_data.js"); 44 runner.Run(source, "test_data.js");
44 45
45 std::string result; 46 std::string result;
46 EXPECT_TRUE(Converter<std::string>::FromV8(isolate, 47 EXPECT_TRUE(Converter<std::string>::FromV8(isolate,
47 runner.global()->Get(StringToV8(isolate, "result")), 48 runner.global()->Get(StringToV8(isolate, "result")),
48 &result)); 49 &result));
49 EXPECT_EQ("PASS", result); 50 EXPECT_EQ("PASS", result);
50 } 51 }
51 52
52 } // namespace gin 53 } // namespace gin
OLDNEW
« no previous file with comments | « gin/shell/gin_main.cc ('k') | gin/test/file_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698