[Pkg-javascript-commits] [pdf.js] 22/56: Call correct quit function and wait request sending.

David Prévot taffit at moszumanska.debian.org
Thu May 15 15:17:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 339f8f0ac986c108124e19829300856d00a5af27
Author: Brendan Dahl <brendan.dahl at gmail.com>
Date:   Fri Apr 11 11:02:03 2014 -0700

    Call correct quit function and wait request sending.
---
 test/driver.js | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/test/driver.js b/test/driver.js
index ccc38f8..1cc19c8 100644
--- a/test/driver.js
+++ b/test/driver.js
@@ -352,9 +352,16 @@ function snapshotCurrentPage(task, failure) {
   });
 }
 
-function sendQuitRequest() {
+function sendQuitRequest(cb) {
   var r = new XMLHttpRequest();
   r.open('POST', '/tellMeToQuit?path=' + escape(appPath), false);
+  r.onreadystatechange = function sendQuitRequestOnreadystatechange(e) {
+    if (r.readyState == 4) {
+      if (cb) {
+        cb();
+      }
+    }
+  };
   r.send(null);
 }
 
@@ -362,12 +369,13 @@ function quitApp() {
   log('Done !');
   document.body.innerHTML = 'Tests are finished. <h1>CLOSE ME!</h1>' +
                              document.body.innerHTML;
-  if (window.SpecialPowers) {
-    SpecialPowers.quitApplication();
-  } else {
-    sendQuitRequest();
-    window.close();
-  }
+  sendQuitRequest(function () {
+    if (window.SpecialPowers) {
+      SpecialPowers.quit();
+    } else {
+      window.close();
+    }
+  });
 }
 
 function done() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list