Update On Wed Apr 23 20:23:40 CEST 2025
This commit is contained in:
parent
858786b3a9
commit
b4d5fcf244
1122 changed files with 49246 additions and 59068 deletions
61
Cargo.lock
generated
61
Cargo.lock
generated
|
@ -423,7 +423,7 @@ dependencies = [
|
|||
"bitflags 2.9.0",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"itertools",
|
||||
"itertools 0.10.999",
|
||||
"lazy_static",
|
||||
"lazycell",
|
||||
"proc-macro2",
|
||||
|
@ -1854,7 +1854,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "error-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"error-support-macros",
|
||||
"lazy_static",
|
||||
|
@ -1866,7 +1866,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "error-support-macros"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -1983,7 +1983,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "firefox-versioning"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"serde_json",
|
||||
"thiserror 1.999.999",
|
||||
|
@ -2643,9 +2643,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glean"
|
||||
version = "64.0.1"
|
||||
version = "64.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "251b9cb685554b96dcf785dba69ce90447006dd6d9229db783336c981c3777e1"
|
||||
checksum = "95024f4707705270208e36983976cbac235dd7fc33c9f1cb0dee396ec1ce295d"
|
||||
dependencies = [
|
||||
"crossbeam-channel",
|
||||
"glean-core",
|
||||
|
@ -2657,9 +2657,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "glean-core"
|
||||
version = "64.0.1"
|
||||
version = "64.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a49d1d62648ddeed8cb996373046ea45de93f1d1ff956aba054b9304bc305753"
|
||||
checksum = "5ca0df94fb37669287b77e8aa300913ad1d14426d7f9e443b0ce1185349c817e"
|
||||
dependencies = [
|
||||
"android_logger",
|
||||
"bincode",
|
||||
|
@ -3320,7 +3320,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "interrupt-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"parking_lot",
|
||||
|
@ -3393,9 +3393,16 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.5"
|
||||
version = "0.10.999"
|
||||
dependencies = [
|
||||
"itertools 0.14.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
||||
checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
@ -4176,7 +4183,7 @@ dependencies = [
|
|||
"futures",
|
||||
"getrandom 0.2.999",
|
||||
"hex",
|
||||
"itertools",
|
||||
"itertools 0.10.999",
|
||||
"maybe-async",
|
||||
"mls-rs-codec",
|
||||
"mls-rs-core",
|
||||
|
@ -4423,7 +4430,7 @@ dependencies = [
|
|||
"icu_properties",
|
||||
"idna",
|
||||
"indexmap",
|
||||
"itertools",
|
||||
"itertools 0.14.0",
|
||||
"libc",
|
||||
"lmdb-rkv-sys",
|
||||
"log",
|
||||
|
@ -5028,7 +5035,7 @@ checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
|
|||
[[package]]
|
||||
name = "payload-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
|
@ -5338,7 +5345,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"itertools",
|
||||
"itertools 0.10.999",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
|
@ -5531,7 +5538,7 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
|
|||
[[package]]
|
||||
name = "relevancy"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.21.999",
|
||||
|
@ -5556,7 +5563,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "remote_settings"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"camino",
|
||||
|
@ -5904,7 +5911,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "search"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"error-support",
|
||||
"firefox-versioning",
|
||||
|
@ -6195,7 +6202,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "sql-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"interrupt-support",
|
||||
"lazy_static",
|
||||
|
@ -6316,7 +6323,7 @@ dependencies = [
|
|||
"gecko-profiler",
|
||||
"icu_segmenter",
|
||||
"indexmap",
|
||||
"itertools",
|
||||
"itertools 0.14.0",
|
||||
"itoa",
|
||||
"lazy_static",
|
||||
"log",
|
||||
|
@ -6401,7 +6408,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
|||
[[package]]
|
||||
name = "suggest"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
|
@ -6453,7 +6460,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "sync-guid"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"base64 0.21.999",
|
||||
"rand",
|
||||
|
@ -6464,7 +6471,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "sync15"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
|
@ -6504,7 +6511,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "tabs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
|
@ -6848,7 +6855,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
|
|||
[[package]]
|
||||
name = "types"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"rusqlite 0.33.0",
|
||||
"serde",
|
||||
|
@ -7230,7 +7237,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
|||
[[package]]
|
||||
name = "viaduct"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"ffi-support",
|
||||
"log",
|
||||
|
@ -7400,7 +7407,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "webext-storage"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=e1b42aa3292a71e788bc0f95fb5ab5fbe533996f#e1b42aa3292a71e788bc0f95fb5ab5fbe533996f"
|
||||
source = "git+https://github.com/mozilla/application-services?rev=41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8#41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"error-support",
|
||||
|
|
23
Cargo.toml
23
Cargo.toml
|
@ -68,7 +68,7 @@ uniffi_bindgen = "0.29.1"
|
|||
# Shared across multiple application-services consumers.
|
||||
rusqlite = "0.33.0"
|
||||
# Shared across multiple glean consumers.
|
||||
glean = "=64.0.1"
|
||||
glean = "=64.1.1"
|
||||
|
||||
# Explicitly specify what our profiles use. The opt-level setting here is
|
||||
# a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the
|
||||
|
@ -220,6 +220,9 @@ ron = { path = "build/rust/ron" }
|
|||
# Patch `strum` 0.26.* to 0.27.
|
||||
strum = { path = "build/rust/strum" }
|
||||
|
||||
# Patch `itertools` 0.10.* to 0.14.
|
||||
itertools = { path = "build/rust/itertools" }
|
||||
|
||||
# Overrides to allow easier use of common internal crates.
|
||||
moz_asserts = { path = "mozglue/static/rust/moz_asserts" }
|
||||
|
||||
|
@ -260,14 +263,14 @@ malloc_size_of_derive = { path = "xpcom/rust/malloc_size_of_derive" }
|
|||
objc = { git = "https://github.com/glandium/rust-objc", rev = "4de89f5aa9851ceca4d40e7ac1e2759410c04324" }
|
||||
|
||||
# application-services overrides to make updating them all simpler.
|
||||
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
relevancy = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
search = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
sql-support = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
suggest = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
sync15 = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
tabs = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
viaduct = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "e1b42aa3292a71e788bc0f95fb5ab5fbe533996f" }
|
||||
interrupt-support = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
relevancy = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
search = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
sql-support = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
suggest = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
sync15 = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
tabs = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
viaduct = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "41e0b8f5679977ff2f551eb60fa9b3288ce1f2d8" }
|
||||
|
||||
allocator-api2 = { path = "third_party/rust/allocator-api2" }
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
GeckoSharedLibrary("AccessibleMarshal", linkage=None)
|
||||
GeckoSharedLibrary("AccessibleMarshal")
|
||||
|
||||
# Missing here, is the notion that changes to the idl files included by
|
||||
# ISimpleDOM.idl (e.g. ISimpleDOMNode.idl) should rebuild the outputs.
|
||||
|
|
|
@ -307,6 +307,9 @@ Class a11y::GetTypeFromRole(roles::Role aRole) {
|
|||
case roles::OUTLINEITEM:
|
||||
return [mozOutlineRowAccessible class];
|
||||
|
||||
case roles::LABEL:
|
||||
return [MOXLabelAccessible class];
|
||||
|
||||
default:
|
||||
return [mozAccessible class];
|
||||
}
|
||||
|
|
|
@ -887,22 +887,19 @@ struct RoleDescrComparator {
|
|||
: nullptr;
|
||||
if (maybeRoot && maybeRoot->IsRoot() &&
|
||||
[[self moxDOMIdentifier] isEqualToString:@"a11y-announcement"]) {
|
||||
// Our actual announcement should be stored as a child of the alert,
|
||||
// so we verify a child exists, and then query that child below.
|
||||
NSArray* children = [self moxChildren];
|
||||
MOZ_ASSERT([children count] == 1 && children[0],
|
||||
"A11yUtil event received, but no announcement found?");
|
||||
|
||||
mozAccessible* announcement = children[0];
|
||||
NSString* key;
|
||||
if ([announcement providesLabelNotTitle]) {
|
||||
key = [announcement moxLabel];
|
||||
nsAutoString name;
|
||||
// Our actual announcement should be stored as a child of the alert.
|
||||
if (Accessible* announcement = mGeckoAccessible->FirstChild()) {
|
||||
announcement->Name(name);
|
||||
} else {
|
||||
key = [announcement moxTitle];
|
||||
MOZ_ASSERT_UNREACHABLE(
|
||||
"A11yUtil event received, but no announcement found?");
|
||||
}
|
||||
|
||||
NSDictionary* info = @{
|
||||
NSAccessibilityAnnouncementKey : key ? key : @(""),
|
||||
NSAccessibilityAnnouncementKey : name.IsEmpty()
|
||||
? @("")
|
||||
: nsCocoaUtils::ToNSString(name),
|
||||
// High priority means VO will stop what it is currently speaking
|
||||
// to speak our announcement.
|
||||
NSAccessibilityPriorityKey : @(NSAccessibilityPriorityHigh)
|
||||
|
|
|
@ -42,3 +42,10 @@
|
|||
- (NSString*)moxTitle;
|
||||
|
||||
@end
|
||||
|
||||
@interface MOXLabelAccessible : mozAccessible
|
||||
|
||||
// override
|
||||
- (NSString*)moxTitle;
|
||||
|
||||
@end
|
||||
|
|
|
@ -81,3 +81,11 @@ using namespace mozilla::a11y;
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MOXLabelAccessible
|
||||
|
||||
- (NSString*)moxTitle {
|
||||
return @"";
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -23,6 +23,7 @@ https_first_disabled = true
|
|||
["browser_aria_controls_flowto.js"]
|
||||
|
||||
["browser_aria_current.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt"] # Bug 1802555
|
||||
|
||||
["browser_aria_expanded.js"]
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ addAccessibleTask(
|
|||
let n1 = getNativeInterface(accDoc, "n1");
|
||||
let n1Label = n1.getAttributeValue("AXTitleUIElement");
|
||||
// XXX: In Safari the label is an AXText with an AXValue,
|
||||
// here it is an AXGroup witth an AXTitle
|
||||
is(n1Label.getAttributeValue("AXTitle"), "Label");
|
||||
// we emulate that so VoiceOver does not speak the label twice.
|
||||
is(n1Label.getAttributeValue("AXTitle"), "");
|
||||
|
||||
let n2 = getNativeInterface(accDoc, "n2");
|
||||
is(n2.getAttributeValue("AXDescription"), "Two Labels");
|
||||
|
|
14
aclocal.m4
vendored
Normal file
14
aclocal.m4
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
dnl
|
||||
dnl Local autoconf macros used with mozilla
|
||||
dnl The contents of this file are under the Public Domain.
|
||||
dnl
|
||||
|
||||
builtin(include, build/autoconf/hooks.m4)dnl
|
||||
builtin(include, build/autoconf/config.status.m4)dnl
|
||||
builtin(include, build/autoconf/altoptions.m4)dnl
|
||||
|
||||
# Read the user's .mozconfig script. We can't do this in
|
||||
# configure.in: autoconf puts the argument parsing code above anything
|
||||
# expanded from configure.in, and we need to get the configure options
|
||||
# from .mozconfig in place before that argument parsing code.
|
||||
MOZ_READ_MOZCONFIG(.)
|
|
@ -101,25 +101,13 @@ export class AboutReaderParent extends JSWindowActorParent {
|
|||
let preferredWidth = message.data.preferredWidth || 0;
|
||||
let uri = Services.io.newURI(message.data.url);
|
||||
|
||||
let result = await new Promise(resolve => {
|
||||
lazy.PlacesUtils.favicons.getFaviconURLForPage(
|
||||
uri,
|
||||
iconUri => {
|
||||
if (iconUri) {
|
||||
resolve({
|
||||
url: message.data.url,
|
||||
faviconUrl: iconUri.spec,
|
||||
});
|
||||
} else {
|
||||
resolve(null);
|
||||
}
|
||||
},
|
||||
preferredWidth
|
||||
);
|
||||
});
|
||||
let result = await lazy.PlacesUtils.favicons.getFaviconForPage(
|
||||
uri,
|
||||
preferredWidth
|
||||
);
|
||||
|
||||
this.callListeners(message);
|
||||
return result;
|
||||
return result && { url: uri.spec, faviconUrl: result.uri.spec };
|
||||
} catch (ex) {
|
||||
console.error(
|
||||
"Error requesting favicon URL for about:reader content: ",
|
||||
|
|
|
@ -908,9 +908,6 @@ pref("browser.spin_cursor_while_busy", false);
|
|||
// Enable display of contextual-password-manager option in browser sidebar
|
||||
pref("browser.contextual-password-manager.enabled", false);
|
||||
|
||||
// Add the "Passwords" tool to the sidebar if contextual-password-manager is enabled.
|
||||
pref("sidebar.newTool.migration.passwords", '{ "visibilityPref": "browser.contextual-password-manager.enabled"}');
|
||||
|
||||
// Enables the display of the Mozilla VPN banner in private browsing windows
|
||||
pref("browser.privatebrowsing.vpnpromourl", "https://vpn.mozilla.org/?utm_source=firefox-browser&utm_medium=firefox-%CHANNEL%-browser&utm_campaign=private-browsing-vpn-link");
|
||||
|
||||
|
|
|
@ -10,94 +10,6 @@ $schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
|||
$tags:
|
||||
- 'Firefox :: General'
|
||||
|
||||
privacy.sanitize:
|
||||
dialog_open:
|
||||
type: event
|
||||
description: >
|
||||
Dispatched when one of the sanitize dialogs opens
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/1856417
|
||||
- https://bugzilla.mozilla.org/1922608
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1856417#c4
|
||||
notification_emails:
|
||||
- wwen@mozilla.com
|
||||
- emz@mozilla.com
|
||||
expires: 140
|
||||
extra_keys:
|
||||
context:
|
||||
description: >
|
||||
string representing which context the dialog was opened in,
|
||||
one of ["browser", "clearSiteData", "clearHistory"]
|
||||
type: string
|
||||
clear:
|
||||
type: event
|
||||
description: >
|
||||
Dispatched when the dialog is accepted (to clear)
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/1856417
|
||||
- https://bugzilla.mozilla.org/1922608
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1856417#c4
|
||||
notification_emails:
|
||||
- wwen@mozilla.com
|
||||
- emz@mozilla.com
|
||||
expires: 140
|
||||
extra_keys:
|
||||
context:
|
||||
description: >
|
||||
string representing which context the dialog was opened in,
|
||||
one of ["browser", "clearSiteData", "clearHistory"]
|
||||
type: string
|
||||
history_and_downloads:
|
||||
description: true if browsing history and downloads is selected to be cleared
|
||||
type: boolean
|
||||
cookies_and_storage:
|
||||
description: true if cookies and storage is selected to be cleared
|
||||
type: boolean
|
||||
cache:
|
||||
description: true if cache is selected to be cleared
|
||||
type: boolean
|
||||
site_settings:
|
||||
description: true if site settings is selected to be cleared
|
||||
type: boolean
|
||||
form_data:
|
||||
description: true if form data is selected to be cleared
|
||||
type: boolean
|
||||
clearing_time_span_selected:
|
||||
type: event
|
||||
description: >
|
||||
The time span range selected to sanitize
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/1856417
|
||||
- https://bugzilla.mozilla.org/1922608
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1856417#c4
|
||||
notification_emails:
|
||||
- wwen@mozilla.com
|
||||
- emz@mozilla.com
|
||||
expires: 140
|
||||
extra_keys:
|
||||
time_span:
|
||||
description: The timespan that was selected corresponding to one of Sanitizer.TIMESPAN_*'s value
|
||||
|
||||
type: string
|
||||
load_time:
|
||||
type: timing_distribution
|
||||
time_unit: millisecond
|
||||
description: >
|
||||
How much time was spent to open the dialog, including loading data sizes
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/1856417
|
||||
- https://bugzilla.mozilla.org/1922608
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1856417#c4
|
||||
notification_emails:
|
||||
- wwen@mozilla.com
|
||||
- emz@mozilla.com
|
||||
expires:
|
||||
140
|
||||
|
||||
security.ui.protectionspopup:
|
||||
open_protections_popup:
|
||||
type: event
|
||||
|
|
|
@ -111,18 +111,8 @@ var gSanitizePromptDialog = {
|
|||
}
|
||||
|
||||
if (!lazy.USE_OLD_DIALOG) {
|
||||
// Begin collecting how long it takes to load from here
|
||||
let timerId = Glean.privacySanitize.loadTime.start();
|
||||
this._dataSizesUpdated = false;
|
||||
this.dataSizesFinishedUpdatingPromise = this.getAndUpdateDataSizes()
|
||||
.then(() => {
|
||||
// We're done loading, stop telemetry here
|
||||
Glean.privacySanitize.loadTime.stopAndAccumulate(timerId);
|
||||
})
|
||||
.catch(() => {
|
||||
// We're done loading, stop telemetry here
|
||||
Glean.privacySanitize.loadTime.cancel(timerId);
|
||||
});
|
||||
this.dataSizesFinishedUpdatingPromise = this.getAndUpdateDataSizes(); // this promise is still used in tests
|
||||
}
|
||||
|
||||
let OKButton = this._dialog.getButton("accept");
|
||||
|
@ -191,10 +181,6 @@ var gSanitizePromptDialog = {
|
|||
if (this._inClearOnShutdownNewDialog) {
|
||||
this.updatePrefs();
|
||||
} else {
|
||||
if (!lazy.USE_OLD_DIALOG) {
|
||||
this.reportTelemetry("clear");
|
||||
}
|
||||
|
||||
this.sanitize(e);
|
||||
}
|
||||
});
|
||||
|
@ -224,10 +210,6 @@ var gSanitizePromptDialog = {
|
|||
} else {
|
||||
this.warningBox.hidden = true;
|
||||
}
|
||||
|
||||
if (!lazy.USE_OLD_DIALOG) {
|
||||
this.reportTelemetry("open");
|
||||
}
|
||||
},
|
||||
|
||||
updateAcceptButtonState() {
|
||||
|
@ -558,42 +540,6 @@ var gSanitizePromptDialog = {
|
|||
}
|
||||
return items;
|
||||
},
|
||||
|
||||
reportTelemetry(event) {
|
||||
let contextOpenedIn;
|
||||
if (this._inClearSiteDataNewDialog) {
|
||||
contextOpenedIn = "clearSiteData";
|
||||
} else if (this._inBrowserWindow) {
|
||||
contextOpenedIn = "browser";
|
||||
} else {
|
||||
contextOpenedIn = "clearHistory";
|
||||
}
|
||||
|
||||
// Report time span and clearing options after sanitize is clicked
|
||||
if (event == "clear") {
|
||||
Glean.privacySanitize.clearingTimeSpanSelected.record({
|
||||
time_span: this.selectedTimespan.toString(),
|
||||
});
|
||||
|
||||
let selectedOptions = this.getItemsToClear();
|
||||
Glean.privacySanitize.clear.record({
|
||||
context: contextOpenedIn,
|
||||
history_and_downloads: selectedOptions.includes(
|
||||
"browsingHistoryAndDownloads"
|
||||
),
|
||||
cookies_and_storage: selectedOptions.includes("cookiesAndStorage"),
|
||||
cache: selectedOptions.includes("cache"),
|
||||
site_settings: selectedOptions.includes("siteSettings"),
|
||||
form_data: selectedOptions.includes("formdata"),
|
||||
});
|
||||
}
|
||||
// if the dialog was just opened, just report which context it was opened in
|
||||
else {
|
||||
Glean.privacySanitize.dialogOpen.record({
|
||||
context: contextOpenedIn,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// We need to give the dialog an opportunity to set up the DOM
|
||||
|
|
|
@ -31,17 +31,10 @@ add_task(async function browser_loader() {
|
|||
// Ensure the favicon has not been stored.
|
||||
/* eslint-disable mozilla/no-arbitrary-setTimeout */
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await new Promise((resolve, reject) => {
|
||||
PlacesUtils.favicons.getFaviconURLForPage(
|
||||
Services.io.newURI(PAGE_URL),
|
||||
foundIconURI => {
|
||||
if (foundIconURI) {
|
||||
reject(new Error("An icon has been stored " + foundIconURI.spec));
|
||||
}
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
});
|
||||
let favicon = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI(PAGE_URL)
|
||||
);
|
||||
Assert.ok(!favicon);
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
|
@ -68,17 +61,10 @@ async function later_addition(iconUrl) {
|
|||
// Ensure the favicon has not been stored.
|
||||
/* eslint-disable mozilla/no-arbitrary-setTimeout */
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await new Promise((resolve, reject) => {
|
||||
PlacesUtils.favicons.getFaviconURLForPage(
|
||||
Services.io.newURI(PAGE_URL),
|
||||
foundIconURI => {
|
||||
if (foundIconURI) {
|
||||
reject(new Error("An icon has been stored " + foundIconURI.spec));
|
||||
}
|
||||
resolve();
|
||||
}
|
||||
);
|
||||
});
|
||||
let favicon = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI(PAGE_URL)
|
||||
);
|
||||
Assert.ok(!favicon);
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
|
||||
|
@ -127,13 +113,10 @@ add_task(async function root_icon_stored() {
|
|||
},
|
||||
async function () {
|
||||
await TestUtils.waitForCondition(async () => {
|
||||
let uri = await new Promise(resolve =>
|
||||
PlacesUtils.favicons.getFaviconURLForPage(
|
||||
Services.io.newURI("http://www.nostore.com/page"),
|
||||
resolve
|
||||
)
|
||||
let favicon = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI("http://www.nostore.com/page")
|
||||
);
|
||||
return uri?.spec == "http://www.nostore.com/favicon.ico";
|
||||
return favicon?.uri.spec == "http://www.nostore.com/favicon.ico";
|
||||
}, "wait for the favicon to be stored");
|
||||
Assert.ok(await noStorePromise, "Should have received no-store header");
|
||||
}
|
||||
|
@ -174,13 +157,10 @@ add_task(async function root_icon_after_pageshow_stored() {
|
|||
},
|
||||
async function () {
|
||||
await TestUtils.waitForCondition(async () => {
|
||||
let uri = await new Promise(resolve =>
|
||||
PlacesUtils.favicons.getFaviconURLForPage(
|
||||
Services.io.newURI("http://rootafterpageshow.com/page"),
|
||||
resolve
|
||||
)
|
||||
let favicon = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI("http://rootafterpageshow.com/page")
|
||||
);
|
||||
return uri?.spec == "http://rootafterpageshow.com/favicon.ico";
|
||||
return favicon?.uri.spec == "http://rootafterpageshow.com/favicon.ico";
|
||||
}, "wait for the favicon to be stored");
|
||||
}
|
||||
);
|
||||
|
|
|
@ -21,22 +21,14 @@ async function test_icon(pageUrl, iconUrl) {
|
|||
|
||||
// Ensure the favicon has been stored.
|
||||
await storedIconPromise;
|
||||
await new Promise((resolve, reject) => {
|
||||
PlacesUtils.favicons.getFaviconURLForPage(
|
||||
Services.io.newURI(pageUrl),
|
||||
foundIconURI => {
|
||||
if (foundIconURI) {
|
||||
Assert.equal(
|
||||
foundIconURI.spec,
|
||||
iconUrl,
|
||||
"Should have stored the expected icon."
|
||||
);
|
||||
resolve();
|
||||
}
|
||||
reject();
|
||||
}
|
||||
);
|
||||
});
|
||||
let favicon = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI(pageUrl)
|
||||
);
|
||||
Assert.equal(
|
||||
favicon.uri.spec,
|
||||
iconUrl,
|
||||
"Should have stored the expected icon."
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,9 @@ run-if = [
|
|||
"debug",
|
||||
"nightly_build", # Requires StartupRecorder.sys.mjs, which isn't shipped everywhere by default
|
||||
]
|
||||
skip-if = [
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1889278
|
||||
]
|
||||
|
||||
["browser_tabclose.js"]
|
||||
skip-if = [
|
||||
|
|
|
@ -767,134 +767,6 @@ add_task(async function test_clear_on_shutdown() {
|
|||
await SiteDataTestUtils.clear();
|
||||
});
|
||||
|
||||
add_task(async function testEntryPointTelemetry() {
|
||||
Services.fog.testResetFOG();
|
||||
|
||||
// Telemetry count we expect for each context
|
||||
const EXPECTED_CONTEXT_COUNTS = {
|
||||
browser: 3,
|
||||
clearHistory: 2,
|
||||
clearSiteData: 1,
|
||||
};
|
||||
|
||||
for (let key in EXPECTED_CONTEXT_COUNTS) {
|
||||
let count = 0;
|
||||
|
||||
for (let i = 0; i < EXPECTED_CONTEXT_COUNTS[key]; i++) {
|
||||
await performActionsOnDialog({ context: key });
|
||||
}
|
||||
|
||||
let contextTelemetry = Glean.privacySanitize.dialogOpen.testGetValue();
|
||||
for (let object of contextTelemetry) {
|
||||
if (object.extra.context == key) {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
is(
|
||||
count,
|
||||
EXPECTED_CONTEXT_COUNTS[key],
|
||||
`There should be ${EXPECTED_CONTEXT_COUNTS[key]} opens from ${key} context`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function testTimespanTelemetry() {
|
||||
Services.fog.testResetFOG();
|
||||
|
||||
// Expected timespan selections from telemetry
|
||||
const EXPECTED_TIMESPANS = [
|
||||
Sanitizer.TIMESPAN_HOUR,
|
||||
Sanitizer.TIMESPAN_2HOURS,
|
||||
Sanitizer.TIMESPAN_4HOURS,
|
||||
Sanitizer.TIMESPAN_EVERYTHING,
|
||||
];
|
||||
|
||||
for (let timespan of EXPECTED_TIMESPANS) {
|
||||
await performActionsOnDialog({ timespan });
|
||||
}
|
||||
|
||||
for (let index in EXPECTED_TIMESPANS) {
|
||||
is(
|
||||
Glean.privacySanitize.clearingTimeSpanSelected.testGetValue()[index].extra
|
||||
.time_span,
|
||||
EXPECTED_TIMESPANS[index].toString(),
|
||||
`Selected timespan should be ${EXPECTED_TIMESPANS[index]}`
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function testLoadtimeTelemetry() {
|
||||
Services.fog.testResetFOG();
|
||||
|
||||
// loadtime metric is collected everytime that the dialog is opened
|
||||
// expected number of times dialog will be opened for the test for each context
|
||||
let EXPECTED_CONTEXT_COUNTS = {
|
||||
browser: 2,
|
||||
clearHistory: 3,
|
||||
clearSiteData: 2,
|
||||
};
|
||||
|
||||
// open dialog based on expected_context_counts
|
||||
for (let context in EXPECTED_CONTEXT_COUNTS) {
|
||||
for (let i = 0; i < EXPECTED_CONTEXT_COUNTS[context]; i++) {
|
||||
await performActionsOnDialog({ context });
|
||||
}
|
||||
}
|
||||
|
||||
let loadTimeDistribution = Glean.privacySanitize.loadTime.testGetValue();
|
||||
|
||||
let expectedNumberOfCounts = Object.entries(EXPECTED_CONTEXT_COUNTS).reduce(
|
||||
(acc, [, value]) => acc + value,
|
||||
0
|
||||
);
|
||||
// No guarantees from timers means no guarantees on buckets.
|
||||
// But we can guarantee it's only two samples.
|
||||
is(
|
||||
Object.entries(loadTimeDistribution.values).reduce(
|
||||
(acc, [, count]) => acc + count,
|
||||
0
|
||||
),
|
||||
expectedNumberOfCounts,
|
||||
`Only ${expectedNumberOfCounts} buckets with samples`
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function testClearingOptionsTelemetry() {
|
||||
Services.fog.testResetFOG();
|
||||
|
||||
let expectedObject = {
|
||||
context: "clearSiteData",
|
||||
history_and_downloads: "true",
|
||||
cookies_and_storage: "false",
|
||||
cache: "true",
|
||||
site_settings: "true",
|
||||
form_data: "false",
|
||||
};
|
||||
|
||||
await performActionsOnDialog({
|
||||
context: "clearSiteData",
|
||||
browsingHistoryAndDownloads: true,
|
||||
cookiesAndStorage: false,
|
||||
cache: true,
|
||||
siteSettings: true,
|
||||
formData: false,
|
||||
});
|
||||
|
||||
let telemetryObject = Glean.privacySanitize.clear.testGetValue();
|
||||
Assert.equal(
|
||||
telemetryObject.length,
|
||||
1,
|
||||
"There should be only 1 telemetry object recorded"
|
||||
);
|
||||
|
||||
Assert.deepEqual(
|
||||
expectedObject,
|
||||
telemetryObject[0].extra,
|
||||
`Expected ${telemetryObject} to be the same as ${expectedObject}`
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function testClearHistoryCheckboxStatesAfterMigration() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
|
|
|
@ -18,6 +18,9 @@ prefs = [
|
|||
]
|
||||
|
||||
["browser_WebrtcGlobalInformation.js"]
|
||||
skip-if = [
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1961544
|
||||
]
|
||||
|
||||
["browser_device_controls_menus.js"]
|
||||
skip-if = [
|
||||
|
|
|
@ -13,3 +13,4 @@ prefs = [
|
|||
]
|
||||
|
||||
["../browser_devices_get_user_media_grace.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && debug"] # Bug 1961543
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
<?csp default-src chrome: ?>
|
||||
<?csp default-src chrome:; img-src chrome: data:; ?>
|
||||
|
||||
<window id="webextpanels-window"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
|
|
|
@ -38,7 +38,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
DesktopActorRegistry:
|
||||
"moz-src:///browser/components/DesktopActorRegistry.sys.mjs",
|
||||
Discovery: "resource:///modules/Discovery.sys.mjs",
|
||||
DoHController: "resource:///modules/DoHController.sys.mjs",
|
||||
DoHController: "resource://gre/modules/DoHController.sys.mjs",
|
||||
DownloadsViewableInternally:
|
||||
"resource:///modules/DownloadsViewableInternally.sys.mjs",
|
||||
ExtensionsUI: "resource:///modules/ExtensionsUI.sys.mjs",
|
||||
|
|
|
@ -196,6 +196,10 @@ html {
|
|||
z-index: 1;
|
||||
box-sizing: border-box;
|
||||
|
||||
@media (prefers-contrast){
|
||||
border: 1px solid var(--in-content-page-color)
|
||||
}
|
||||
|
||||
&.no-steps {
|
||||
padding-bottom: 48px;
|
||||
}
|
||||
|
|
|
@ -1352,6 +1352,11 @@ html {
|
|||
z-index: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media (prefers-contrast) {
|
||||
.onboardingContainer .main-content {
|
||||
border: 1px solid var(--in-content-page-color);
|
||||
}
|
||||
}
|
||||
.onboardingContainer .main-content.no-steps {
|
||||
padding-bottom: 48px;
|
||||
}
|
||||
|
|
|
@ -504,7 +504,6 @@ const TEST_GLOBAL = {
|
|||
},
|
||||
FX_MONITOR_OAUTH_CLIENT_ID: "fake_client_id",
|
||||
ExperimentAPI: {
|
||||
getExperiment() {},
|
||||
getExperimentMetaData() {},
|
||||
getRolloutMetaData() {},
|
||||
},
|
||||
|
|
|
@ -7,6 +7,8 @@ const lazy = {};
|
|||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
||||
RemoteL10n: "resource:///modules/asrouter/RemoteL10n.sys.mjs",
|
||||
SpecialMessageActions:
|
||||
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs",
|
||||
});
|
||||
|
||||
class InfoBarNotification {
|
||||
|
@ -40,7 +42,7 @@ class InfoBarNotification {
|
|||
this.notification = await notificationContainer.appendNotification(
|
||||
this.message.id,
|
||||
{
|
||||
label: this.formatMessageConfig(doc, content.text),
|
||||
label: this.formatMessageConfig(doc, browser, content.text),
|
||||
image: content.icon || "chrome://branding/content/icon64.png",
|
||||
priority,
|
||||
eventCallback: this.infobarCallback,
|
||||
|
@ -53,14 +55,53 @@ class InfoBarNotification {
|
|||
this.addImpression();
|
||||
}
|
||||
|
||||
formatMessageConfig(doc, content) {
|
||||
let docFragment = doc.createDocumentFragment();
|
||||
// notificationbox will only `appendChild` for documentFragments
|
||||
docFragment.appendChild(
|
||||
lazy.RemoteL10n.createElement(doc, "span", { content })
|
||||
);
|
||||
formatMessageConfig(doc, browser, content) {
|
||||
const frag = doc.createDocumentFragment();
|
||||
const parts = Array.isArray(content) ? content : [content];
|
||||
for (const part of parts) {
|
||||
let node;
|
||||
if (typeof part === "string") {
|
||||
node = doc.createTextNode(part);
|
||||
// Handle embedded link
|
||||
} else if (part.href) {
|
||||
const a = doc.createElement("a");
|
||||
a.href = part.href;
|
||||
a.addEventListener("click", e => {
|
||||
e.preventDefault();
|
||||
lazy.SpecialMessageActions.handleAction(
|
||||
{ type: "OPEN_URL", data: { args: a.href, where: part.where } },
|
||||
browser
|
||||
);
|
||||
});
|
||||
|
||||
return docFragment;
|
||||
if (part.string_id) {
|
||||
const l10n = lazy.RemoteL10n.createElement(doc, "span", {
|
||||
content: {
|
||||
string_id: part.string_id,
|
||||
...(part.args && { args: part.args }),
|
||||
},
|
||||
});
|
||||
a.appendChild(l10n);
|
||||
} else {
|
||||
a.textContent = part.raw || "";
|
||||
}
|
||||
node = a;
|
||||
} else if (part.string_id) {
|
||||
node = lazy.RemoteL10n.createElement(doc, "span", {
|
||||
content: {
|
||||
string_id: part.string_id,
|
||||
...(part.args && { args: part.args }),
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const text = part.raw !== null ? part.raw : String(part);
|
||||
node = doc.createTextNode(text);
|
||||
}
|
||||
|
||||
frag.appendChild(node);
|
||||
}
|
||||
|
||||
return frag;
|
||||
}
|
||||
|
||||
formatButtonConfig(button) {
|
||||
|
|
|
@ -48,6 +48,9 @@ skip-if = ["a11y_checks"] # Bug 1854515 and 1858041 to investigate intermittent
|
|||
["browser_bookmarks_bar_button.js"]
|
||||
|
||||
["browser_feature_callout.js"]
|
||||
skip-if = [
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64'", # Bug 1796720
|
||||
]
|
||||
|
||||
["browser_feature_callout_in_chrome.js"]
|
||||
skip-if = [
|
||||
|
|
|
@ -201,7 +201,7 @@ add_task(async function test_loading_experimentsAPI() {
|
|||
// Fetch the new recipe from RS
|
||||
await RemoteSettingsExperimentLoader.updateRecipes();
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => ExperimentAPI.getExperiment({ featureId: "cfr" }),
|
||||
() => ExperimentAPI.getExperimentMetaData({ featureId: "cfr" }),
|
||||
"ExperimentAPI should return an experiment"
|
||||
);
|
||||
|
||||
|
@ -219,7 +219,7 @@ add_task(async function test_loading_fxms_message_1_feature() {
|
|||
// Fetch the new recipe from RS
|
||||
await RemoteSettingsExperimentLoader.updateRecipes();
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => ExperimentAPI.getExperiment({ featureId: "fxms-message-1" }),
|
||||
() => ExperimentAPI.getExperimentMetaData({ featureId: "fxms-message-1" }),
|
||||
"ExperimentAPI should return an experiment"
|
||||
);
|
||||
|
||||
|
@ -253,7 +253,7 @@ add_task(async function test_exposure_ping() {
|
|||
// Fetch the new recipe from RS
|
||||
await RemoteSettingsExperimentLoader.updateRecipes();
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => ExperimentAPI.getExperiment({ featureId: "cfr" }),
|
||||
() => ExperimentAPI.getExperimentMetaData({ featureId: "cfr" }),
|
||||
"ExperimentAPI should return an experiment"
|
||||
);
|
||||
|
||||
|
@ -312,7 +312,7 @@ add_task(async function test_update_on_enrollments_changed() {
|
|||
await RemoteSettingsExperimentLoader.updateRecipes();
|
||||
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => ExperimentAPI.getExperiment({ featureId: "cfr" }),
|
||||
() => ExperimentAPI.getExperimentMetaData({ featureId: "cfr" }),
|
||||
"ExperimentAPI should return an experiment"
|
||||
);
|
||||
await enrollmentChanged;
|
||||
|
@ -349,7 +349,7 @@ add_task(async function test_emptyMessage() {
|
|||
await setup(experiment);
|
||||
await RemoteSettingsExperimentLoader.updateRecipes();
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => ExperimentAPI.getExperiment({ featureId: "cfr" }),
|
||||
() => ExperimentAPI.getExperimentMetaData({ featureId: "cfr" }),
|
||||
"ExperimentAPI should return an experiment"
|
||||
);
|
||||
|
||||
|
@ -404,7 +404,7 @@ add_task(async function test_multiMessageTreatment() {
|
|||
await setup(recipe);
|
||||
await RemoteSettingsExperimentLoader.updateRecipes();
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => ExperimentAPI.getExperiment({ featureId }),
|
||||
() => ExperimentAPI.getExperimentMetaData({ featureId }),
|
||||
"ExperimentAPI should return an experiment"
|
||||
);
|
||||
|
||||
|
|
|
@ -252,3 +252,119 @@ add_task(
|
|||
);
|
||||
}
|
||||
);
|
||||
|
||||
function getMeaningfulNodes(infobar) {
|
||||
return [...infobar.notification.messageText.childNodes].filter(
|
||||
n =>
|
||||
n.nodeType === Node.ELEMENT_NODE ||
|
||||
(n.nodeType === Node.TEXT_NODE && n.textContent.trim())
|
||||
);
|
||||
}
|
||||
|
||||
async function showInfobar(text, box, browser) {
|
||||
let msg = {
|
||||
id: "Test Infobar",
|
||||
content: {
|
||||
text,
|
||||
type: "global",
|
||||
priority: box.PRIORITY_INFO_LOW,
|
||||
buttons: [{ label: "Close", action: { type: "CANCEL" } }],
|
||||
},
|
||||
};
|
||||
let stub = sinon.stub();
|
||||
let infobar = await InfoBar.showInfoBarMessage(browser, msg, stub);
|
||||
return { infobar, stub };
|
||||
}
|
||||
|
||||
add_task(async function test_formatMessageConfig_single_string() {
|
||||
const win = BrowserWindowTracker.getTopWindow();
|
||||
const browser = win.gBrowser.selectedBrowser;
|
||||
const box = win.gNotificationBox;
|
||||
|
||||
let { infobar } = await showInfobar("Just a plain string", box, browser);
|
||||
const nodes = getMeaningfulNodes(infobar);
|
||||
|
||||
Assert.equal(nodes.length, 1, "One meaningful node for single string");
|
||||
Assert.equal(nodes[0].nodeType, Node.TEXT_NODE, "That node is a text node");
|
||||
Assert.equal(nodes[0].textContent.trim(), "Just a plain string");
|
||||
|
||||
infobar.notification.closeButton.click();
|
||||
await BrowserTestUtils.waitForCondition(() => !InfoBar._activeInfobar);
|
||||
});
|
||||
|
||||
add_task(async function test_formatMessageConfig_array() {
|
||||
const win = BrowserWindowTracker.getTopWindow();
|
||||
const browser = win.gBrowser.selectedBrowser;
|
||||
const box = win.gNotificationBox;
|
||||
|
||||
let parts = [
|
||||
"A",
|
||||
{ raw: "B" },
|
||||
{ string_id: "launch-on-login-infobar-message" },
|
||||
{ href: "https://x.test/", raw: "LINK" },
|
||||
"Z",
|
||||
];
|
||||
let { infobar } = await showInfobar(parts, box, browser);
|
||||
const nodes = getMeaningfulNodes(infobar);
|
||||
|
||||
Assert.equal(nodes.length, parts.length, "One node per array part");
|
||||
Assert.equal(nodes[0].textContent, "A", "Plain text");
|
||||
Assert.equal(nodes[1].textContent, "B", "Raw text");
|
||||
Assert.equal(nodes[2].localName, "remote-text", "L10n element");
|
||||
Assert.equal(
|
||||
nodes[2].getAttribute("fluent-remote-id"),
|
||||
"launch-on-login-infobar-message",
|
||||
"Fluent ID"
|
||||
);
|
||||
const [, , , a] = nodes;
|
||||
Assert.equal(a.localName, "a", "It's a link");
|
||||
Assert.equal(a.getAttribute("href"), "https://x.test/", "hred preserved");
|
||||
Assert.equal(a.textContent, "LINK", "Link text");
|
||||
Assert.equal(nodes[4].textContent, "Z", "Trailing text");
|
||||
|
||||
infobar.notification.closeButton.click();
|
||||
await BrowserTestUtils.waitForCondition(() => !InfoBar._activeInfobar);
|
||||
});
|
||||
|
||||
add_task(async function test_specialMessageAction_onLinkClick() {
|
||||
const win = BrowserWindowTracker.getTopWindow();
|
||||
const browser = win.gBrowser.selectedBrowser;
|
||||
const box = win.gNotificationBox;
|
||||
|
||||
const { SpecialMessageActions } = ChromeUtils.importESModule(
|
||||
"resource://messaging-system/lib/SpecialMessageActions.sys.mjs"
|
||||
);
|
||||
let handleStub = sinon.stub(SpecialMessageActions, "handleAction");
|
||||
|
||||
const parts = [
|
||||
"Click ",
|
||||
{ raw: "here", href: "https://example.com/foo", where: "tab" },
|
||||
" to continue",
|
||||
];
|
||||
let { infobar } = await showInfobar(parts, box, browser);
|
||||
|
||||
let link = infobar.notification.messageText.querySelector("a[href]");
|
||||
Assert.ok(link, "Found the link");
|
||||
EventUtils.synthesizeMouseAtCenter(link, {}, browser.ownerGlobal);
|
||||
|
||||
Assert.equal(handleStub.callCount, 1, "handleAction was invoked once");
|
||||
let [actionArg, browserArg] = handleStub.firstCall.args;
|
||||
Assert.deepEqual(
|
||||
actionArg,
|
||||
{
|
||||
type: "OPEN_URL",
|
||||
data: { args: "https://example.com/foo", where: "tab" },
|
||||
},
|
||||
"Passed correct action to handleAction"
|
||||
);
|
||||
Assert.equal(
|
||||
browserArg,
|
||||
browser,
|
||||
"Passed the selectedBrowser to handleAction"
|
||||
);
|
||||
|
||||
infobar.notification.closeButton.click();
|
||||
await BrowserTestUtils.waitForCondition(() => !InfoBar._activeInfobar);
|
||||
|
||||
handleStub.restore();
|
||||
});
|
||||
|
|
|
@ -111,7 +111,7 @@ add_task(async function test_messagesLoaded_reach_experiment() {
|
|||
});
|
||||
await RemoteSettingsExperimentLoader.updateRecipes();
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => ExperimentAPI.getExperiment({ featureId }),
|
||||
() => ExperimentAPI.getExperimentMetaData({ featureId }),
|
||||
"ExperimentAPI should return an experiment"
|
||||
);
|
||||
|
||||
|
|
|
@ -276,15 +276,6 @@ describe("ASRouter", () => {
|
|||
active: true,
|
||||
branch: { slug: "experiment-branch-slug" },
|
||||
}),
|
||||
getExperiment: sandbox.stub().returns({
|
||||
branch: {
|
||||
slug: "unit-slug",
|
||||
feature: {
|
||||
featureId: "foo",
|
||||
value: { id: "test-message" },
|
||||
},
|
||||
},
|
||||
}),
|
||||
getAllBranches: sandbox.stub().resolves([]),
|
||||
ready: sandbox.stub().resolves(),
|
||||
},
|
||||
|
@ -2482,8 +2473,6 @@ describe("ASRouter", () => {
|
|||
featureIds: ["infobar"],
|
||||
};
|
||||
|
||||
global.ExperimentAPI.getExperiment.returns(null);
|
||||
|
||||
const result = await MessageLoaderUtils.loadMessagesForProvider(args);
|
||||
|
||||
assert.lengthOf(result.messages, 0);
|
||||
|
|
|
@ -516,7 +516,6 @@ const TEST_GLOBAL = {
|
|||
},
|
||||
FX_MONITOR_OAUTH_CLIENT_ID: "fake_client_id",
|
||||
ExperimentAPI: {
|
||||
getExperiment() {},
|
||||
getExperimentMetaData() {},
|
||||
getRolloutMetaData() {},
|
||||
},
|
||||
|
|
102
browser/components/attribution/metrics.yaml
Normal file
102
browser/components/attribution/metrics.yaml
Normal file
|
@ -0,0 +1,102 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# Adding a new metric? We have docs for that!
|
||||
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
|
||||
|
||||
---
|
||||
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
||||
$tags:
|
||||
- 'Toolkit :: Telemetry'
|
||||
|
||||
glean.attribution:
|
||||
ext:
|
||||
type: object
|
||||
lifetime: user
|
||||
# Permit long description lines
|
||||
# yamllint disable
|
||||
description: |
|
||||
Extended attribution information.
|
||||
Mapped to client_info.attribution.ext in datasets.
|
||||
* `experiment`: name/id of the enrolled funnel experiment
|
||||
* `variation`: name/id of the variation cohort used in the enrolled funnel experiment
|
||||
* `ua`: identifier derived from the user agent downloading the installer
|
||||
e.g. chrome, Google Chrome 123
|
||||
* `dltoken`: Unique token created at Firefox download time.
|
||||
e.g. c18f86a3-f228-4d98-91bb-f90135c0aa9c
|
||||
* `msstoresignedin`: only present if the installation was done through the Microsoft Store,
|
||||
and was able to retrieve the "campaign ID" it was first installed with.
|
||||
This value is "true" if the user was signed into the Microsoft Store
|
||||
when they first installed, and false otherwise.
|
||||
* `dlsource`: identifier that indicate where installations of Firefox originate
|
||||
# yamllint enable
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/1955429
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/1955429
|
||||
notification_emails:
|
||||
- chutten@mozilla.com
|
||||
send_in_pings:
|
||||
- metrics
|
||||
- baseline
|
||||
- events
|
||||
expires: never
|
||||
no_lint:
|
||||
- BASELINE_PING
|
||||
structure:
|
||||
type: object
|
||||
properties:
|
||||
experiment:
|
||||
type: string
|
||||
variation:
|
||||
type: string
|
||||
ua:
|
||||
type: string
|
||||
dltoken:
|
||||
type: string
|
||||
msstoresignedin:
|
||||
type: boolean
|
||||
dlsource:
|
||||
type: string
|
||||
|
||||
glean.distribution:
|
||||
ext:
|
||||
type: object
|
||||
lifetime: user
|
||||
description: |
|
||||
Extended distribution information.
|
||||
Mapped to client_info.distribution.ext in datasets.
|
||||
* `distributionVersion`: pref `distribution.version`, `null` on failure
|
||||
* `partnerId`: pref `mozilla.partner.id`, `null` on failure
|
||||
* `distributor`: pref `app.distributor`, `null` on failure
|
||||
* `distributorChannel`: pref `app.distributor.channel`, `null` on failure
|
||||
* `partnerNames`: list from prefs `app.partner.<name>=<name>`
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/1955429
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/1955429
|
||||
notification_emails:
|
||||
- chutten@mozilla.com
|
||||
send_in_pings:
|
||||
- metrics
|
||||
- baseline
|
||||
- events
|
||||
expires: never
|
||||
no_lint:
|
||||
- BASELINE_PING
|
||||
structure:
|
||||
type: object
|
||||
properties:
|
||||
distributionVersion:
|
||||
type: string
|
||||
partnerId:
|
||||
type: string
|
||||
distributor:
|
||||
type: string
|
||||
distributorChannel:
|
||||
type: string
|
||||
partnerNames:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
|
@ -48,6 +48,7 @@ tags = "bleedover"
|
|||
skip-if = [
|
||||
"os == 'mac' && os_version == '10.15' && processor == 'x86_64' && opt", # Bug 1775706
|
||||
"os == 'mac' && os_version == '11.20' && arch == 'aarch64' && opt", # Bug 1775706
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1775706
|
||||
]
|
||||
|
||||
["browser_originattrs_reopenin.js"]
|
||||
|
|
|
@ -59,6 +59,9 @@ skip-if = ["os == 'linux' && os_version == '18.04' && processor == 'x86_64' && r
|
|||
["browser_877447_skip_missing_ids.js"]
|
||||
|
||||
["browser_878452_drag_to_panel.js"]
|
||||
skip-if = [
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64'", # Bug 1961559
|
||||
]
|
||||
|
||||
["browser_884402_customize_from_overflow.js"]
|
||||
tags = "overflowable-toolbar"
|
||||
|
@ -92,6 +95,7 @@ skip-if = ["os == 'linux'"]
|
|||
["browser_918049_skipintoolbarset_dnd.js"]
|
||||
|
||||
["browser_923857_customize_mode_event_wrapping_during_reset.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt && socketprocess_networking"] # Bug 1961545
|
||||
|
||||
["browser_927717_customize_drag_empty_toolbar.js"]
|
||||
|
||||
|
@ -160,6 +164,7 @@ tags = "overflowable-toolbar"
|
|||
["browser_963639_customizing_attribute_non_customizable_toolbar.js"]
|
||||
|
||||
["browser_968565_insert_before_hidden_items.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt"] # Bug 1961547
|
||||
|
||||
["browser_969427_recreate_destroyed_widget_after_reset.js"]
|
||||
|
||||
|
@ -373,5 +378,9 @@ skip-if = [
|
|||
["browser_vertical_tabs_customize_navbar.js"]
|
||||
|
||||
["browser_widget_animation.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt"] # Bug 1961548
|
||||
|
||||
["browser_widget_recreate_events.js"]
|
||||
skip-if = [
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1961546
|
||||
]
|
||||
|
|
|
@ -2566,6 +2566,21 @@ export var Policies = {
|
|||
},
|
||||
},
|
||||
|
||||
SkipTermsOfUse: {
|
||||
onBeforeAddons(manager, param) {
|
||||
if (param) {
|
||||
setAndLockPref(
|
||||
"datareporting.policy.dataSubmissionPolicyAcceptedVersion",
|
||||
999
|
||||
);
|
||||
setAndLockPref(
|
||||
"datareporting.policy.dataSubmissionPolicyNotifiedTime",
|
||||
Date.now().toString()
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
SSLVersionMax: {
|
||||
onBeforeAddons(manager, param) {
|
||||
let tlsVersion;
|
||||
|
@ -2670,18 +2685,6 @@ export var Policies = {
|
|||
param.Locked
|
||||
);
|
||||
}
|
||||
if (param.SkipTermsOfUse) {
|
||||
PoliciesUtils.setDefaultPref(
|
||||
"datareporting.policy.dataSubmissionPolicyAcceptedVersion",
|
||||
999,
|
||||
param.Locked
|
||||
);
|
||||
PoliciesUtils.setDefaultPref(
|
||||
"datareporting.policy.dataSubmissionPolicyNotifiedTime",
|
||||
Date.now().toString(),
|
||||
param.Locked
|
||||
);
|
||||
}
|
||||
if ("MoreFromMozilla" in param) {
|
||||
PoliciesUtils.setDefaultPref(
|
||||
"browser.preferences.moreFromMozilla",
|
||||
|
|
|
@ -1498,6 +1498,10 @@
|
|||
"type": "boolean"
|
||||
},
|
||||
|
||||
"SkipTermsOfUse": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
||||
"SSLVersionMax": {
|
||||
"type": "string",
|
||||
"enum": ["tls1", "tls1.1", "tls1.2", "tls1.3"]
|
||||
|
@ -1550,9 +1554,6 @@
|
|||
"SkipOnboarding": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"SkipTermsOfUse": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"MoreFromMozilla": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
|
@ -220,12 +220,9 @@ add_task(async function test_initial_bookmarks() {
|
|||
add_task(async function checkFavicon() {
|
||||
let bookmark1url = CURRENT_POLICY.policies.Bookmarks[0].URL;
|
||||
|
||||
let result = await new Promise(resolve => {
|
||||
PlacesUtils.favicons.getFaviconDataForPage(
|
||||
Services.io.newURI(bookmark1url),
|
||||
(uri, _, data) => resolve({ uri, data })
|
||||
);
|
||||
});
|
||||
let result = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI(bookmark1url)
|
||||
);
|
||||
|
||||
is(
|
||||
result.uri.spec,
|
||||
|
@ -235,7 +232,7 @@ add_task(async function checkFavicon() {
|
|||
// data is an array of octets, which will be a bit hard to compare against
|
||||
// FAVICON_DATA, which is base64 encoded. Checking the expected length should
|
||||
// be good indication that this is working properly.
|
||||
is(result.data.length, 464, "Favicon data has the correct length");
|
||||
is(result.rawData.length, 464, "Favicon data has the correct length");
|
||||
|
||||
let faviconsExpiredNotification = TestUtils.topicObserved(
|
||||
"places-favicons-expired"
|
||||
|
@ -247,15 +244,11 @@ add_task(async function checkFavicon() {
|
|||
add_task(async function checkNetworkFavicon() {
|
||||
let bookmarkURL = CURRENT_POLICY.policies.Bookmarks[1].URL;
|
||||
|
||||
let result = await new Promise(resolve => {
|
||||
PlacesUtils.favicons.getFaviconDataForPage(
|
||||
Services.io.newURI(bookmarkURL),
|
||||
(uri, _, data) => resolve({ uri, data })
|
||||
);
|
||||
});
|
||||
let result = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI(bookmarkURL)
|
||||
);
|
||||
|
||||
is(result.uri, null, "Favicon should not be loaded");
|
||||
is(result.data.length, 0, "Favicon data should be empty");
|
||||
is(result, null, "Favicon should not be loaded");
|
||||
});
|
||||
|
||||
add_task(async function test_remove_Bookmark_2() {
|
||||
|
|
|
@ -29,9 +29,7 @@ add_task(async function test_skip_terms_of_use_timestamp_set() {
|
|||
const startTime = Date.now();
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
UserMessaging: {
|
||||
SkipTermsOfUse: true,
|
||||
},
|
||||
SkipTermsOfUse: true,
|
||||
},
|
||||
});
|
||||
const endTime = Date.now();
|
||||
|
|
|
@ -691,34 +691,6 @@ const POLICIES_TESTS = [
|
|||
},
|
||||
},
|
||||
|
||||
{
|
||||
policies: {
|
||||
UserMessaging: {
|
||||
SkipTermsOfUse: false,
|
||||
Locked: false,
|
||||
},
|
||||
},
|
||||
unlockedPrefs: {
|
||||
"datareporting.policy.dataSubmissionPolicyAcceptedVersion": 0,
|
||||
"datareporting.policy.dataSubmissionPolicyNotifiedTime": "0",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
policies: {
|
||||
UserMessaging: {
|
||||
SkipTermsOfUse: true,
|
||||
Locked: true,
|
||||
},
|
||||
},
|
||||
lockedPrefs: {
|
||||
"datareporting.policy.dataSubmissionPolicyAcceptedVersion": 999,
|
||||
// "datareporting.policy.dataSubmissionPolicyNotifiedTime" is a string of
|
||||
// the timestamp at which the policy was set, this is tested in
|
||||
// browser/components/enterprisepolicies/tests/browser/browser_policy_usermessaging.js
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
policies: {
|
||||
UserMessaging: {
|
||||
|
@ -1199,6 +1171,19 @@ const POLICIES_TESTS = [
|
|||
"dom.security.https_only_mode": true,
|
||||
},
|
||||
},
|
||||
|
||||
// POLICY: SkipTermsOfUse
|
||||
{
|
||||
policies: {
|
||||
SkipTermsOfUse: true,
|
||||
},
|
||||
lockedPrefs: {
|
||||
"datareporting.policy.dataSubmissionPolicyAcceptedVersion": 999,
|
||||
// "datareporting.policy.dataSubmissionPolicyNotifiedTime" is a string of
|
||||
// the timestamp at which the policy was set, this is tested in
|
||||
// browser/components/enterprisepolicies/tests/browser/browser_policy_usermessaging.js
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
add_task(async function test_policy_simple_prefs() {
|
||||
|
|
|
@ -114,6 +114,7 @@ https_first_disabled = true
|
|||
["browser_ext_browsingData_history.js"]
|
||||
|
||||
["browser_ext_canOpenModalPicker.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt"] # Bug 1949651
|
||||
|
||||
["browser_ext_chrome_settings_overrides_home.js"]
|
||||
|
||||
|
@ -279,6 +280,7 @@ https_first_disabled = true
|
|||
["browser_ext_menus_refresh.js"]
|
||||
|
||||
["browser_ext_menus_replace_menu.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt"] # Bug 1775561
|
||||
|
||||
["browser_ext_menus_replace_menu_context.js"]
|
||||
https_first_disabled = true
|
||||
|
@ -319,6 +321,7 @@ skip-if = [
|
|||
"os == 'linux' && os_version == '18.04' && !debug && verify",
|
||||
"os == 'mac' && os_version == '10.15' && processor == 'x86_64' && !debug && verify",
|
||||
"os == 'mac' && os_version == '11.20' && arch == 'aarch64' && !debug && verify",
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1775565
|
||||
]
|
||||
|
||||
["browser_ext_optionsPage_activity.js"]
|
||||
|
@ -335,6 +338,7 @@ skip-if = [
|
|||
https_first_disabled = true
|
||||
|
||||
["browser_ext_originControls.js"]
|
||||
# skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt"] # Bug TBD
|
||||
|
||||
["browser_ext_originControls_internals.js"]
|
||||
|
||||
|
|
|
@ -209,9 +209,11 @@ export const LinkPreview = {
|
|||
// language or restricted.
|
||||
if (
|
||||
pageData.article.textContent &&
|
||||
pageData.article.language &&
|
||||
pageData.article.detectedLanguage &&
|
||||
(!lazy.allowedLanguages ||
|
||||
lazy.allowedLanguages.split(",").includes(pageData.article.language))
|
||||
lazy.allowedLanguages
|
||||
.split(",")
|
||||
.includes(pageData.article.detectedLanguage))
|
||||
) {
|
||||
this.generateKeyPoints(ogCard);
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ export class LinkPreviewChild extends JSWindowActorChild {
|
|||
title,
|
||||
byline,
|
||||
content,
|
||||
language,
|
||||
detectedLanguage,
|
||||
length,
|
||||
siteName,
|
||||
excerpt,
|
||||
|
@ -307,7 +307,7 @@ export class LinkPreviewChild extends JSWindowActorChild {
|
|||
title,
|
||||
byline,
|
||||
textContent,
|
||||
language,
|
||||
detectedLanguage,
|
||||
length,
|
||||
siteName,
|
||||
excerpt,
|
||||
|
|
|
@ -51,12 +51,25 @@
|
|||
.ai-content {
|
||||
padding: var(--og-padding);
|
||||
|
||||
> h3 {
|
||||
h3 {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: var(--og-main-font-size);
|
||||
font-weight: var(--font-weight-bold);
|
||||
gap: var(--space-xs);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
img.icon {
|
||||
-moz-context-properties: fill;
|
||||
fill: currentColor;
|
||||
height: var(--icon-size-default);
|
||||
margin-inline-start: var(--space-xlarge);
|
||||
pointer-events: none;
|
||||
width: var(--icon-size-default);
|
||||
}
|
||||
|
||||
|
||||
> ul {
|
||||
font-size: var(--og-main-font-size);
|
||||
line-height: 1.15; /* Design requires 18px line-height */
|
||||
|
@ -72,8 +85,25 @@
|
|||
}
|
||||
}
|
||||
|
||||
.visit-link-container {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: var(--space-xlarge);
|
||||
|
||||
.visit-link {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: var(--space-xs);
|
||||
font-size: var(--og-main-font-size);
|
||||
font-weight: var(--font-weight-bold);
|
||||
}
|
||||
}
|
||||
|
||||
> hr {
|
||||
border-color: var(--border-color-card);
|
||||
margin-top: var(--space-xlarge);
|
||||
margin-bottom: var(--space-xlarge);
|
||||
}
|
||||
|
||||
> p {
|
||||
|
|
|
@ -55,7 +55,9 @@ class LinkPreviewCard extends MozLitElement {
|
|||
handleLink(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const url = event.target.href;
|
||||
const anchor = event.target.closest("a");
|
||||
const url = anchor.href;
|
||||
|
||||
const win = this.ownerGlobal;
|
||||
const params = {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal(
|
||||
|
@ -98,7 +100,8 @@ class LinkPreviewCard extends MozLitElement {
|
|||
render() {
|
||||
const articleData = this.pageData?.article || {};
|
||||
const pageUrl = this.pageData?.url || "about:blank";
|
||||
const siteName = articleData.siteName || "";
|
||||
const siteName =
|
||||
articleData.siteName || this.pageData?.urlComponents?.domain || "";
|
||||
|
||||
const { title, description, imageUrl } = this.pageData.meta;
|
||||
|
||||
|
@ -163,7 +166,15 @@ class LinkPreviewCard extends MozLitElement {
|
|||
${this.generating || this.keyPoints.length
|
||||
? html`
|
||||
<div class="ai-content">
|
||||
<h3>Key points</h3>
|
||||
<h3>
|
||||
Key points
|
||||
<img
|
||||
class="icon"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
role="presentation"
|
||||
src="chrome://global/skin/icons/highlights.svg"
|
||||
/>
|
||||
</h3>
|
||||
<ul class="keypoints-list">
|
||||
${
|
||||
/* All populated content items */
|
||||
|
@ -193,6 +204,22 @@ class LinkPreviewCard extends MozLitElement {
|
|||
: []
|
||||
}
|
||||
</ul>
|
||||
<div class="visit-link-container">
|
||||
<a
|
||||
@click=${this.handleLink}
|
||||
data-source="visit"
|
||||
href=${pageUrl}
|
||||
class="visit-link"
|
||||
>
|
||||
Visit page
|
||||
<img
|
||||
class="icon"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
role="presentation"
|
||||
src="chrome://global/skin/icons/open-in-new.svg"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
${this.progress >= 0
|
||||
? html`
|
||||
<p>
|
||||
|
@ -212,15 +239,6 @@ class LinkPreviewCard extends MozLitElement {
|
|||
Share feedback
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<a
|
||||
@click=${this.handleLink}
|
||||
data-source="visit"
|
||||
href=${pageUrl}
|
||||
>
|
||||
Visit original page
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
`
|
||||
: ""}
|
||||
|
|
|
@ -88,22 +88,6 @@ async function promiseMigration(
|
|||
|
||||
return Promise.all(promises);
|
||||
}
|
||||
/**
|
||||
* Function that returns a favicon url for a given page url
|
||||
*
|
||||
* @param {string} uri
|
||||
* The Bookmark URI
|
||||
* @returns {string} faviconURI
|
||||
* The Favicon URI
|
||||
*/
|
||||
async function getFaviconForPageURI(uri) {
|
||||
let faviconURI = await new Promise(resolve => {
|
||||
PlacesUtils.favicons.getFaviconDataForPage(uri, favURI => {
|
||||
resolve(favURI);
|
||||
});
|
||||
});
|
||||
return faviconURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an array of page URIs and checks that the favicon was imported for each page URI
|
||||
|
@ -112,8 +96,8 @@ async function getFaviconForPageURI(uri) {
|
|||
*/
|
||||
async function assertFavicons(pageURIs) {
|
||||
for (let uri of pageURIs) {
|
||||
let faviconURI = await getFaviconForPageURI(uri);
|
||||
Assert.ok(faviconURI, `Got favicon for ${uri.spec}`);
|
||||
let favicon = await PlacesUtils.favicons.getFaviconForPage(uri);
|
||||
Assert.ok(favicon, `Got favicon for ${favicon.uri.spec}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,17 +112,12 @@ async function assertFavicons(pageURIs) {
|
|||
* Expected mime type of the favicon.
|
||||
*/
|
||||
async function assertFavicon(pageURI, expectedImageData, expectedMimeType) {
|
||||
let result = await new Promise(resolve => {
|
||||
PlacesUtils.favicons.getFaviconDataForPage(
|
||||
Services.io.newURI(pageURI),
|
||||
(faviconURI, dataLen, imageData, mimeType) => {
|
||||
resolve({ faviconURI, dataLen, imageData, mimeType });
|
||||
}
|
||||
);
|
||||
});
|
||||
let result = await PlacesUtils.favicons.getFaviconForPage(
|
||||
Services.io.newURI(pageURI)
|
||||
);
|
||||
Assert.ok(!!result, `Got favicon for ${pageURI}`);
|
||||
Assert.equal(
|
||||
result.imageData.join(","),
|
||||
result.rawData.join(","),
|
||||
expectedImageData.join(","),
|
||||
"Image data is correct"
|
||||
);
|
||||
|
|
|
@ -36,7 +36,6 @@ DIRS += [
|
|||
"contentanalysis",
|
||||
"contextualidentity",
|
||||
"customizableui",
|
||||
"doh",
|
||||
"downloads",
|
||||
"enterprisepolicies",
|
||||
"extensions",
|
||||
|
|
|
@ -89,6 +89,7 @@ support-files = ["bookmarklet_windowOpen_dummy.html"]
|
|||
["browser_bookmarksProperties.js"]
|
||||
|
||||
["browser_bookmarks_change_title.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt"] # Bug 1961550
|
||||
|
||||
["browser_bookmarks_change_url.js"]
|
||||
|
||||
|
|
|
@ -89,17 +89,8 @@ add_task(async function () {
|
|||
Assert.equal(menuItem.title, "Menu Link After");
|
||||
|
||||
// Check no favicon exists for this bookmark
|
||||
await Assert.rejects(
|
||||
waitForResolvedPromise(
|
||||
() => {
|
||||
return PlacesUtils.promiseFaviconData(menuItem.url.href);
|
||||
},
|
||||
"Favicon not found",
|
||||
10
|
||||
),
|
||||
/Favicon\snot\sfound/,
|
||||
"Favicon not found"
|
||||
);
|
||||
let favicon = await PlacesUtils.favicons.getFaviconForPage(menuItem.url.URI);
|
||||
Assert.equal(favicon, null, "Favicon should not be found");
|
||||
|
||||
// Check the custom bookmarks exist on toolbar.
|
||||
let toolbarItem = await PlacesUtils.bookmarks.fetch({
|
||||
|
@ -109,21 +100,12 @@ add_task(async function () {
|
|||
Assert.equal(toolbarItem.title, "Toolbar Link Before");
|
||||
|
||||
// Check the custom favicon exist for this bookmark
|
||||
let faviconItem = await waitForResolvedPromise(
|
||||
() => {
|
||||
return PlacesUtils.promiseFaviconData(toolbarItem.url.href);
|
||||
},
|
||||
"Favicon not found",
|
||||
10
|
||||
);
|
||||
Assert.equal(faviconItem.uri.spec, "https://example.org/favicon.png");
|
||||
Assert.greater(faviconItem.dataLen, 0);
|
||||
Assert.equal(faviconItem.mimeType, "image/png");
|
||||
|
||||
let base64Icon =
|
||||
"data:image/png;base64," +
|
||||
base64EncodeString(String.fromCharCode.apply(String, faviconItem.data));
|
||||
Assert.equal(base64Icon, SMALLPNG_DATA_URI.spec);
|
||||
favicon = await PlacesUtils.favicons.getFaviconForPage(toolbarItem.url.URI);
|
||||
Assert.ok(favicon, "Favicon should be found");
|
||||
Assert.equal(favicon.uri.spec, "https://example.org/favicon.png");
|
||||
Assert.greater(favicon.rawData.length, 0);
|
||||
Assert.equal(favicon.mimeType, "image/png");
|
||||
Assert.equal(favicon.dataURI.spec, SMALLPNG_DATA_URI.spec);
|
||||
|
||||
toolbarItem = await PlacesUtils.bookmarks.fetch({
|
||||
parentGuid: PlacesUtils.bookmarks.toolbarGuid,
|
||||
|
|
|
@ -13,6 +13,7 @@ support-files = [
|
|||
["browser_pocket_panel.js"]
|
||||
skip-if = [
|
||||
"os == 'mac' && os_version == '11.20' && arch == 'aarch64' && opt", # Bug 1781272
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1781272
|
||||
]
|
||||
|
||||
["browser_pocket_panel_closemenu.js"]
|
||||
|
|
|
@ -77,7 +77,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
|||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
DoHConfigController: "resource:///modules/DoHConfig.sys.mjs",
|
||||
DoHConfigController: "resource://gre/modules/DoHConfig.sys.mjs",
|
||||
Sanitizer: "resource:///modules/Sanitizer.sys.mjs",
|
||||
SelectableProfileService:
|
||||
"resource:///modules/profiles/SelectableProfileService.sys.mjs",
|
||||
|
|
|
@ -11,14 +11,17 @@ const { EnterprisePolicyTesting, PoliciesPrefTracker } =
|
|||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
DoHConfigController: "resource:///modules/DoHConfig.sys.mjs",
|
||||
DoHController: "resource:///modules/DoHController.sys.mjs",
|
||||
DoHConfigController: "resource://gre/modules/DoHConfig.sys.mjs",
|
||||
DoHController: "resource://gre/modules/DoHController.sys.mjs",
|
||||
DoHTestUtils: "resource://testing-common/DoHTestUtils.sys.mjs",
|
||||
});
|
||||
|
||||
const { MockRegistrar } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/MockRegistrar.sys.mjs"
|
||||
);
|
||||
const gDNSOverride = Cc[
|
||||
"@mozilla.org/network/native-dns-override;1"
|
||||
].getService(Ci.nsINativeDNSResolverOverride);
|
||||
|
||||
const TRR_MODE_PREF = "network.trr.mode";
|
||||
const TRR_URI_PREF = "network.trr.uri";
|
||||
|
@ -40,9 +43,7 @@ const defaultPrefValues = Object.freeze({
|
|||
// is in progress, before we've actually disabled TRR, and would cause a crash
|
||||
// due to connecting to a non-local IP.
|
||||
// To prevent that we override the IP to a local address.
|
||||
Cc["@mozilla.org/network/native-dns-override;1"]
|
||||
.getService(Ci.nsINativeDNSResolverOverride)
|
||||
.addIPOverride("mozilla.cloudflare-dns.com", "127.0.0.1");
|
||||
gDNSOverride.addIPOverride("mozilla.cloudflare-dns.com", "127.0.0.1");
|
||||
|
||||
async function clearEvents() {
|
||||
Services.telemetry.clearEvents();
|
||||
|
@ -67,6 +68,17 @@ async function getEvent(filter1, filter2) {
|
|||
return event;
|
||||
}
|
||||
|
||||
// Mock parental controls service in order to enable it
|
||||
let parentalControlsService = {
|
||||
parentalControlsEnabled: true,
|
||||
QueryInterface: ChromeUtils.generateQI(["nsIParentalControlsService"]),
|
||||
};
|
||||
let mockParentalControlsServiceCid = undefined;
|
||||
|
||||
async function setMockParentalControlEnabled(aEnabled) {
|
||||
parentalControlsService.parentalControlsEnabled = aEnabled;
|
||||
}
|
||||
|
||||
async function resetPrefs() {
|
||||
await DoHTestUtils.resetRemoteSettingsConfig();
|
||||
await DoHController._uninit();
|
||||
|
@ -86,14 +98,30 @@ Services.prefs.setStringPref("network.trr.confirmationNS", "skip");
|
|||
registerCleanupFunction(async () => {
|
||||
await resetPrefs();
|
||||
Services.prefs.clearUserPref("network.trr.confirmationNS");
|
||||
|
||||
if (mockParentalControlsServiceCid != undefined) {
|
||||
MockRegistrar.unregister(mockParentalControlsServiceCid);
|
||||
mockParentalControlsServiceCid = undefined;
|
||||
Services.dns.reloadParentalControlEnabled();
|
||||
}
|
||||
});
|
||||
|
||||
add_setup(async function setup() {
|
||||
mockParentalControlsServiceCid = MockRegistrar.register(
|
||||
"@mozilla.org/parental-controls-service;1",
|
||||
parentalControlsService
|
||||
);
|
||||
Services.dns.reloadParentalControlEnabled();
|
||||
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["toolkit.telemetry.testing.overrideProductsCheck", true]],
|
||||
});
|
||||
|
||||
await DoHTestUtils.resetRemoteSettingsConfig();
|
||||
|
||||
gDNSOverride.addIPOverride("use-application-dns.net.", "4.1.1.1");
|
||||
|
||||
setMockParentalControlEnabled(false);
|
||||
});
|
||||
|
||||
function waitForPrefObserver(name) {
|
||||
|
@ -110,27 +138,6 @@ function waitForPrefObserver(name) {
|
|||
});
|
||||
}
|
||||
|
||||
// Mock parental controls service in order to enable it
|
||||
let parentalControlsService = {
|
||||
parentalControlsEnabled: true,
|
||||
QueryInterface: ChromeUtils.generateQI(["nsIParentalControlsService"]),
|
||||
};
|
||||
let mockParentalControlsServiceCid = undefined;
|
||||
|
||||
async function setMockParentalControlEnabled(aEnabled) {
|
||||
if (mockParentalControlsServiceCid != undefined) {
|
||||
MockRegistrar.unregister(mockParentalControlsServiceCid);
|
||||
mockParentalControlsServiceCid = undefined;
|
||||
}
|
||||
if (aEnabled) {
|
||||
mockParentalControlsServiceCid = MockRegistrar.register(
|
||||
"@mozilla.org/parental-controls-service;1",
|
||||
parentalControlsService
|
||||
);
|
||||
}
|
||||
Services.dns.reloadParentalControlEnabled();
|
||||
}
|
||||
|
||||
add_task(async function testParentalControls() {
|
||||
async function withConfiguration(configuration, fn) {
|
||||
info("testParentalControls");
|
||||
|
@ -505,6 +512,10 @@ async function testWithProperties(props, startTime) {
|
|||
is(modeValue, props.expectedModeValue, "mode pref has expected value");
|
||||
}
|
||||
|
||||
if (props.hasOwnProperty(ROLLOUT_ENABLED_PREF)) {
|
||||
Services.prefs.clearUserPref(ROLLOUT_ENABLED_PREF);
|
||||
}
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
info(Date.now() - startTime + ": testWithProperties: fin");
|
||||
}
|
||||
|
@ -846,7 +857,8 @@ add_task(async function testRemoteSettingsEnable() {
|
|||
|
||||
let status = doc.getElementById("dohStatus");
|
||||
await TestUtils.waitForCondition(
|
||||
() => document.l10n.getAttributes(status).args.status == "Active"
|
||||
() => document.l10n.getAttributes(status).args.status == "Active",
|
||||
"Waiting for remote settings to be processed"
|
||||
);
|
||||
is(
|
||||
document.l10n.getAttributes(status).args.status,
|
||||
|
@ -863,7 +875,8 @@ add_task(async function testRemoteSettingsEnable() {
|
|||
await TestUtils.waitForCondition(
|
||||
() =>
|
||||
document.l10n.getAttributes(provider).args.name ==
|
||||
DoHConfigController.currentConfig.providerList[0].UIName
|
||||
DoHConfigController.currentConfig.providerList[0].UIName,
|
||||
"waiting for correct UI name"
|
||||
);
|
||||
is(
|
||||
document.l10n.getAttributes(provider).args.name,
|
||||
|
@ -876,14 +889,16 @@ add_task(async function testRemoteSettingsEnable() {
|
|||
let win = doc.ownerGlobal;
|
||||
EventUtils.synthesizeMouseAtCenter(option, {}, win);
|
||||
|
||||
await TestUtils.waitForCondition(() =>
|
||||
Services.prefs.prefHasUserValue("doh-rollout.disable-heuristics")
|
||||
await TestUtils.waitForCondition(
|
||||
() => Services.prefs.prefHasUserValue("doh-rollout.disable-heuristics"),
|
||||
"Waiting for disable-heuristics"
|
||||
);
|
||||
is(provider.hidden, false);
|
||||
await TestUtils.waitForCondition(
|
||||
() =>
|
||||
document.l10n.getAttributes(provider).args.name ==
|
||||
DoHConfigController.currentConfig.providerList[0].UIName
|
||||
DoHConfigController.currentConfig.providerList[0].UIName,
|
||||
"waiting for correct UI name"
|
||||
);
|
||||
is(
|
||||
document.l10n.getAttributes(provider).args.name,
|
||||
|
@ -899,7 +914,10 @@ add_task(async function testRemoteSettingsEnable() {
|
|||
option.scrollIntoView();
|
||||
win = doc.ownerGlobal;
|
||||
EventUtils.synthesizeMouseAtCenter(option, {}, win);
|
||||
await TestUtils.waitForCondition(() => status.innerHTML == "Status: Off");
|
||||
await TestUtils.waitForCondition(
|
||||
() => status.innerHTML == "Status: Off",
|
||||
"Waiting for Status OFF"
|
||||
);
|
||||
is(
|
||||
Services.prefs.getIntPref("network.trr.mode"),
|
||||
Ci.nsIDNSService.MODE_TRROFF
|
||||
|
@ -907,6 +925,16 @@ add_task(async function testRemoteSettingsEnable() {
|
|||
is(provider.hidden, true, "Expecting provider to be hidden when DoH is off");
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
await DoHTestUtils.loadRemoteSettingsConfig({
|
||||
providers: "",
|
||||
rolloutEnabled: false,
|
||||
steeringEnabled: false,
|
||||
steeringProviders: "",
|
||||
autoDefaultEnabled: false,
|
||||
autoDefaultProviders: "",
|
||||
id: "global",
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function testEnterprisePolicy() {
|
||||
|
@ -931,6 +959,8 @@ add_task(async function testEnterprisePolicy() {
|
|||
});
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
// Set an empty policy before stopping the policy tracker
|
||||
await EnterprisePolicyTesting.setupPolicyEngineWithJson({});
|
||||
EnterprisePolicyTesting.resetRunOnceState();
|
||||
PoliciesPrefTracker.stop();
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ head = "../unit/head.js head.js"
|
|||
|
||||
["browser_notify_changes.js"]
|
||||
run-if = ["os != 'linux'"] # Linux clients cannot remote themselves.
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt && !socketprocess_networking"] # Bug 1929273
|
||||
|
||||
["browser_preferences.js"]
|
||||
fail-if = ["a11y_checks"] # Bug 1955503
|
||||
|
@ -42,12 +43,13 @@ fail-if = ["a11y_checks"] # Bug 1955503
|
|||
|
||||
["browser_test_last_tab.js"]
|
||||
skip-if = [
|
||||
"os == 'win' && os_version == '11.26100' && processor == 'x86_64' && asan", # Bug 1950795
|
||||
"os == 'win' && os_version == '11.26100' && debug", # Bug 1950795
|
||||
"os == 'mac' && os_version == '11.20' && arch == 'aarch64' && opt", # Bug 1950795
|
||||
"os == 'mac' && os_version == '10.15' && processor == 'x86_64'", # Bug 1950795
|
||||
"os == 'linux' && os_version == '18.04' && processor == 'x86_64' && socketprocess_networking", # Bug 1950795
|
||||
"os == 'linux' && os_version == '18.04' && processor == 'x86_64' && swgl", # Bug 1950795
|
||||
"os == 'mac' && os_version == '10.15' && processor == 'x86_64'", # Bug 1950795
|
||||
"os == 'mac' && os_version == '11.20' && arch == 'aarch64' && opt", # Bug 1950795
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1950795
|
||||
"os == 'win' && os_version == '11.26100' && debug", # Bug 1950795
|
||||
"os == 'win' && os_version == '11.26100' && processor == 'x86_64' && asan", # Bug 1950795
|
||||
]
|
||||
|
||||
["browser_test_nimbus_feature.js"]
|
||||
|
@ -58,6 +60,7 @@ skip-if = [
|
|||
skip-if = [
|
||||
"os == 'win' && os_version == '11.26100' && opt", # Bug 1948374
|
||||
"os == 'mac' && os_version == '11.20' && arch == 'aarch64' && opt", # Bug 1948374
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1948374
|
||||
"os == 'mac' && os_version == '10.15' && processor == 'x86_64' && opt", # Bug 1948374
|
||||
"os == 'linux' && os_version == '18.04' && processor == 'x86_64' && opt", # Bug 1948374
|
||||
]
|
||||
|
|
|
@ -55,7 +55,7 @@ class BrowserSearchTelemetryHandler {
|
|||
* Determines if we should record a search for this browser instance.
|
||||
* Private Browsing mode is normally skipped.
|
||||
*
|
||||
* @param {browser} browser
|
||||
* @param {XULBrowserElement} browser
|
||||
* The browser where the search was loaded.
|
||||
* @returns {boolean}
|
||||
* True if the search should be recorded, false otherwise.
|
||||
|
@ -127,7 +127,7 @@ class BrowserSearchTelemetryHandler {
|
|||
* Telemetry records only search counts per engine and action origin, but
|
||||
* nothing pertaining to the search contents themselves.
|
||||
*
|
||||
* @param {browser} browser
|
||||
* @param {XULBrowserElement} browser
|
||||
* The browser where the search originated.
|
||||
* @param {nsISearchEngine} engine
|
||||
* The engine handling the search.
|
||||
|
@ -232,11 +232,27 @@ class BrowserSearchTelemetryHandler {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Records visits to a search engine's search form.
|
||||
*
|
||||
* @param {nsISearchEngine} engine
|
||||
* The engine whose search form is being visited.
|
||||
* @param {string} source
|
||||
* Where the search form was opened from.
|
||||
* This can be "urlbar" or "searchbar".
|
||||
*/
|
||||
recordSearchForm(engine, source) {
|
||||
Glean.sap.searchFormCounts.record({
|
||||
source,
|
||||
provider_id: engine.isAppProvided ? engine.id : "other",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* This function handles the "urlbar", "urlbar-oneoff", "searchbar" and
|
||||
* "searchbar-oneoff" sources.
|
||||
*
|
||||
* @param {browser} browser
|
||||
* @param {XULBrowserElement} browser
|
||||
* The browser where the search originated.
|
||||
* @param {nsISearchEngine} engine
|
||||
* The engine handling the search.
|
||||
|
|
|
@ -388,13 +388,6 @@
|
|||
|
||||
this.telemetrySelectedIndex = -1;
|
||||
|
||||
lazy.BrowserSearchTelemetry.recordSearch(
|
||||
gBrowser.selectedBrowser,
|
||||
engine,
|
||||
"searchbar",
|
||||
details
|
||||
);
|
||||
|
||||
// Record when the user uses the search bar
|
||||
Services.prefs.setStringPref(
|
||||
"browser.search.widget.lastUsed",
|
||||
|
@ -413,6 +406,28 @@
|
|||
params[key] = aParams[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (aWhere == "tab") {
|
||||
gBrowser.tabContainer.addEventListener(
|
||||
"TabOpen",
|
||||
event =>
|
||||
lazy.BrowserSearchTelemetry.recordSearch(
|
||||
event.target.linkedBrowser,
|
||||
engine,
|
||||
"searchbar",
|
||||
details
|
||||
),
|
||||
{ once: true }
|
||||
);
|
||||
} else {
|
||||
lazy.BrowserSearchTelemetry.recordSearch(
|
||||
gBrowser.selectedBrowser,
|
||||
engine,
|
||||
"searchbar",
|
||||
details
|
||||
);
|
||||
}
|
||||
|
||||
openTrustedLinkIn(submission.uri.spec, aWhere, params);
|
||||
}
|
||||
|
||||
|
@ -504,6 +519,7 @@
|
|||
this._needBrowserFocusAtEnterKeyUp = true;
|
||||
}
|
||||
|
||||
lazy.BrowserSearchTelemetry.recordSearchForm(engine, "searchbar");
|
||||
openTrustedLinkIn(searchForm, where, params);
|
||||
}
|
||||
|
||||
|
|
|
@ -217,6 +217,34 @@ sap:
|
|||
expires: never
|
||||
telemetry_mirror: h#SEARCH_COUNTS
|
||||
|
||||
search_form_counts:
|
||||
type: event
|
||||
description: >
|
||||
Records how often users visit the homepages of search engines (also
|
||||
known as SearchForm) using a SAP. It only counts how many visits were
|
||||
initiated, not how many homepages were loaded successfully.
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1915252
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1915252
|
||||
data_sensitivity:
|
||||
- interaction
|
||||
notification_emails:
|
||||
- fx-search-telemetry@mozilla.com
|
||||
expires: never
|
||||
extra_keys:
|
||||
source:
|
||||
description: >
|
||||
The search access point from which the user initiated the search.
|
||||
Possible values are `searchbar` and `urlbar`.
|
||||
type: string
|
||||
provider_id:
|
||||
description: >
|
||||
The identifier of the search engine provider that is being used for the
|
||||
search. Note this may be different to the identifier of the provider in
|
||||
SERP reports. For user installed engines, this will be the string `other`.
|
||||
type: string
|
||||
|
||||
serp:
|
||||
impression:
|
||||
type: event
|
||||
|
|
|
@ -184,6 +184,8 @@ support-files = [
|
|||
"telemetrySearchSuggestions.xml",
|
||||
]
|
||||
|
||||
["browser_search_telemetry_searchform.js"]
|
||||
|
||||
["browser_search_telemetry_shopping.js"]
|
||||
support-files = ["searchTelemetryAd_shopping.html"]
|
||||
|
||||
|
|
|
@ -0,0 +1,164 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
https://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const CONFIG = [
|
||||
{
|
||||
identifier: "defaultEngine",
|
||||
},
|
||||
{
|
||||
identifier: "second_engine",
|
||||
base: {
|
||||
name: "Second Engine",
|
||||
urls: {
|
||||
search_form: {
|
||||
base: "https://www.example.com/searchform",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
const TEST_ENGINE_BASENAME = "testEngine.xml";
|
||||
const TEST_ENGINE_NAME = "Foo";
|
||||
|
||||
function findOneOff(engineName) {
|
||||
let oneOffButtons = document.getElementById("PopupSearchAutoComplete")
|
||||
.oneOffButtons.buttons;
|
||||
let oneOffChildren = [...oneOffButtons.children];
|
||||
let oneOffButton = oneOffChildren.find(
|
||||
node => node.engine?.name == engineName
|
||||
);
|
||||
Assert.notEqual(
|
||||
oneOffButton,
|
||||
undefined,
|
||||
`One-off for ${engineName} should exist`
|
||||
);
|
||||
return oneOffButton;
|
||||
}
|
||||
|
||||
async function openSearchbarPopup(searchBarValue) {
|
||||
let searchBar = document.getElementById("searchbar");
|
||||
|
||||
searchBar.focus();
|
||||
searchBar.value = searchBarValue;
|
||||
if (searchBar.textbox.popupOpen) {
|
||||
info("searchPanel is already open");
|
||||
return;
|
||||
}
|
||||
let searchPopup = document.getElementById("PopupSearchAutoComplete");
|
||||
let shownPromise = BrowserTestUtils.waitForEvent(searchPopup, "popupshown");
|
||||
|
||||
let searchIcon = searchBar.querySelector(".searchbar-search-button");
|
||||
let oneOffInstance = searchPopup.oneOffButtons;
|
||||
let builtPromise = BrowserTestUtils.waitForEvent(oneOffInstance, "rebuild");
|
||||
|
||||
info("Opening search panel");
|
||||
EventUtils.synthesizeMouseAtCenter(searchIcon, {});
|
||||
await Promise.all([shownPromise, builtPromise]);
|
||||
}
|
||||
|
||||
add_setup(async function () {
|
||||
await SearchTestUtils.updateRemoteSettingsConfig(CONFIG);
|
||||
await SearchTestUtils.installOpenSearchEngine({
|
||||
url: getRootDirectory(gTestPath) + "../" + TEST_ENGINE_BASENAME,
|
||||
});
|
||||
await gCUITestUtils.addSearchBar();
|
||||
|
||||
registerCleanupFunction(async () => {
|
||||
gCUITestUtils.removeSearchBar();
|
||||
resetTelemetry();
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_appProvidedSearchbar() {
|
||||
await openSearchbarPopup("");
|
||||
let oneOff = findOneOff("Second Engine");
|
||||
EventUtils.synthesizeMouseAtCenter(oneOff, { shiftKey: true });
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let events = Glean.sap.searchFormCounts.testGetValue();
|
||||
Assert.equal(events.length, 1, "Event was recorded.");
|
||||
Assert.equal(events[0].extra.source, "searchbar", "Source is correct");
|
||||
Assert.equal(events[0].extra.provider_id, "second_engine", "Id is correct");
|
||||
resetTelemetry();
|
||||
});
|
||||
|
||||
add_task(async function test_extensionSearchbar() {
|
||||
await openSearchbarPopup("");
|
||||
let oneOff = findOneOff(TEST_ENGINE_NAME);
|
||||
EventUtils.synthesizeMouseAtCenter(oneOff, { shiftKey: true });
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let events = Glean.sap.searchFormCounts.testGetValue();
|
||||
Assert.equal(events.length, 1, "Event was recorded");
|
||||
Assert.equal(events[0].extra.source, "searchbar", "Source is correct");
|
||||
Assert.equal(events[0].extra.provider_id, "other", "Id is correct");
|
||||
resetTelemetry();
|
||||
});
|
||||
|
||||
add_task(async function test_actualSearchSearchbar() {
|
||||
// Enter something in the searchbar to start an actual search.
|
||||
await openSearchbarPopup("foo");
|
||||
let oneOff = findOneOff("Second Engine");
|
||||
EventUtils.synthesizeMouseAtCenter(oneOff, { shiftKey: true });
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let events = Glean.sap.searchFormCounts.testGetValue();
|
||||
// Since we used the one off button to search (not to open the search form),
|
||||
// no event should be recorded in `sap.searchFormCounts`.
|
||||
Assert.equal(events, null, "No search form event is recorded for searches");
|
||||
resetTelemetry();
|
||||
});
|
||||
|
||||
add_task(async function test_appProvidedUrlbar() {
|
||||
let popup = await UrlbarTestUtils.openSearchModeSwitcher(window);
|
||||
info("Choose Second Engine in the unified search button popup.");
|
||||
let item = popup.querySelector('menuitem[label="Second Engine"]');
|
||||
let popupHidden = UrlbarTestUtils.searchModeSwitcherPopupClosed(window);
|
||||
EventUtils.synthesizeMouseAtCenter(item, { shiftKey: true });
|
||||
await popupHidden;
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let events = Glean.sap.searchFormCounts.testGetValue();
|
||||
Assert.equal(events.length, 1, "Event was recorded");
|
||||
Assert.equal(events[0].extra.source, "urlbar", "Source is correct");
|
||||
Assert.equal(events[0].extra.provider_id, "second_engine", "Id is correct");
|
||||
resetTelemetry();
|
||||
});
|
||||
|
||||
add_task(async function test_extensionUrlbar() {
|
||||
let popup = await UrlbarTestUtils.openSearchModeSwitcher(window);
|
||||
info("Choose extension engine in the unified search button popup.");
|
||||
let item = popup.querySelector(`menuitem[label="${TEST_ENGINE_NAME}"]`);
|
||||
let popupHidden = UrlbarTestUtils.searchModeSwitcherPopupClosed(window);
|
||||
EventUtils.synthesizeMouseAtCenter(item, { shiftKey: true });
|
||||
await popupHidden;
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let events = Glean.sap.searchFormCounts.testGetValue();
|
||||
Assert.equal(events.length, 1, "Event was recorded");
|
||||
Assert.equal(events[0].extra.source, "urlbar", "Source is correct");
|
||||
Assert.equal(events[0].extra.provider_id, "other");
|
||||
resetTelemetry();
|
||||
});
|
||||
|
||||
add_task(async function test_actualSearchUrlbar() {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: "foo",
|
||||
});
|
||||
let popup = await UrlbarTestUtils.openSearchModeSwitcher(window);
|
||||
info("Shift-click Second Engine in the unified search button popup.");
|
||||
let item = popup.querySelector('menuitem[label="Second Engine"]');
|
||||
let popupHidden = UrlbarTestUtils.searchModeSwitcherPopupClosed(window);
|
||||
EventUtils.synthesizeMouseAtCenter(item, { shiftKey: true });
|
||||
await popupHidden;
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let events = Glean.sap.searchFormCounts.testGetValue();
|
||||
// Since we used the unified search button to search (not to open the search
|
||||
// form), no event should be recorded in `sap.searchFormCounts`.
|
||||
Assert.equal(events, null, "No search form event was recorded");
|
||||
resetTelemetry();
|
||||
});
|
|
@ -37,7 +37,7 @@ const TEST_PROVIDER_INFO = [
|
|||
/**
|
||||
* Returns the index of the first search suggestion in the urlbar results.
|
||||
*
|
||||
* @returns {number} An index, or -1 if there are no search suggestions.
|
||||
* @returns {Promise<number>} An index, or -1 if there are no search suggestions.
|
||||
*/
|
||||
async function getFirstSuggestionIndex() {
|
||||
const matchCount = UrlbarTestUtils.getResultCount(window);
|
||||
|
@ -80,6 +80,7 @@ add_setup(async function () {
|
|||
suggest_url:
|
||||
"https://example.org/browser/browser/components/search/test/browser/searchSuggestionEngine.sjs",
|
||||
suggest_url_get_params: "query={searchTerms}",
|
||||
name: "Example",
|
||||
},
|
||||
{ setAsDefault: true }
|
||||
);
|
||||
|
@ -203,6 +204,77 @@ add_task(async function test_source_urlbar() {
|
|||
);
|
||||
});
|
||||
|
||||
add_task(async function test_source_urlbar_newtab() {
|
||||
let tab;
|
||||
await track_ad_click(
|
||||
"urlbar",
|
||||
"urlbar",
|
||||
async () => {
|
||||
// Load a page because alt doesn't open new tabs on about:newtab.
|
||||
BrowserTestUtils.startLoadingURIString(
|
||||
gBrowser.selectedBrowser,
|
||||
"https://example.com"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: "searchSuggestion",
|
||||
});
|
||||
let idx = await getFirstSuggestionIndex();
|
||||
Assert.greaterOrEqual(idx, 0, "there should be a first suggestion");
|
||||
while (idx--) {
|
||||
EventUtils.sendKey("down");
|
||||
}
|
||||
|
||||
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
|
||||
EventUtils.synthesizeKey("VK_RETURN", { altKey: true });
|
||||
tab = await newTabPromise;
|
||||
return tab;
|
||||
},
|
||||
async () => {
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_source_urlbar_oneoffs_newtab() {
|
||||
// Enable legacy one off buttons.
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.urlbar.scotchBonnet.enableOverride", false]],
|
||||
});
|
||||
let tab;
|
||||
await track_ad_click(
|
||||
"urlbar",
|
||||
"urlbar",
|
||||
async () => {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: "searchSuggestion",
|
||||
});
|
||||
|
||||
let oneOffs =
|
||||
UrlbarTestUtils.getOneOffSearchButtons(window).getSelectableButtons(
|
||||
true
|
||||
);
|
||||
|
||||
let engines = await Services.search.getEngines();
|
||||
let index = engines.findIndex(e => e.name == "Example");
|
||||
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
|
||||
EventUtils.synthesizeMouseAtCenter(oneOffs[index], {
|
||||
accelKey: true,
|
||||
shiftKey: true,
|
||||
});
|
||||
tab = await newTabPromise;
|
||||
return tab;
|
||||
},
|
||||
async () => {
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
);
|
||||
await SpecialPowers.popPrefEnv();
|
||||
});
|
||||
|
||||
add_task(async function test_source_urlbar_handoff() {
|
||||
let tab;
|
||||
await track_ad_click(
|
||||
|
@ -324,6 +396,38 @@ add_task(async function test_source_searchbar() {
|
|||
);
|
||||
});
|
||||
|
||||
add_task(async function test_source_searchbar_newtab() {
|
||||
let tab;
|
||||
await track_ad_click(
|
||||
"searchbar",
|
||||
"searchbar",
|
||||
async () => {
|
||||
let sb = document.getElementById("searchbar");
|
||||
// Write the search query in the searchbar.
|
||||
sb.focus();
|
||||
sb.value = "searchSuggestion";
|
||||
sb.textbox.controller.startSearch("searchSuggestion");
|
||||
// Wait for the popup to show.
|
||||
await BrowserTestUtils.waitForEvent(sb.textbox.popup, "popupshown");
|
||||
// And then for the search to complete.
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() =>
|
||||
sb.textbox.controller.searchStatus >=
|
||||
Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH,
|
||||
"The search in the searchbar must complete."
|
||||
);
|
||||
|
||||
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
|
||||
EventUtils.synthesizeKey("VK_RETURN", { altKey: true });
|
||||
tab = await newTabPromise;
|
||||
return tab;
|
||||
},
|
||||
async () => {
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_source_system() {
|
||||
let tab;
|
||||
await track_ad_click(
|
||||
|
|
|
@ -247,8 +247,8 @@ skip-if = ["true"] # Bug 1646894
|
|||
["browser_restoreLastClosedTabOrWindowOrSession.js"]
|
||||
skip-if = [
|
||||
"os == 'mac' && os_version == '10.15' && processor == 'x86_64' && opt", # Bug 1838996
|
||||
"os == 'mac' && os_version == '10.15' && processor == 'x86_64' && asan", # Bug 1838996
|
||||
"os == 'mac' && os_version == '11.20' && arch == 'aarch64' && opt", # Bug 1838996
|
||||
"os == 'mac' && os_version == '15.30' && arch == 'aarch64' && opt", # Bug 1838996
|
||||
]
|
||||
|
||||
["browser_restoreTabContainer.js"]
|
||||
|
|
|
@ -204,6 +204,7 @@ https_first_disabled = true
|
|||
["browser_590268.js"]
|
||||
|
||||
["browser_590563.js"]
|
||||
skip-if = ["os == 'mac' && os_version == '15.30' && arch == 'aarch64'"]
|
||||
|
||||
["browser_595601-restore_hidden.js"]
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "nsGNOMEShellSearchProvider.h"
|
||||
|
||||
#include "nsToolkitCompsCID.h"
|
||||
#include "nsIFaviconService.h"
|
||||
#include "base/message_loop.h" // for MessageLoop
|
||||
#include "base/task.h" // for NewRunnableMethod, etc
|
||||
#include "mozilla/gfx/2D.h"
|
||||
|
@ -24,6 +23,7 @@
|
|||
#include "nsIOpenTabsProvider.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "imgITools.h"
|
||||
#include "mozilla/places/nsFaviconService.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
|
@ -62,27 +62,6 @@ static const char* introspect_template =
|
|||
"</interface>\n"
|
||||
"</node>\n";
|
||||
|
||||
class AsyncFaviconDataReady final : public nsIFaviconDataCallback {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIFAVICONDATACALLBACK
|
||||
|
||||
AsyncFaviconDataReady(RefPtr<nsGNOMEShellHistorySearchResult> aSearchResult,
|
||||
int aIconIndex, int aTimeStamp)
|
||||
: mSearchResult(std::move(aSearchResult)),
|
||||
mIconIndex(aIconIndex),
|
||||
mTimeStamp(aTimeStamp) {}
|
||||
|
||||
private:
|
||||
~AsyncFaviconDataReady() {}
|
||||
|
||||
RefPtr<nsGNOMEShellHistorySearchResult> mSearchResult;
|
||||
int mIconIndex;
|
||||
int mTimeStamp;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(AsyncFaviconDataReady, nsIFaviconDataCallback)
|
||||
|
||||
// Inspired by SurfaceToPackedBGRA
|
||||
static UniquePtr<uint8_t[]> SurfaceToPackedRGBA(DataSourceSurface* aSurface) {
|
||||
IntSize size = aSurface->GetSize();
|
||||
|
@ -116,22 +95,35 @@ static UniquePtr<uint8_t[]> SurfaceToPackedRGBA(DataSourceSurface* aSurface) {
|
|||
return imageBuffer;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AsyncFaviconDataReady::OnComplete(nsIURI* aFaviconURI, uint32_t aDataLen,
|
||||
const uint8_t* aData,
|
||||
const nsACString& aMimeType,
|
||||
uint16_t aWidth) {
|
||||
static nsresult UpdateHistoryIcon(
|
||||
const places::FaviconPromise::ResolveOrRejectValue& aPromiseResult,
|
||||
const RefPtr<nsGNOMEShellHistorySearchResult>& aSearchResult,
|
||||
int aIconIndex, int aTimeStamp) {
|
||||
// This is a callback from some previous search so we don't want it
|
||||
if (mTimeStamp != mSearchResult->GetTimeStamp() || !aData || !aDataLen) {
|
||||
if (aTimeStamp != aSearchResult->GetTimeStamp()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFavicon> favicon =
|
||||
aPromiseResult.IsResolve() ? aPromiseResult.ResolveValue() : nullptr;
|
||||
if (!favicon) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Get favicon content.
|
||||
nsTArray<uint8_t> rawData;
|
||||
nsresult rv = favicon->GetRawData(rawData);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsAutoCString mimeType;
|
||||
rv = favicon->GetMimeType(mimeType);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Decode the image from the format it was returned to us in (probably PNG)
|
||||
nsCOMPtr<imgIContainer> container;
|
||||
nsCOMPtr<imgITools> imgtool = do_CreateInstance("@mozilla.org/image/tools;1");
|
||||
nsresult rv = imgtool->DecodeImageFromBuffer(
|
||||
reinterpret_cast<const char*>(aData), aDataLen, aMimeType,
|
||||
getter_AddRefs(container));
|
||||
rv = imgtool->DecodeImageFromBuffer(
|
||||
reinterpret_cast<const char*>(rawData.Elements()), rawData.Length(),
|
||||
mimeType, getter_AddRefs(container));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
RefPtr<SourceSurface> surface = container->GetFrame(
|
||||
|
@ -149,9 +141,9 @@ AsyncFaviconDataReady::OnComplete(nsIURI* aFaviconURI, uint32_t aDataLen,
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
mSearchResult->SetHistoryIcon(mTimeStamp, std::move(data),
|
||||
aSearchResult->SetHistoryIcon(aTimeStamp, std::move(data),
|
||||
surface->GetSize().width,
|
||||
surface->GetSize().height, mIconIndex);
|
||||
surface->GetSize().height, aIconIndex);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -432,8 +424,7 @@ void nsGNOMEShellHistorySearchResult::HandleSearchResultReply() {
|
|||
nsresult rv = mHistResultContainer->GetChildCount(&childCount);
|
||||
if (NS_SUCCEEDED(rv) && childCount > 0) {
|
||||
// Obtain the favicon service and get the favicon for the specified page
|
||||
nsCOMPtr<nsIFaviconService> favIconSvc(
|
||||
do_GetService("@mozilla.org/browser/favicon-service;1"));
|
||||
auto* favIconSvc = nsFaviconService::GetFaviconService();
|
||||
nsCOMPtr<nsIIOService> ios(do_GetService(NS_IOSERVICE_CONTRACTID));
|
||||
|
||||
if (childCount > MAX_SEARCH_RESULTS_NUM) {
|
||||
|
@ -453,11 +444,15 @@ void nsGNOMEShellHistorySearchResult::HandleSearchResultReply() {
|
|||
nsAutoCString uri;
|
||||
child->GetUri(uri);
|
||||
|
||||
RefPtr<nsGNOMEShellHistorySearchResult> self = this;
|
||||
nsCOMPtr<nsIURI> iconIri;
|
||||
ios->NewURI(uri, nullptr, nullptr, getter_AddRefs(iconIri));
|
||||
nsCOMPtr<nsIFaviconDataCallback> callback =
|
||||
new AsyncFaviconDataReady(this, i, mTimeStamp);
|
||||
favIconSvc->GetFaviconDataForPage(iconIri, callback, 0);
|
||||
favIconSvc->AsyncGetFaviconForPage(iconIri)->Then(
|
||||
GetMainThreadSerialEventTarget(), __func__,
|
||||
[self, iconIndex = i, timeStamp = mTimeStamp](
|
||||
const places::FaviconPromise::ResolveOrRejectValue& aResult) {
|
||||
UpdateHistoryIcon(aResult, self, iconIndex, timeStamp);
|
||||
});
|
||||
|
||||
bool isOpen = false;
|
||||
for (const auto& openuri : mOpenTabs) {
|
||||
|
|
|
@ -1081,13 +1081,12 @@ var SidebarController = {
|
|||
|
||||
let fromRects = this._getRects(animatingElements);
|
||||
|
||||
// We need to wait for rAF for lit to re-render, and us to get the final
|
||||
// width. This is a bit unfortunate but alas...
|
||||
let toRects = await new Promise(resolve => {
|
||||
requestAnimationFrame(() => {
|
||||
resolve(this._getRects(animatingElements));
|
||||
});
|
||||
// We need to wait for lit to re-render, and us to get the final width.
|
||||
// This is a bit unfortunate but alas...
|
||||
await new Promise(resolve => {
|
||||
queueMicrotask(() => resolve(this.sidebarMain.updateComplete));
|
||||
});
|
||||
let toRects = this._getRects(animatingElements);
|
||||
|
||||
const options = {
|
||||
duration: document.documentElement.hasAttribute("sidebar-expand-on-hover")
|
||||
|
|
|
@ -256,7 +256,8 @@ add_task(async function test_contextual_manager_toggle() {
|
|||
await testSidebarToggle("viewCPMSidebar", gleanEvent);
|
||||
await testCustomizeToggle(
|
||||
"viewCPMSidebar",
|
||||
Glean.contextualManager.passwordsEnabled
|
||||
Glean.contextualManager.passwordsEnabled,
|
||||
false // Remove this in bug 1957425
|
||||
);
|
||||
await SpecialPowers.popPrefEnv();
|
||||
await SidebarController.waitUntilStable();
|
||||
|
|
|
@ -1199,18 +1199,16 @@ export class FaviconProvider {
|
|||
* @param {nsIURI} uri
|
||||
* Page to check for favicon data
|
||||
* @returns {object}
|
||||
* A promise of an object (possibly null) containing the data
|
||||
* Favicon info object. If there is no data in DB, return null.
|
||||
*/
|
||||
getFaviconInfo(uri) {
|
||||
return new Promise(resolve =>
|
||||
lazy.PlacesUtils.favicons.getFaviconDataForPage(
|
||||
uri,
|
||||
// Package up the icon data in an object if we have it; otherwise null
|
||||
(iconUri, faviconLength, favicon, mimeType, faviconSize) =>
|
||||
resolve(iconUri ? { iconUri, faviconSize } : null),
|
||||
lazy.NewTabUtils.activityStreamProvider.THUMB_FAVICON_SIZE
|
||||
)
|
||||
async getFaviconInfo(uri) {
|
||||
let favicon = await lazy.PlacesUtils.favicons.getFaviconForPage(
|
||||
uri,
|
||||
lazy.NewTabUtils.activityStreamProvider.THUMB_FAVICON_SIZE
|
||||
);
|
||||
return favicon
|
||||
? { iconUri: favicon.uri, faviconSize: favicon.width }
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,9 +110,9 @@ add_task(async function test_fetchIcon_with_valid_favicon() {
|
|||
await feed.fetchIcon(TEST_PAGE_URL.spec);
|
||||
|
||||
info("Check the database");
|
||||
const result = await PlacesUtils.promiseFaviconData(TEST_PAGE_URL);
|
||||
const result = await PlacesUtils.favicons.getFaviconForPage(TEST_PAGE_URL);
|
||||
Assert.equal(result.mimeType, "image/svg+xml");
|
||||
Assert.equal(result.size, 65535);
|
||||
Assert.equal(result.width, 65535);
|
||||
|
||||
info("Clean up");
|
||||
await PlacesTestUtils.clearFavicons();
|
||||
|
@ -141,14 +141,13 @@ add_task(async function test_fetchIcon_with_invalid_favicon() {
|
|||
await feed.fetchIcon(TEST_PAGE_URL.spec);
|
||||
|
||||
info("Check the database");
|
||||
const result = await PlacesUtils.promiseFaviconData(TEST_PAGE_URL);
|
||||
const result = await PlacesUtils.favicons.getFaviconForPage(TEST_PAGE_URL);
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
const expectedFaviconData = readFileData(TEST_FAVICON_FILE);
|
||||
Assert.equal(result.uri.spec, `${TEST_FAVICON_URL.spec}#tippytop`);
|
||||
Assert.equal(result.dataLen, expectedFaviconData.length);
|
||||
Assert.deepEqual(result.data, expectedFaviconData);
|
||||
Assert.deepEqual(result.rawData, expectedFaviconData);
|
||||
Assert.equal(result.mimeType, "image/png");
|
||||
Assert.equal(result.size, 16);
|
||||
Assert.equal(result.width, 16);
|
||||
|
||||
info("Clean up");
|
||||
await PlacesTestUtils.clearFavicons();
|
||||
|
@ -186,15 +185,16 @@ add_task(async function test_fetchIconFromRedirects_with_valid_favicon() {
|
|||
|
||||
info("Check the database");
|
||||
await TestUtils.waitForCondition(async () => {
|
||||
const result = await PlacesUtils.promiseFaviconData(destination);
|
||||
const result = await PlacesUtils.favicons.getFaviconForPage(destination);
|
||||
return !!result;
|
||||
});
|
||||
const sourceResult = await PlacesUtils.promiseFaviconData(TEST_PAGE_URL);
|
||||
const destinationResult = await PlacesUtils.promiseFaviconData(destination);
|
||||
Assert.equal(destinationResult.dataLen, sourceResult.dataLen);
|
||||
Assert.deepEqual(destinationResult.data, sourceResult.data);
|
||||
const sourceResult =
|
||||
await PlacesUtils.favicons.getFaviconForPage(TEST_PAGE_URL);
|
||||
const destinationResult =
|
||||
await PlacesUtils.favicons.getFaviconForPage(destination);
|
||||
Assert.deepEqual(destinationResult.rawData, sourceResult.rawData);
|
||||
Assert.equal(destinationResult.mimeType, sourceResult.mimeType);
|
||||
Assert.equal(destinationResult.size, sourceResult.size);
|
||||
Assert.equal(destinationResult.width, sourceResult.width);
|
||||
|
||||
info("Clean up");
|
||||
await PlacesTestUtils.clearFavicons();
|
||||
|
@ -264,9 +264,7 @@ add_task(async function test_fetchIcon_withNetworkFetch() {
|
|||
|
||||
// Set up mocks
|
||||
PlacesUtils.favicons = {
|
||||
getFaviconDataForPage: sandbox
|
||||
.stub()
|
||||
.callsArgWith(1, null, 0, null, null, 0),
|
||||
getFaviconForPage: sandbox.stub().returns(Promise.resolve(null)),
|
||||
setFaviconForPage: sandbox.spy(),
|
||||
copyFavicons: sandbox.spy(),
|
||||
};
|
||||
|
@ -298,9 +296,10 @@ add_task(async function test_fetchIcon_withInvalidDataInDb() {
|
|||
const sandbox = sinon.createSandbox();
|
||||
// Set up mocks
|
||||
PlacesUtils.favicons = {
|
||||
getFaviconDataForPage: sandbox
|
||||
// Invalid since no width.
|
||||
getFaviconForPage: sandbox
|
||||
.stub()
|
||||
.callsArgWith(1, { spec: FAKE_SMALLPNG_DATA_URI }, 0, null, null, 0),
|
||||
.returns(Promise.resolve({ iconUri: { spec: FAKE_SMALLPNG_DATA_URI } })),
|
||||
setFaviconForPage: sandbox.spy(),
|
||||
copyFavicons: sandbox.spy(),
|
||||
};
|
||||
|
@ -335,16 +334,12 @@ add_task(async function test_fetchIcon_withValidDataInDb() {
|
|||
const sandbox = sinon.createSandbox();
|
||||
// Set up mocks
|
||||
PlacesUtils.favicons = {
|
||||
getFaviconDataForPage: sandbox
|
||||
.stub()
|
||||
.callsArgWith(
|
||||
1,
|
||||
{ spec: FAKE_SMALLPNG_DATA_URI },
|
||||
100,
|
||||
["dummy icon data"],
|
||||
"image/png",
|
||||
16
|
||||
),
|
||||
getFaviconForPage: sandbox.stub().returns(
|
||||
Promise.resolve({
|
||||
iconUri: { spec: FAKE_SMALLPNG_DATA_URI },
|
||||
width: 100,
|
||||
})
|
||||
),
|
||||
setFaviconForPage: sandbox.spy(),
|
||||
copyFavicons: sandbox.spy(),
|
||||
};
|
||||
|
@ -370,9 +365,7 @@ add_task(async function test_fetchIcon_withNoTippyTopData() {
|
|||
let feed = new FaviconProvider();
|
||||
// Set up mocks
|
||||
PlacesUtils.favicons = {
|
||||
getFaviconDataForPage: sandbox
|
||||
.stub()
|
||||
.callsArgWith(1, null, 0, null, null, 0),
|
||||
getFaviconForPage: sandbox.stub().returns(Promise.resolve(null)),
|
||||
setFaviconForPage: sandbox.spy(),
|
||||
copyFavicons: sandbox.spy(),
|
||||
};
|
||||
|
|
|
@ -315,10 +315,22 @@ export class MerinoClient {
|
|||
this.#timeoutTimer = null;
|
||||
}
|
||||
|
||||
if (!response?.ok) {
|
||||
// `recordResponse()` was already called above, no need to call it here.
|
||||
return [];
|
||||
}
|
||||
|
||||
if (response.status == 204) {
|
||||
// No content. We check for this because `response.json()` (below) throws
|
||||
// in this case, and since we log the error it can spam the console.
|
||||
recordResponse?.("no_suggestion");
|
||||
return [];
|
||||
}
|
||||
|
||||
// Get the response body as an object.
|
||||
let body;
|
||||
try {
|
||||
body = await response?.json();
|
||||
body = await response.json();
|
||||
} catch (error) {
|
||||
this.logger.error("Error getting response as JSON", error);
|
||||
}
|
||||
|
|
|
@ -720,14 +720,14 @@ export class UrlbarInput {
|
|||
* Where we expect the result to be opened.
|
||||
* @property {object} openParams
|
||||
* The parameters related to where the result will be opened.
|
||||
* @property {Node} engine
|
||||
* @property {nsISearchEngine} engine
|
||||
* The selected one-off's engine.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles an event which would cause a URL or text to be opened.
|
||||
*
|
||||
* @param {object} [options]
|
||||
* @param {object} options
|
||||
* Options for the navigation.
|
||||
* @param {Event} [options.event]
|
||||
* The event triggering the open.
|
||||
|
@ -819,7 +819,21 @@ export class UrlbarInput {
|
|||
oneOffParams.engine,
|
||||
searchString
|
||||
);
|
||||
this._recordSearch(oneOffParams.engine, event);
|
||||
if (oneOffParams.openWhere == "tab") {
|
||||
this.window.gBrowser.tabContainer.addEventListener(
|
||||
"TabOpen",
|
||||
tabEvent =>
|
||||
this._recordSearch(
|
||||
oneOffParams.engine,
|
||||
event,
|
||||
{},
|
||||
tabEvent.target.linkedBrowser
|
||||
),
|
||||
{ once: true }
|
||||
);
|
||||
} else {
|
||||
this._recordSearch(oneOffParams.engine, event);
|
||||
}
|
||||
|
||||
lazy.UrlbarUtils.addToFormHistory(
|
||||
this,
|
||||
|
@ -1288,7 +1302,24 @@ export class UrlbarInput {
|
|||
alias: result.payload.keyword,
|
||||
};
|
||||
const engine = Services.search.getEngineByName(result.payload.engine);
|
||||
this._recordSearch(engine, event, actionDetails);
|
||||
|
||||
if (where == "tab") {
|
||||
// The TabOpen event is fired synchronously so tabEvent.target
|
||||
// is guaranteed to be our new search tab.
|
||||
this.window.gBrowser.tabContainer.addEventListener(
|
||||
"TabOpen",
|
||||
tabEvent =>
|
||||
this._recordSearch(
|
||||
engine,
|
||||
event,
|
||||
actionDetails,
|
||||
tabEvent.target.linkedBrowser
|
||||
),
|
||||
{ once: true }
|
||||
);
|
||||
} else {
|
||||
this._recordSearch(engine, event, actionDetails);
|
||||
}
|
||||
|
||||
if (!result.payload.inPrivateWindow) {
|
||||
lazy.UrlbarUtils.addToFormHistory(
|
||||
|
@ -1836,8 +1867,10 @@ export class UrlbarInput {
|
|||
null,
|
||||
"search-mode-switcher"
|
||||
).uri.spec;
|
||||
// TODO: record SAP telemetry, see Bug 1961789.
|
||||
} else {
|
||||
url = searchEngine.searchForm;
|
||||
lazy.BrowserSearchTelemetry.recordSearchForm(searchEngine, "urlbar");
|
||||
}
|
||||
|
||||
this._lastSearchString = "";
|
||||
|
@ -2953,18 +2986,26 @@ export class UrlbarInput {
|
|||
* The engine to generate the query for.
|
||||
* @param {Event} event
|
||||
* The event that triggered this query.
|
||||
* @param {object} searchActionDetails
|
||||
* @param {object} [searchActionDetails]
|
||||
* The details associated with this search query.
|
||||
* @param {boolean} searchActionDetails.isSuggestion
|
||||
* @param {boolean} [searchActionDetails.isSuggestion]
|
||||
* True if this query was initiated from a suggestion from the search engine.
|
||||
* @param {boolean} searchActionDetails.alias
|
||||
* @param {boolean} [searchActionDetails.alias]
|
||||
* True if this query was initiated via a search alias.
|
||||
* @param {boolean} searchActionDetails.isFormHistory
|
||||
* @param {boolean} [searchActionDetails.isFormHistory]
|
||||
* True if this query was initiated from a form history result.
|
||||
* @param {string} searchActionDetails.url
|
||||
* @param {string} [searchActionDetails.url]
|
||||
* The url this query was triggered with.
|
||||
* @param {XULBrowserElement} [browser]
|
||||
* The browser where the search is being opened.
|
||||
* Defaults to the window's selected browser.
|
||||
*/
|
||||
_recordSearch(engine, event, searchActionDetails = {}) {
|
||||
_recordSearch(
|
||||
engine,
|
||||
event,
|
||||
searchActionDetails = {},
|
||||
browser = this.window.gBrowser.selectedBrowser
|
||||
) {
|
||||
const isOneOff = this.view.oneOffSearchButtons.eventTargetIsAOneOff(event);
|
||||
const searchSource = this.getSearchSource(event);
|
||||
|
||||
|
@ -2984,7 +3025,7 @@ export class UrlbarInput {
|
|||
|
||||
// Sending a trigger to ASRouter when a search happens
|
||||
lazy.ASRouter.sendTriggerMessage({
|
||||
browser: this.window.gBrowser.selectedBrowser,
|
||||
browser,
|
||||
id: "onSearch",
|
||||
context: {
|
||||
isSuggestion: searchActionDetails.isSuggestion || false,
|
||||
|
@ -2993,16 +3034,11 @@ export class UrlbarInput {
|
|||
},
|
||||
});
|
||||
|
||||
lazy.BrowserSearchTelemetry.recordSearch(
|
||||
this.window.gBrowser.selectedBrowser,
|
||||
engine,
|
||||
searchSource,
|
||||
{
|
||||
...searchActionDetails,
|
||||
isOneOff,
|
||||
newtabSessionId: this._handoffSession,
|
||||
}
|
||||
);
|
||||
lazy.BrowserSearchTelemetry.recordSearch(browser, engine, searchSource, {
|
||||
...searchActionDetails,
|
||||
isOneOff,
|
||||
newtabSessionId: this._handoffSession,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,16 +23,14 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
UrlbarResult: "resource:///modules/UrlbarResult.sys.mjs",
|
||||
});
|
||||
|
||||
// Constants to support an alternative frecency algorithm.
|
||||
const PAGES_USE_ALT_FRECENCY = Services.prefs.getBoolPref(
|
||||
"places.frecency.pages.alternative.featureGate",
|
||||
false
|
||||
);
|
||||
const PAGES_FRECENCY_FIELD = PAGES_USE_ALT_FRECENCY
|
||||
? "alt_frecency"
|
||||
: "frecency";
|
||||
|
||||
const SQL_ADAPTIVE_QUERY = `/* do not warn (bug 487789) */
|
||||
ChromeUtils.defineLazyGetter(lazy, "SQL_ADAPTIVE_QUERY", () => {
|
||||
// Constants to support an alternative frecency algorithm.
|
||||
const PAGES_USE_ALT_FRECENCY =
|
||||
lazy.PlacesUtils.history.isAlternativeFrecencyEnabled;
|
||||
const PAGES_FRECENCY_FIELD = PAGES_USE_ALT_FRECENCY
|
||||
? "alt_frecency"
|
||||
: "frecency";
|
||||
return `/* do not warn (bug 487789) */
|
||||
SELECT h.url,
|
||||
h.title,
|
||||
EXISTS(SELECT 1 FROM moz_bookmarks WHERE fk = h.id) AS bookmarked,
|
||||
|
@ -66,6 +64,7 @@ const SQL_ADAPTIVE_QUERY = `/* do not warn (bug 487789) */
|
|||
NULL)
|
||||
ORDER BY rank DESC, ${PAGES_FRECENCY_FIELD} DESC
|
||||
LIMIT :maxResults`;
|
||||
});
|
||||
|
||||
/**
|
||||
* Class used to create the provider.
|
||||
|
@ -245,7 +244,7 @@ class ProviderInputHistory extends UrlbarProvider {
|
|||
*/
|
||||
_getAdaptiveQuery(queryContext) {
|
||||
return [
|
||||
SQL_ADAPTIVE_QUERY,
|
||||
lazy.SQL_ADAPTIVE_QUERY,
|
||||
{
|
||||
parent: lazy.PlacesUtils.tagsFolderId,
|
||||
search_string: queryContext.lowerCaseSearchString,
|
||||
|
|
|
@ -36,15 +36,6 @@ const QUERYINDEX_FRECENCY = 10;
|
|||
const QUERYINDEX_USERCONTEXTID = 11;
|
||||
const QUERYINDEX_LASTVIST = 12;
|
||||
|
||||
// Constants to support an alternative frecency algorithm.
|
||||
const PAGES_USE_ALT_FRECENCY = Services.prefs.getBoolPref(
|
||||
"places.frecency.pages.alternative.featureGate",
|
||||
false
|
||||
);
|
||||
const PAGES_FRECENCY_FIELD = PAGES_USE_ALT_FRECENCY
|
||||
? "alt_frecency"
|
||||
: "frecency";
|
||||
|
||||
// This SQL query fragment provides the following:
|
||||
// - whether the entry is bookmarked (QUERYINDEX_BOOKMARKED)
|
||||
// - the bookmark title, if it is a bookmark (QUERYINDEX_BOOKMARKTITLE)
|
||||
|
@ -65,14 +56,14 @@ const SQL_BOOKMARK_TAGS_FRAGMENT = `EXISTS(SELECT 1 FROM moz_bookmarks WHERE fk
|
|||
// condition once, and avoid evaluating "btitle" and "tags" when it is false.
|
||||
function defaultQuery(conditions = "") {
|
||||
let query = `SELECT :query_type, h.url, h.title, ${SQL_BOOKMARK_TAGS_FRAGMENT},
|
||||
h.visit_count, h.typed, h.id, t.open_count, ${PAGES_FRECENCY_FIELD}, t.userContextId, h.last_visit_date
|
||||
h.visit_count, h.typed, h.id, t.open_count, ${lazy.PAGES_FRECENCY_FIELD}, t.userContextId, h.last_visit_date
|
||||
FROM moz_places h
|
||||
LEFT JOIN moz_openpages_temp t
|
||||
ON t.url = h.url
|
||||
AND (t.userContextId = :userContextId OR (t.userContextId <> -1 AND :userContextId IS NULL))
|
||||
WHERE (
|
||||
(:switchTabsEnabled AND t.open_count > 0) OR
|
||||
${PAGES_FRECENCY_FIELD} <> 0
|
||||
${lazy.PAGES_FRECENCY_FIELD} <> 0
|
||||
)
|
||||
AND CASE WHEN bookmarked
|
||||
THEN
|
||||
|
@ -89,7 +80,7 @@ function defaultQuery(conditions = "") {
|
|||
:matchBehavior, :searchBehavior, NULL)
|
||||
END
|
||||
${conditions ? "AND" : ""} ${conditions}
|
||||
ORDER BY ${PAGES_FRECENCY_FIELD} DESC, h.id DESC
|
||||
ORDER BY ${lazy.PAGES_FRECENCY_FIELD} DESC, h.id DESC
|
||||
LIMIT :maxResults`;
|
||||
return query;
|
||||
}
|
||||
|
@ -128,6 +119,13 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.sys.mjs",
|
||||
});
|
||||
|
||||
// Constants to support an alternative frecency algorithm.
|
||||
ChromeUtils.defineLazyGetter(lazy, "PAGES_FRECENCY_FIELD", () => {
|
||||
return lazy.PlacesUtils.history.isAlternativeFrecencyEnabled
|
||||
? "alt_frecency"
|
||||
: "frecency";
|
||||
});
|
||||
|
||||
function setTimeout(callback, ms) {
|
||||
let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
timer.initWithCallback(callback, ms, timer.TYPE_ONE_SHOT);
|
||||
|
|
|
@ -251,6 +251,20 @@ async function doFetchAndGetCalls(client, fetchArgs) {
|
|||
return callsByProvider;
|
||||
}
|
||||
|
||||
// Checks a 204 "No content" response.
|
||||
add_task(async function noContent() {
|
||||
MerinoTestUtils.server.response = { status: 204 };
|
||||
await fetchAndCheckSuggestions({ expected: [] });
|
||||
|
||||
Assert.equal(
|
||||
gClient.lastFetchStatus,
|
||||
"no_suggestion",
|
||||
"The request should have been recorded as no_suggestion"
|
||||
);
|
||||
|
||||
MerinoTestUtils.server.reset();
|
||||
});
|
||||
|
||||
// Checks a response that's valid but also has some unexpected properties.
|
||||
add_task(async function unexpectedResponseProperties() {
|
||||
MerinoTestUtils.server.response.body.unexpectedString = "some value";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
|
||||
|
||||
# Add-on signing is not required for DevEdition
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
ac_add_options --enable-debug-symbols=-gline-tables-only
|
||||
|
||||
# Add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
# ASan specific options on Linux
|
||||
ac_add_options --enable-valgrind
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. $topsrcdir/browser/config/mozconfigs/linux64/nightly
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/unofficial
|
||||
ac_add_options --enable-update-channel=default
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
export MOZ_AUTOMATION_CHECK=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_CHECK=0
|
||||
|
||||
. "$topsrcdir/build/unix/mozconfig.unix"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
. "$topsrcdir/build/mozconfig.common"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/linux64/common-opt"
|
||||
|
||||
# Add-on signing is not required for DevEdition
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ac_add_options --enable-debug-symbols=-gline-tables-only
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
# ASan specific options on Linux
|
||||
ac_add_options --enable-valgrind
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ac_add_options --disable-optimize
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
# ASan specific options on Linux
|
||||
ac_add_options --enable-valgrind
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
ac_add_options --enable-debug-symbols=-gline-tables-only
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
# ASan specific options on Linux
|
||||
ac_add_options --enable-valgrind
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
. $topsrcdir/browser/config/mozconfigs/linux64/nightly
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_CHECK=0
|
||||
MOZ_AUTOMATION_CHECK=0
|
||||
|
||||
. $topsrcdir/browser/config/mozconfigs/linux64/nightly
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. $topsrcdir/browser/config/mozconfigs/macosx64-aarch64/nightly
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/unofficial
|
||||
ac_add_options --enable-update-channel=default
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
# Developers often build with these options for a better debugging experience.
|
||||
. "$topsrcdir/browser/config/mozconfigs/macosx64/debug"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/macosx64-aarch64/common-opt"
|
||||
|
||||
# Add-on signing is not required for DevEdition
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --enable-instruments
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. $topsrcdir/browser/config/mozconfigs/macosx64/nightly
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/unofficial
|
||||
ac_add_options --enable-update-channel=default
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
# Developers often build with these options for a better debugging experience.
|
||||
. "$topsrcdir/browser/config/mozconfigs/macosx64/debug"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
export MOZ_AUTOMATION_CHECK=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_CHECK=0
|
||||
|
||||
. $topsrcdir/build/macosx/mozconfig.common
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
. $topsrcdir/build/macosx/mozconfig.common
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/macosx64/common-opt"
|
||||
|
||||
# Add-on signing is not required for DevEdition
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --enable-instruments
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
. $topsrcdir/browser/config/mozconfigs/macosx64/nightly
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
. $topsrcdir/build/macosx/mozconfig.common
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. $topsrcdir/browser/config/mozconfigs/win32/nightly
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/unofficial
|
||||
ac_add_options --enable-update-channel=default
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
. "$topsrcdir/build/mozconfig.win-common"
|
||||
. "$topsrcdir/browser/config/mozconfigs/common"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/win32/common-opt"
|
||||
|
||||
# Add-on signing is not required for DevEdition
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
|
|
|
@ -36,15 +36,15 @@ ac_add_options --disable-default-browser-agent # Relies on toast notifications w
|
|||
ac_add_options --disable-notification-server # Toast notifications don't build on mingw.
|
||||
|
||||
# Find our toolchain
|
||||
export HOST_CC="$MOZ_FETCHES_DIR/clang/bin/clang"
|
||||
export HOST_CXX="$MOZ_FETCHES_DIR/clang/bin/clang++"
|
||||
export CC="$MOZ_FETCHES_DIR/clang/bin/i686-w64-mingw32-clang"
|
||||
export CXX="$MOZ_FETCHES_DIR/clang/bin/i686-w64-mingw32-clang++"
|
||||
export CXXFLAGS="-fms-extensions"
|
||||
export CFLAGS="$CFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
|
||||
export CXXFLAGS="$CXXFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
|
||||
export CFLAGS="$CFLAGS -include _mingw.h"
|
||||
export CXXFLAGS="$CXXFLAGS -include _mingw.h"
|
||||
HOST_CC="$MOZ_FETCHES_DIR/clang/bin/clang"
|
||||
HOST_CXX="$MOZ_FETCHES_DIR/clang/bin/clang++"
|
||||
CC="$MOZ_FETCHES_DIR/clang/bin/i686-w64-mingw32-clang"
|
||||
CXX="$MOZ_FETCHES_DIR/clang/bin/i686-w64-mingw32-clang++"
|
||||
CXXFLAGS="-fms-extensions"
|
||||
CFLAGS="$CFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
|
||||
CXXFLAGS="$CXXFLAGS -fcrash-diagnostics-dir=${UPLOAD_PATH}"
|
||||
CFLAGS="$CFLAGS -include _mingw.h"
|
||||
CXXFLAGS="$CXXFLAGS -include _mingw.h"
|
||||
|
||||
# We want to make sure we use binutils and other binaries in the tooltool
|
||||
# package.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
|
||||
# Developers often build with these options for a better debugging experience.
|
||||
. "$topsrcdir/browser/config/mozconfigs/win32/debug"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
. "$topsrcdir/browser/config/mozconfigs/win64-aarch64/common-opt"
|
||||
|
||||
# Add-on signing is not required for DevEdition
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
. $topsrcdir/browser/config/mozconfigs/win64/nightly
|
||||
|
||||
#add-on signing is checked but not enforced
|
||||
unset MOZ_REQUIRE_SIGNING
|
||||
MOZ_REQUIRE_SIGNING=
|
||||
|
||||
ac_add_options --with-branding=browser/branding/unofficial
|
||||
ac_add_options --enable-update-channel=default
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
export MOZ_AUTOMATION_CHECK=0
|
||||
MOZ_AUTOMATION_BUILD_SYMBOLS=0
|
||||
MOZ_AUTOMATION_CHECK=0
|
||||
|
||||
. "$topsrcdir/build/mozconfig.win-common"
|
||||
. "$topsrcdir/browser/config/mozconfigs/common"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue