summaryrefslogtreecommitdiffstats
path: root/gin
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 03:05:46 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 03:05:46 +0000
commit89adefdf3ebe499bee700670b6501ad3652adbe8 (patch)
treeb1a8291fc3a00ec7dd33ba7273a9d28dfc5935ed /gin
parent2549d89cde93cc3d5d26a35d3da446b94e433a4c (diff)
downloadchromium_src-89adefdf3ebe499bee700670b6501ad3652adbe8.zip
chromium_src-89adefdf3ebe499bee700670b6501ad3652adbe8.tar.gz
chromium_src-89adefdf3ebe499bee700670b6501ad3652adbe8.tar.bz2
Introduce a monotonic_clock module for Mojo.js.
Am having trouble coming up with a satisfactory way to test. BUG= Review URL: https://codereview.chromium.org/129633005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin')
-rw-r--r--gin/test/file_runner.cc9
-rw-r--r--gin/test/file_runner.h3
2 files changed, 9 insertions, 3 deletions
diff --git a/gin/test/file_runner.cc b/gin/test/file_runner.cc
index 48da198..7b91273 100644
--- a/gin/test/file_runner.cc
+++ b/gin/test/file_runner.cc
@@ -44,7 +44,8 @@ void FileRunnerDelegate::UnhandledException(Runner* runner,
FAIL() << try_catch.GetStackTrace();
}
-void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate) {
+void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate,
+ bool run_until_idle) {
ASSERT_TRUE(base::PathExists(path)) << path.LossyDisplayName();
std::string source;
ASSERT_TRUE(ReadFileToString(path, &source));
@@ -58,7 +59,11 @@ void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate) {
v8::V8::SetCaptureStackTraceForUncaughtExceptions(true);
runner.Run(source, path.AsUTF8Unsafe());
- message_loop.RunUntilIdle();
+ if (run_until_idle) {
+ message_loop.RunUntilIdle();
+ } else {
+ message_loop.Run();
+ }
v8::Handle<v8::Value> result = runner.context()->Global()->Get(
StringToSymbol(runner.isolate(), "result"));
diff --git a/gin/test/file_runner.h b/gin/test/file_runner.h
index 57d4017..267023d 100644
--- a/gin/test/file_runner.h
+++ b/gin/test/file_runner.h
@@ -29,7 +29,8 @@ class FileRunnerDelegate : public ModuleRunnerDelegate {
DISALLOW_COPY_AND_ASSIGN(FileRunnerDelegate);
};
-void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate);
+void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate,
+ bool run_until_idle = true);
} // namespace gin