This commit is contained in:
Corey Johnson
2012-03-14 12:19:50 -07:00
parent eceb5aec33
commit caaa8d110e

View File

@@ -84,6 +84,13 @@
}
- (void)exitAfterSpecs {
[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);
}];
}
- (CefRefPtr<CefV8Context>)atomContext {
return _clientHandler->GetBrowser()->GetMainFrame()->GetV8Context();
}
@@ -116,20 +123,12 @@
- (void)loadEnd {
if ([[[NSProcessInfo processInfo] arguments] containsObject:@"--benchmark"]) {
[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 exitAfterSpecs];
[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 exitAfterSpecs];
[self runSpecs:self];
}
}