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

Unified Diff: gin/test/file_runner.cc

Issue 76353002: Introduce a Gin class instead of using global functions to control gin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gin/shell/gin_main.cc ('k') | gin/test/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/test/file_runner.cc
diff --git a/gin/test/file_runner.cc b/gin/test/file_runner.cc
index dd0ca66688653ddde456c1cc599c4fd0a080f2fd..020912da89b7fb78c43ada4491488dd164b1fe7b 100644
--- a/gin/test/file_runner.cc
+++ b/gin/test/file_runner.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "gin/converter.h"
+#include "gin/gin.h"
#include "gin/modules/module_registry.h"
#include "gin/test/gtest.h"
#include "gin/try_catch.h"
@@ -46,17 +47,20 @@ void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate) {
base::MessageLoop message_loop;
- gin::Runner runner(delegate, v8::Isolate::GetCurrent());
- gin::Runner::Scope scope(&runner);
- runner.Run(source);
+ scoped_ptr<gin::Gin> instance(new gin::Gin);
abarth-chromium 2013/11/19 16:48:58 Why not on the stack?
+ gin::Runner runner(delegate, instance->isolate());
+ {
+ gin::Runner::Scope scope(&runner);
+ runner.Run(source);
- message_loop.RunUntilIdle();
+ message_loop.RunUntilIdle();
- v8::Handle<v8::Value> result = runner.context()->Global()->Get(
- StringToSymbol(runner.isolate(), "result"));
- std::string result_string;
- ASSERT_TRUE(ConvertFromV8(result, &result_string));
- EXPECT_EQ("PASS", result_string);
+ v8::Handle<v8::Value> result = runner.context()->Global()->Get(
+ StringToSymbol(runner.isolate(), "result"));
+ std::string result_string;
+ ASSERT_TRUE(ConvertFromV8(result, &result_string));
+ EXPECT_EQ("PASS", result_string);
+ }
}
} // namespace gin
« no previous file with comments | « gin/shell/gin_main.cc ('k') | gin/test/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698