Closed Bug 1495855 Opened 2 years ago Closed 2 years ago

Rework the about:debugging webextensions tests to do not use symlink-ed test addons


(DevTools :: about:debugging, enhancement, P2)



(firefox64 fixed)

Firefox 64
Tracking Status
firefox64 --- fixed


(Reporter: rpl, Assigned: rpl)



(1 file)

The about:debugging tests related to the webextensions debugging are currently failing to run locally on Linux.

The underlying issues seems to be related to the fact that the test extension is symlinked into `OBJDIR/_tests/testing/mochitest/browser/devtools/client/aboutdebugging/test/addons/` and when the extension is running in oop mode it fails to load any script that is a symlink to a file that is not in the test extension root dir or one of its subdirectory.

The same tests are running fine locally on windows, where the test extension are not symlink-ed by our build system, and also run successfully on try (where it is likely that the test extensions are being packaged differently).

This issue goal is to rework these tests so that they can run locally on Linux (e.g. by using ExtensionTestCommon.generateXPI to generate an extension xpi from a test extension defined right inside the test, similarly to the test extension we use in most of the WebExtensions tests).
Assignee: nobody → lgreco
Priority: -- → P2
Pushed by
Rework the about:debugging webextensions tests to do not use symlink-ed test addons. r=ochameau
Backed out for failures on browser_addons_debug_info.js


push with failures:

failure log:

16:09:25     INFO - TEST-UNEXPECTED-FAIL | devtools/client/aboutdebugging/test/browser_addons_debug_info.js | file path is set correctly - 
16:09:25     INFO - Stack trace:
16:09:25     INFO - chrome://mochitests/content/browser/devtools/client/aboutdebugging/test/browser_addons_debug_info.js:testFilePath:12
16:09:25     INFO - chrome://mochitests/content/browser/devtools/client/aboutdebugging/test/browser_addons_debug_info.js:testWebExtension:62
16:09:25     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1093
16:09:25     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1084
16:09:25     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:986
16:09:25     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:795
Flags: needinfo?(lgreco)
The failure on windows is related to the fact that the aboutdebugging page is converting a file URL to a path and the resulting path looks like "C:/Users/a_username/AppData/Local/Temp/generated-extension.xpi", and then we were comparing it with an expected path retrieved from the nsIFile's path property, which looks like "C:\\Users\\a_username\\AppData\\Local\\Temp\\generated-extension.xpi".

I'm re-opening the phabricator revision and applying the following fix:

use the nsIFile leafName property to retrieve the expected extension xpi filename, so that it doesn't include the full path and so the following assertion from testFilePath:

ok(filePath.textContent.endsWith(expectedFilePath), "file path is set correctly");

will behave the same (and pass) on all the supported platform, included windows.
Flags: needinfo?(lgreco)
Pushed by
Rework the about:debugging webextensions tests to do not use symlink-ed test addons. r=ochameau
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
You need to log in before you can comment on or make changes to this bug.