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

Unified Diff: gin/runner_unittest.cc

Issue 62333018: Implement Asynchronous Module Definition API for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moar testing 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
Index: gin/runner_unittest.cc
diff --git a/gin/runner_unittest.cc b/gin/runner_unittest.cc
index 4b3c0fc48aff19504282bce0f767c429154d9ae4..a95a11326d133eb84bd6b2af2e27a476778b0f6e 100644
--- a/gin/runner_unittest.cc
+++ b/gin/runner_unittest.cc
@@ -15,35 +15,15 @@ using v8::Script;
using v8::String;
namespace gin {
-namespace {
-
-class TestRunnerDelegate : public RunnerDelegate {
- public:
- virtual Handle<Object> CreateRootObject(Runner* runner) OVERRIDE {
- Isolate* isolate = runner->isolate();
- Handle<Object> root = Object::New();
- root->Set(StringToV8(isolate, "foo"), StringToV8(isolate, "bar"));
- return root;
- }
- virtual ~TestRunnerDelegate() {}
-};
-
-}
TEST(RunnerTest, Run) {
- std::string source =
- "function main(root) {\n"
- " if (root.foo)\n"
- " this.result = 'PASS';\n"
- " else\n"
- " this.result = 'FAIL';\n"
- "}\n";
-
- TestRunnerDelegate delegate;
+ std::string source = "this.result = 'PASS';\n";
+
+ RunnerDelegate delegate;
Isolate* isolate = Isolate::GetCurrent();
Runner runner(&delegate, isolate);
Runner::Scope scope(&runner);
- runner.Run(Script::New(StringToV8(isolate, source)));
+ runner.Run(source);
std::string result;
EXPECT_TRUE(Converter<std::string>::FromV8(
« gin/modules/module_registry.cc ('K') | « gin/runner.cc ('k') | gin/test/file_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698