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

Unified Diff: mojo/public/bindings/js/test/harness.cc

Issue 67173007: Add more unit tests for JS bindings to Core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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: mojo/public/bindings/js/test/harness.cc
diff --git a/mojo/public/bindings/js/test/harness.cc b/mojo/public/bindings/js/test/harness.cc
index b4b81f472ac1d4a7378412e8d1c3e546d31aa1ac..5b7319d718a08739f18f25316679d86cfc885508 100644
--- a/mojo/public/bindings/js/test/harness.cc
+++ b/mojo/public/bindings/js/test/harness.cc
@@ -32,6 +32,12 @@ class TestRunnerDelegate : public RunnerDelegate {
}
};
+std::string GetExceptionInfo(const v8::TryCatch& try_catch) {
+ std::string info;
+ gin::ConvertFromV8(try_catch.Message()->Get(), &info);
+ return info;
+}
+
void RunTestFromFile(const base::FilePath& path) {
EXPECT_TRUE(base::PathExists(path)) << path.LossyDisplayName();
std::string source;
@@ -45,7 +51,7 @@ void RunTestFromFile(const base::FilePath& path) {
v8::TryCatch try_catch;
runner.Run(Script::New(gin::StringToV8(isolate, source)));
- EXPECT_FALSE(try_catch.HasCaught());
+ EXPECT_FALSE(try_catch.HasCaught()) << GetExceptionInfo(try_catch);
}
void RunTest(std::string test) {
@@ -64,6 +70,10 @@ TEST(Harness, mojo_unittests_js) {
RunTest("mojo_unittests.js");
}
+TEST(Harness, core_unittests_js) {
+ RunTest("core_unittests.js");
+}
+
} // namespace
} // namespace js
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698