diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /toolkit/modules/tests/xpcshell | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/modules/tests/xpcshell')
4 files changed, 26 insertions, 7 deletions
diff --git a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js index 8f725fc78d..a0d12b8a6a 100644 --- a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js +++ b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js @@ -1257,7 +1257,7 @@ add_task(async function test_GMPExtractor_paths() { if (AppConstants.platform == "macosx") { await Assert.rejects( IOUtils.getMacXAttr(extractedFile, "com.apple.quarantine"), - /NotFoundError: The file `.+' does not have an extended attribute `com.apple.quarantine'/, + /NotFoundError: Could not get extended attribute `com.apple.quarantine' from `.+': the file does not have the attribute/, "The 'com.apple.quarantine' attribute should not be present" ); } diff --git a/toolkit/modules/tests/xpcshell/test_Services.js b/toolkit/modules/tests/xpcshell/test_Services.js index 55c762fdad..8169a23bbd 100644 --- a/toolkit/modules/tests/xpcshell/test_Services.js +++ b/toolkit/modules/tests/xpcshell/test_Services.js @@ -28,7 +28,6 @@ function run_test() { checkService("cookies", Ci.nsICookieManager); checkService("dirsvc", Ci.nsIDirectoryService); checkService("dirsvc", Ci.nsIProperties); - checkService("DOMRequest", Ci.nsIDOMRequestService); checkService("domStorageManager", Ci.nsIDOMStorageManager); checkService("droppedLinkHandler", Ci.nsIDroppedLinkHandler); checkService("eTLD", Ci.nsIEffectiveTLDService); diff --git a/toolkit/modules/tests/xpcshell/test_firstStartup.js b/toolkit/modules/tests/xpcshell/test_firstStartup.js index 02f126d66f..445d3a0c72 100644 --- a/toolkit/modules/tests/xpcshell/test_firstStartup.js +++ b/toolkit/modules/tests/xpcshell/test_firstStartup.js @@ -24,11 +24,13 @@ add_task(async function test_success() { updateAppInfo(); let submissionPromise; + FirstStartup.resetForTesting(); if (AppConstants.MOZ_NORMANDY || AppConstants.MOZ_UPDATE_AGENT) { submissionPromise = new Promise(resolve => { GleanPings.firstStartup.testBeforeNextSubmit(() => { Assert.equal(FirstStartup.state, FirstStartup.SUCCESS); + Assert.ok(Glean.firstStartup.newProfile.testGetValue()); Assert.equal( Glean.firstStartup.statusCode.testGetValue(), FirstStartup.SUCCESS @@ -49,6 +51,7 @@ add_task(async function test_success() { submissionPromise = new Promise(resolve => { GleanPings.firstStartup.testBeforeNextSubmit(() => { Assert.equal(FirstStartup.state, FirstStartup.UNSUPPORTED); + Assert.ok(Glean.firstStartup.newProfile.testGetValue()); Assert.equal( Glean.firstStartup.statusCode.testGetValue(), FirstStartup.UNSUPPORTED @@ -58,13 +61,14 @@ add_task(async function test_success() { }); } - FirstStartup.init(); + FirstStartup.init(true /* newProfile */); await submissionPromise; }); add_task(async function test_timeout() { updateAppInfo(); Services.prefs.setIntPref(PREF_TIMEOUT, 0); + FirstStartup.resetForTesting(); let submissionPromise; @@ -73,6 +77,7 @@ add_task(async function test_timeout() { GleanPings.firstStartup.testBeforeNextSubmit(() => { Assert.equal(FirstStartup.state, FirstStartup.TIMED_OUT); Assert.ok(Glean.firstStartup.elapsed.testGetValue() > 0); + Assert.ok(Glean.firstStartup.newProfile.testGetValue()); if (AppConstants.MOZ_NORMANDY) { Assert.ok(Glean.firstStartup.normandyInitTime.testGetValue() > 0); @@ -90,11 +95,27 @@ add_task(async function test_timeout() { GleanPings.firstStartup.testBeforeNextSubmit(() => { Assert.equal(FirstStartup.state, FirstStartup.UNSUPPORTED); Assert.equal(Glean.firstStartup.elapsed.testGetValue(), 0); + Assert.ok(Glean.firstStartup.newProfile.testGetValue()); resolve(); }); }); } - FirstStartup.init(); + FirstStartup.init(true /* newProfile */); + await submissionPromise; +}); + +add_task(async function test_existing_profile() { + FirstStartup.resetForTesting(); + + let submissionPromise = new Promise(resolve => { + GleanPings.firstStartup.testBeforeNextSubmit(() => { + Assert.equal(FirstStartup.state, FirstStartup.NOT_STARTED); + Assert.ok(!Glean.firstStartup.newProfile.testGetValue()); + resolve(); + }); + }); + + FirstStartup.init(false /* newProfile */); await submissionPromise; }); diff --git a/toolkit/modules/tests/xpcshell/test_sqlite.js b/toolkit/modules/tests/xpcshell/test_sqlite.js index 2c3ede46d6..e0a79e137d 100644 --- a/toolkit/modules/tests/xpcshell/test_sqlite.js +++ b/toolkit/modules/tests/xpcshell/test_sqlite.js @@ -118,9 +118,8 @@ add_task(async function test_open_normal_error() { // Ensure that our database doesn't already exist. let path = PathUtils.join(PROFILE_DIR, "corrupt.sqlite"); - await Assert.rejects( - IOUtils.stat(path), - /Could not stat file\(.*\) because it does not exist/, + Assert.ok( + !(await IOUtils.exists(path)), "Database file should not exist yet" ); |