// Use this for initialization void Start() { // init DropboxSync from the main thread var _ = DropboxSync.Main; outputText.text = ""; _mainThreadQueueRunner = new MainThreadQueueRunner(); // clean before testing _testActions.Add(CleanForTests); // add tests - order is important _testActions.Add(TestUploadFile); _testActions.Add(TestMoveFile); _testActions.Add(TestDownloadFile); _testActions.Add(TestDeleteFile); _testActions.Add(TestCreateNestedFolder); // clean after testing _testActions.Add(CleanForTests); _backgroundThread = new Thread(RunAllTestsOnBackgroundThreadWorker); _backgroundThread.IsBackground = true; _backgroundThread.Start(); }
// METHODS void Initialize() { Debug.Log(string.Format("DropboxSync v{0}", DROPBOX_SYNC_VERSION)); _PersistentDataPath = Application.persistentDataPath; _internetConnectionWatcher = new InternetConnectionWatcher(); _internetConnectionWatcher.OnLostInternetConnection += () => { LogWarning("Lost internet connection."); }; _internetConnectionWatcher.OnInternetConnectionRecovered += () => { LogWarning("Internet connection recovered."); }; _mainThreadQueueRunner = new MainThreadQueueRunner(); _mainThreadQueueRunner.InitFromMainThread(); // trust all certificates // TODO: do something smarter instead of this ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true); ServicePointManager.DefaultConnectionLimit = 20; }