Bug 1008481 - Add debugging output to test_bug995943.xul. a=test-only
authorBobby Holley <bobbyholley@gmail.com>
Fri, 23 May 2014 15:28:03 -0700
changeset 200683 9ca011c5d4fbf9a0ecf86513eb9d1649a3ccd197
parent 200682 60569d977b9321aa96a870713acc5036f7264424
child 200684 13f2f2e6620d23e877748b74c2cefc0c0bb1727e
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1008481, 995943
milestone31.0
Bug 1008481 - Add debugging output to test_bug995943.xul. a=test-only
caps/tests/mochitest/test_bug995943.xul
--- a/caps/tests/mochitest/test_bug995943.xul
+++ b/caps/tests/mochitest/test_bug995943.xul
@@ -29,25 +29,28 @@ https://bugzilla.mozilla.org/show_bug.cg
   var profileDir = "file://" + Cc["@mozilla.org/file/directory_service;1"]
                                .getService(Ci.nsIProperties)
                                .get("ProfD", Ci.nsILocalFile).path;
 
   function checkLoadFileURI(domain, shouldLoad) {
     debug("Invoking checkLoadFileURI with domain: " + domain + ", shouldLoad: " + shouldLoad);
     return new Promise(function(resolve, reject) {
       $('ifr').addEventListener('load', function l1() {
+        debug("Invoked l1 for " + domain);
         $('ifr').removeEventListener('load', l1);
         function l2() {
+          debug("Invoked l2 for " + domain);
           $('ifr').removeEventListener('load', l2);
           ok(shouldLoad, "Successfully loaded file:// URI for domain: " + domain);
           resolve();
         }
         $('ifr').addEventListener('load', l2);
         try {
           window[0].wrappedJSObject.location = profileDir;
+          debug("Successfully navigated for " + domain);
         } catch (e) {
           ok(!shouldLoad && /denied|insecure/.test(e),
              "Prevented loading of file:// URI for domain: " + domain + " - " + e);
           $('ifr').removeEventListener('load', l2);
           resolve();
         }
       });
       let targetURI = domain + '/tests/js/xpconnect/tests/mochitest/file_empty.html';
@@ -59,33 +62,35 @@ https://bugzilla.mozilla.org/show_bug.cg
   function pushPrefs(prefs) {
     return new Promise(function(resolve) { SpecialPowers.pushPrefEnv({ set: prefs }, resolve); });
   }
 
   function popPrefs() {
     return new Promise(function(resolve) { SpecialPowers.popPrefEnv(resolve); });
   }
 
+  var gGoCount = 0;
   function go() {
+    debug("Invoking go for window with id: " + window.getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID);
+    is(++gGoCount, 1, "Should only call go once!");
     checkLoadFileURI('http://example.com', false).then(
       pushPrefs.bind(null, [['capability.policy.policynames', ' somepolicy '],
                             ['capability.policy.somepolicy.checkloaduri.enabled', 'AlLAcCeSs'],
                             ['capability.policy.somepolicy.sites', 'http://example.com']]))
     .then(checkLoadFileURI.bind(null, 'http://example.com', true))
     .then(popPrefs)
     .then(checkLoadFileURI.bind(null, 'http://example.com', false))
     .then(
       pushPrefs.bind(null, [['capability.policy.policynames', ',somepolicy, someotherpolicy, '],
                             ['capability.policy.somepolicy.checkloaduri.enabled', 'allaccess'],
                             ['capability.policy.someotherpolicy.checkloaduri.enabled', 'nope'],
                             ['capability.policy.somepolicy.sites', ' http://example.org   https://example.com'],
                             ['capability.policy.someotherpolicy.sites', 'http://example.net ']]))
     .then(checkLoadFileURI.bind(null, 'http://example.org', true))
     .then(checkLoadFileURI.bind(null, 'http://example.com', false))
-    .then(checkLoadFileURI.bind(null, 'https://example.com', true))
     .then(checkLoadFileURI.bind(null, 'http://example.net', false))
     .then(pushPrefs.bind(null, [['capability.policy.someotherpolicy.checkloaduri.enabled', 'allAccess']]))
     .then(checkLoadFileURI.bind(null, 'http://example.net', true))
     .then(popPrefs)
     .then(popPrefs)
     .then(checkLoadFileURI.bind(null, 'http://example.net', false))
     .then(SimpleTest.finish.bind(SimpleTest));