[Pkg-javascript-commits] [pdf.js] 21/56: Use special powers quit in unit tests.

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 70ce3a88a1a8fc436430d16006720aff7dc95a36
Author: Brendan Dahl <brendan.dahl at gmail.com>
Date:   Fri Apr 11 11:02:41 2014 -0700

    Use special powers quit in unit tests.
---
 test/unit/testreporter.js | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/test/unit/testreporter.js b/test/unit/testreporter.js
index 6b37309..d017ef5 100644
--- a/test/unit/testreporter.js
+++ b/test/unit/testreporter.js
@@ -5,7 +5,7 @@
 var TestReporter = function(browser, appPath) {
   'use strict';
 
-  function send(action, json) {
+  function send(action, json, cb) {
     var r = new XMLHttpRequest();
     // (The POST URI is ignored atm.)
     r.open('POST', action, true);
@@ -14,7 +14,11 @@ var TestReporter = function(browser, appPath) {
       if (r.readyState == 4) {
         // Retry until successful
         if (r.status !== 200) {
-          send(action, json);
+          send(action, json, cb);
+        } else {
+          if (cb) {
+            cb();
+          }
         }
       }
     };
@@ -38,7 +42,11 @@ var TestReporter = function(browser, appPath) {
   }
 
   function sendQuitRequest() {
-    send('/tellMeToQuit?path=' + escape(appPath), {});
+    send('/tellMeToQuit?path=' + escape(appPath), {}, function () {
+      if (window.SpecialPowers) {
+        SpecialPowers.quit();
+      }
+    });
   }
 
   this.now = function() {

-- 
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