Bug 1374741 - Within browser/ tests make openUILinkIn() provide the correct triggeringPrincipal. r=gijs
authorJonathan Kingston <jkt@mozilla.com>
Wed, 21 Feb 2018 14:49:24 +0000
changeset 466111 7e41a8d9dfd37b4f4ec024b61dfe48e2bbe432dd
parent 466110 3182593eb59a6d3f409bf53ddfbca6c45cfe72ed
child 466112 17e2b14dd0dcd59802c8a84da34273162484c06e
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1374741
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1374741 - Within browser/ tests make openUILinkIn() provide the correct triggeringPrincipal. r=gijs MozReview-Commit-ID: 9tJ0b056yNE
browser/base/content/test/general/browser_bug579872.js
browser/base/content/test/general/browser_bug594131.js
browser/base/content/test/general/browser_contentSearchUI.js
browser/base/content/test/general/browser_remoteWebNavigation_postdata.js
browser/base/content/test/tabs/browser_abandonment_telemetry.js
--- a/browser/base/content/test/general/browser_bug579872.js
+++ b/browser/base/content/test/general/browser_bug579872.js
@@ -6,23 +6,23 @@ function test() {
   let newTab = BrowserTestUtils.addTab(gBrowser);
   waitForExplicitFinish();
   BrowserTestUtils.browserLoaded(newTab.linkedBrowser).then(mainPart);
 
   function mainPart() {
     gBrowser.pinTab(newTab);
     gBrowser.selectedTab = newTab;
 
-    openUILinkIn("javascript:var x=0;", "current");
+    openTrustedLinkIn("javascript:var x=0;", "current");
     is(gBrowser.tabs.length, 2, "Should open in current tab");
 
-    openUILinkIn("http://example.com/1", "current");
+    openTrustedLinkIn("http://example.com/1", "current");
     is(gBrowser.tabs.length, 2, "Should open in current tab");
 
-    openUILinkIn("http://example.org/", "current");
+    openTrustedLinkIn("http://example.org/", "current");
     is(gBrowser.tabs.length, 3, "Should open in new tab");
 
     gBrowser.removeTab(newTab);
     gBrowser.removeTab(gBrowser.tabs[1]); // example.org tab
     finish();
   }
   newTab.linkedBrowser.loadURI("http://example.com");
 }
--- a/browser/base/content/test/general/browser_bug594131.js
+++ b/browser/base/content/test/general/browser_bug594131.js
@@ -6,16 +6,18 @@ function test() {
   let newTab = BrowserTestUtils.addTab(gBrowser, "http://example.com");
   waitForExplicitFinish();
   BrowserTestUtils.browserLoaded(newTab.linkedBrowser).then(mainPart);
 
   function mainPart() {
     gBrowser.pinTab(newTab);
     gBrowser.selectedTab = newTab;
 
-    openUILinkIn("http://example.org/", "current", { inBackground: true });
+    openTrustedLinkIn("http://example.org/", "current", {
+      inBackground: true,
+    });
     isnot(gBrowser.selectedTab, newTab, "shouldn't load in background");
 
     gBrowser.removeTab(newTab);
     gBrowser.removeTab(gBrowser.tabs[1]); // example.org tab
     finish();
   }
 }
--- a/browser/base/content/test/general/browser_contentSearchUI.js
+++ b/browser/base/content/test/general/browser_contentSearchUI.js
@@ -711,17 +711,17 @@ async function promiseTab() {
       data: [pageURL],
     });
     promiseMsg("ContentSearch", "AddToWhitelistAck", gMsgMan).then(() => {
       let jsURL = getRootDirectory(gTestPath) + TEST_CONTENT_SCRIPT_BASENAME;
       gMsgMan.loadFrameScript(jsURL, false);
       deferred.resolve(msg("init"));
     });
   }, true, true);
-  openUILinkIn(pageURL, "current");
+  openTrustedLinkIn(pageURL, "current");
   return deferred.promise;
 }
 
 function promiseMsg(name, type, msgMan) {
   return new Promise(resolve => {
     info("Waiting for " + name + " message " + type + "...");
     msgMan.addMessageListener(name, function onMsg(msgObj) {
       info("Received " + name + " message " + msgObj.data.type + "\n");
--- a/browser/base/content/test/general/browser_remoteWebNavigation_postdata.js
+++ b/browser/base/content/test/general/browser_remoteWebNavigation_postdata.js
@@ -33,17 +33,19 @@ add_task(async function test_remoteWebNa
     let path = i.primaryScheme + "://" + i.primaryHost + ":" + i.primaryPort + "/test";
 
     let postdata =
       "Content-Length: 7\r\n" +
       "Content-Type: application/x-www-form-urlencoded\r\n" +
       "\r\n" +
       "success";
 
-    openUILinkIn(path, "tab", null, makeInputStream(postdata));
-
+    openTrustedLinkIn(path, "tab", {
+       allowThirdPartyFixup: null,
+       postData: makeInputStream(postdata),
+     });
   });
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
   await new Promise(resolve => {
     server.stop(function() { resolve(); });
   });
 });
--- a/browser/base/content/test/tabs/browser_abandonment_telemetry.js
+++ b/browser/base/content/test/tabs/browser_abandonment_telemetry.js
@@ -181,17 +181,17 @@ const PROBE_TESTS = [
   {
     name: "Browsing to a new URL",
 
     category: "newURI",
 
     prepare(browser) {},
 
     async doAction(browser) {
-      openUILinkIn(PAGE_2, "current");
+      openTrustedLinkIn(PAGE_2, "current");
       await BrowserTestUtils.browserLoaded(browser);
     },
   },
 ];
 
 /**
  * Takes a Telemetry histogram snapshot and makes sure
  * that the index for that value (as defined by CATEGORIES)