зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1701269 - Don't call getProfile in GeckoSessionTestRule. r=owlish
Differential Revision: https://phabricator.services.mozilla.com/D109926
This commit is contained in:
Родитель
480e2d036a
Коммит
f37fabfc65
|
@ -26,6 +26,9 @@ const APIS = {
|
|||
GetPidForTab({ tab }) {
|
||||
return browser.test.getPidForTab(tab.id);
|
||||
},
|
||||
GetProfilePath() {
|
||||
return browser.test.getProfilePath();
|
||||
},
|
||||
GetAllBrowserPids() {
|
||||
return browser.test.getAllBrowserPids();
|
||||
},
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
/* globals Services */
|
||||
|
||||
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
|
||||
const { E10SUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/E10SUtils.jsm"
|
||||
);
|
||||
|
@ -214,6 +215,10 @@ this.test = class extends ExtensionAPI {
|
|||
return tab.browser.docShellIsActive;
|
||||
},
|
||||
|
||||
async getProfilePath() {
|
||||
return OS.Constants.Path.profileDir;
|
||||
},
|
||||
|
||||
async flushApzRepaints(tabId) {
|
||||
const tab = context.extension.tabManager.get(tabId);
|
||||
const { browsingContext } = tab.browser;
|
||||
|
|
|
@ -164,6 +164,13 @@
|
|||
"description": "Gets the list of pids of the running browser processes",
|
||||
"parameters": []
|
||||
},
|
||||
{
|
||||
"name": "getProfilePath",
|
||||
"type": "function",
|
||||
"async": true,
|
||||
"description": "Gets the path of the current profile",
|
||||
"parameters": []
|
||||
},
|
||||
{
|
||||
"name": "killContentProcess",
|
||||
"type": "function",
|
||||
|
|
|
@ -1225,7 +1225,7 @@ public class GeckoSessionTestRule implements TestRule {
|
|||
}
|
||||
|
||||
protected void deleteCrashDumps() {
|
||||
final File dumpDir = new File(getRuntime().getProfileDir(), "minidumps");
|
||||
final File dumpDir = new File(getProfilePath(), "minidumps");
|
||||
for (final File dump : dumpDir.listFiles()) {
|
||||
dump.delete();
|
||||
}
|
||||
|
@ -1921,6 +1921,10 @@ public class GeckoSessionTestRule implements TestRule {
|
|||
return dblPid.intValue();
|
||||
}
|
||||
|
||||
public String getProfilePath() {
|
||||
return (String) webExtensionApiCall("GetProfilePath", null);
|
||||
}
|
||||
|
||||
public int[] getAllSessionPids() {
|
||||
final JSONArray jsonPids = (JSONArray) webExtensionApiCall("GetAllBrowserPids", null);
|
||||
final int[] pids = new int[jsonPids.length()];
|
||||
|
|
Загрузка…
Ссылка в новой задаче