Index: chrome/installer/mac/app/main.m |
diff --git a/chrome/installer/mac/app/main.m b/chrome/installer/mac/app/main.m |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8c25b828db02d393c87b7ba20546eb804676c324 |
--- /dev/null |
+++ b/chrome/installer/mac/app/main.m |
@@ -0,0 +1,30 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import <Foundation/Foundation.h> |
+#import "downloader.h" |
+#import "systemInfo.h" |
+#import "OmahaXMLRequest.h" |
+#import "OmahaCommunication.h" |
+ |
+void talkToOmahaThenExecuteBlock(AfterBlock block) { |
+ NSXMLDocument* requestBody = [OmahaXMLRequest |
+ createXMLRequestBodyWithOS:[SystemInfo getOSVersion] |
+ andArchitecture:[SystemInfo getArch]]; |
+ OmahaCommunication* messenger = [[OmahaCommunication alloc] |
+ initWithBody:requestBody]; |
+ [messenger createOmahaRequest]; |
+ [messenger setResponseHandlingWithBlock:block]; |
+ [messenger sendRequest]; |
+} |
+ |
+int main(){ |
+ talkToOmahaThenExecuteBlock(^(NSData* data) { |
Elly Fong-Jones
2016/07/06 15:22:02
This is taking the kind of shape we were talking a
|
+ Downloader* download = [[Downloader alloc] init]; |
+ [download downloadChromeImageToDownloadsDirectory: data]; |
+ }); |
+ |
+ // [[NSRunLoop mainRunLoop] run]; |
+ [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:3]]; |
Elly Fong-Jones
2016/07/06 15:22:02
why 3?
Anna Zeng
2016/07/07 15:24:53
it's 3 for random testing purposes; we usually use
|
+} |