summaryrefslogtreecommitdiffstats
path: root/widget/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /widget/tests
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/tests')
-rw-r--r--widget/tests/browser/browser_test_InputContextURI.js3
-rw-r--r--widget/tests/browser/browser_test_scrollbar_colors.js45
-rw-r--r--widget/tests/file_test_clipboard.js15
-rw-r--r--widget/tests/file_test_clipboard_asyncSetData.js4
4 files changed, 30 insertions, 37 deletions
diff --git a/widget/tests/browser/browser_test_InputContextURI.js b/widget/tests/browser/browser_test_InputContextURI.js
index 52f05d90f9..ccdfc86def 100644
--- a/widget/tests/browser/browser_test_InputContextURI.js
+++ b/widget/tests/browser/browser_test_InputContextURI.js
@@ -86,6 +86,9 @@ add_task(async () => {
await test_url_bar_url("check after remote content sets the URI");
});
add_task(async () => {
+ await SpecialPowers.pushPrefEnv({
+ set: [["dom.security.https_first", false]],
+ });
await test_input_in_http_or_https(false);
});
diff --git a/widget/tests/browser/browser_test_scrollbar_colors.js b/widget/tests/browser/browser_test_scrollbar_colors.js
index 2152412071..458cadd84e 100644
--- a/widget/tests/browser/browser_test_scrollbar_colors.js
+++ b/widget/tests/browser/browser_test_scrollbar_colors.js
@@ -27,15 +27,6 @@ add_task(async () => {
// == Native theme ==
- const WIN_REFERENCES = [
- // Yellow background
- ["255,255,0", 6889],
- // Blue scrollbar face
- ["0,0,255", 540],
- // Cyan scrollbar track
- ["0,255,255", 2487],
- ];
-
const MAC_REFERENCES = [
// Yellow background
["255,255,0", 7225],
@@ -45,19 +36,9 @@ add_task(async () => {
["0,255,255", 1760],
];
- // Values have been updated from 8100, 720, 1180 for linux1804
- const LINUX_REFERENCES = [
- // Yellow background
- ["255,255,0", 7744],
- // Blue scrollbar face
- ["0,0,255", 1104],
- // Cyan scrollbar track
- ["0,255,255", 1152],
- ];
-
// == Non-native theme ==
- const WIN10_NNT_REFERENCES = [
+ const WIN10_REFERENCES = [
// Yellow background
["255,255,0", 6889],
// Blue scrollbar face
@@ -66,7 +47,7 @@ add_task(async () => {
["0,255,255", 2355],
];
- const WIN11_NNT_REFERENCES = [
+ const WIN11_REFERENCES = [
// Yellow background
["255,255,0", 6889],
// Blue scrollbar face
@@ -75,9 +56,7 @@ add_task(async () => {
["0,255,255", 2787],
];
- const MAC_NNT_REFERENCES = MAC_REFERENCES;
-
- const LINUX_NNT_REFERENCES = [
+ const LINUX_REFERENCES = [
// Yellow background
["255,255,0", 7744],
// Blue scrollbar face
@@ -116,23 +95,19 @@ add_task(async () => {
let canvas = snapshotRect(content.window, outerRect);
let stats = countPixels(canvas);
- let isNNT = SpecialPowers.getBoolPref("widget.non-native-theme.enabled");
-
let references;
if (content.navigator.platform.startsWith("Win")) {
- if (!isNNT) {
- references = WIN_REFERENCES;
- } else if (WindowsVersionInfo.get().buildNumber >= 22000) {
- // Windows 11 NNT
- references = WIN11_NNT_REFERENCES;
+ if (WindowsVersionInfo.get().buildNumber >= 22000) {
+ // Windows 11
+ references = WIN11_REFERENCES;
} else {
- // Windows 10 NNT
- references = WIN10_NNT_REFERENCES;
+ // Windows 10
+ references = WIN10_REFERENCES;
}
} else if (content.navigator.platform.startsWith("Mac")) {
- references = isNNT ? MAC_NNT_REFERENCES : MAC_REFERENCES;
+ references = MAC_REFERENCES;
} else if (content.navigator.platform.startsWith("Linux")) {
- references = isNNT ? LINUX_NNT_REFERENCES : LINUX_REFERENCES;
+ references = LINUX_REFERENCES;
} else {
ok(false, "Unsupported platform");
}
diff --git a/widget/tests/file_test_clipboard.js b/widget/tests/file_test_clipboard.js
index 76bdbaa84d..4e720b6383 100644
--- a/widget/tests/file_test_clipboard.js
+++ b/widget/tests/file_test_clipboard.js
@@ -149,5 +149,20 @@ clipboardTypes.forEach(function (clipboardType) {
// Clear all clipboard data.
cleanupAllClipboard();
});
+
+ add_task(function test_unsupport_flavor() {
+ try {
+ is(
+ getClipboardData("foo/bar", clipboardType),
+ null,
+ `Test getData for clipboard type ${clipboardType}`
+ );
+ } catch (e) {
+ ok(
+ false,
+ `getData should not throw error for clipboard type ${clipboardType}`
+ );
+ }
+ });
}
});
diff --git a/widget/tests/file_test_clipboard_asyncSetData.js b/widget/tests/file_test_clipboard_asyncSetData.js
index cceecd2c44..5eb73f90fa 100644
--- a/widget/tests/file_test_clipboard_asyncSetData.js
+++ b/widget/tests/file_test_clipboard_asyncSetData.js
@@ -21,7 +21,7 @@ clipboardTypes.forEach(function (type) {
let priorResult;
let priorRequest;
let priorPromise = new Promise(resolve => {
- priorRequest = clipboard.asyncSetData(type, {
+ priorRequest = clipboard.asyncSetData(type, null, {
QueryInterface: SpecialPowers.ChromeUtils.generateQI([
"nsIAsyncSetClipboardDataCallback",
]),
@@ -119,7 +119,7 @@ clipboardTypes.forEach(function (type) {
// Create a pending asyncSetData request
let result;
- let request = clipboard.asyncSetData(type, rv => {
+ let request = clipboard.asyncSetData(type, null, rv => {
result = rv;
});