Running tests or benchmarks cause app to exit when finished.

This commit is contained in:
Corey Johnson 2012-03-14 09:33:27 -07:00
parent 638c0c625b
commit 1b1e81c6cf

View File

@ -116,14 +116,22 @@
- (void)loadEnd {
if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--benchmark"]) {
CefRefPtr<CefV8Context> context = _clientHandler->GetBrowser()->GetMainFrame()->GetV8Context();
context->Enter();
CefRefPtr<CefV8Value> atom = context->GetGlobal()->GetValue("atom");
atom->SetValue("exitOnCompletion", CefV8Value::CreateBool(YES), V8_PROPERTY_ATTRIBUTE_NONE);
context->Exit();
[self modifyJavaScript:^(CefRefPtr<CefV8Context> context, CefRefPtr<CefV8Value> global) {
CefRefPtr<CefV8Value> atom = context->GetGlobal()->GetValue("atom");
atom->SetValue("exitAfterSpecs", CefV8Value::CreateBool(YES), V8_PROPERTY_ATTRIBUTE_NONE);
}];
[self runBenchmarks:self];
}
if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--test"]) {
[self modifyJavaScript:^(CefRefPtr<CefV8Context> context, CefRefPtr<CefV8Value> global) {
CefRefPtr<CefV8Value> atom = context->GetGlobal()->GetValue("atom");
atom->SetValue("exitAfterSpecs", CefV8Value::CreateBool(YES), V8_PROPERTY_ATTRIBUTE_NONE);
}];
[self runSpecs:self];
}
}
@end