Bug 1586726 - Make the test 'browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js' working in Fission. r=baku
authorTim Huang <tihuang@mozilla.com>
Wed, 20 May 2020 20:17:06 +0000
changeset 531331 e4cd52e972162f3ae572553bf8e640d9af25e185
parent 531330 83335880745c9ec851edf531796777c6c48c94d1
child 531332 87b6bc1c13222b570d79a4228f334d8e20d794fe
push id37438
push userabutkovits@mozilla.com
push dateThu, 21 May 2020 09:36:57 +0000
treeherdermozilla-central@2d00a1a6495c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1586726
milestone78.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 1586726 - Make the test 'browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js' working in Fission. r=baku Differential Revision: https://phabricator.services.mozilla.com/D76208
browser/components/originattributes/test/browser/browser.ini
browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js
--- a/browser/components/originattributes/test/browser/browser.ini
+++ b/browser/components/originattributes/test/browser/browser.ini
@@ -73,17 +73,16 @@ skip-if = verify
 [browser_favicon_userContextId.js]
 [browser_firstPartyIsolation.js]
 skip-if = debug #Bug 1345346
 [browser_firstPartyIsolation_about_newtab.js]
 [browser_firstPartyIsolation_aboutPages.js]
 [browser_firstPartyIsolation_blobURI.js]
 [browser_firstPartyIsolation_js_uri.js]
 [browser_firstPartyIsolation_saveAs.js]
-skip-if = fission
 [browser_localStorageIsolation.js]
 [browser_blobURLIsolation.js]
 skip-if = (verify && debug && (os == 'win'))
 [browser_imageCacheIsolation.js]
 [browser_sharedworker.js]
 [browser_httpauth.js]
 [browser_clientAuth.js]
 skip-if = verify
--- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js
+++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js
@@ -118,50 +118,65 @@ async function doCommandForFrameType() {
   frameMenuPopup.openPopup();
   await frameMenuPopupPromise;
 
   info("Triggering the save process.");
   let saveFrameCommand = contextMenu.querySelector("#context-saveframe");
   saveFrameCommand.doCommand();
 }
 
+add_task(async function test_setup() {
+  // Make sure SearchService is ready for it to be called.
+  await Services.search.init();
+});
+
 add_task(async function testContextMenuSaveAs() {
   const TEST_DATA = [
     { type: "link", path: TEST_PATH, target: "#link1" },
     { type: "video", path: TEST_PATH_VIDEO, target: "#video1" },
     { type: "image", path: TEST_PATH_IMAGE, target: "#image1" },
     { type: "page", path: TEST_PATH_PAGE, target: "body" },
     {
       type: "frame",
       path: TEST_PATH_FRAME,
-      target: "#frame1",
+      target: "body",
       doCommandFunc: doCommandForFrameType,
     },
   ];
 
   for (const data of TEST_DATA) {
     info(`Open a new tab for testing "Save ${data.type} as" in context menu.`);
     let tab = await BrowserTestUtils.openNewForegroundTab(
       gBrowser,
       `${TEST_ORIGIN}${TEST_PATH}?${data.type}=1`
     );
 
     let popupShownPromise = BrowserTestUtils.waitForEvent(
       document,
       "popupshown"
     );
 
+    let browser = gBrowser.selectedBrowser;
+
+    if (data.type === "frame") {
+      browser = await SpecialPowers.spawn(
+        tab.linkedBrowser,
+        [],
+        () => content.document.getElementById("frame1").browsingContext
+      );
+    }
+
     info("Open the context menu.");
     await BrowserTestUtils.synthesizeMouseAtCenter(
       data.target,
       {
         type: "contextmenu",
         button: 2,
       },
-      gBrowser.selectedBrowser
+      browser
     );
 
     await popupShownPromise;
 
     let transferCompletePromise = createPromiseForTransferComplete();
     let observerPromise = createPromiseForObservingChannel(
       data.path,
       TEST_FIRST_PARTY