Skip to content

Commit 0c9fecc

Browse files
tomrittervgjgraham
authored andcommitted
Bug 1990514: Disable bFPP for a few tests r?jgraham
This is needed because there is a heuristic that detects if a window is maximized, and the fingerprinting protections break that heuristic when we lie about the user's available screen resolution. Differential Revision: https://phabricator.services.mozilla.com/D277062
1 parent 3fa4dd6 commit 0c9fecc

File tree

4 files changed

+128
-0
lines changed

4 files changed

+128
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import sys
2+
3+
import pytest
4+
from tests.support.helpers import deep_update
5+
6+
7+
@pytest.fixture
8+
def default_capabilities(request):
9+
"""Firefox/Linux workaround to disable baseline FPP for fullscreen tests.
10+
11+
This is a hack for Firefox on Linux only. The maximize detection heuristic
12+
compares window.outerWidth/Height to screen.availWidth/Height. With Firefox's
13+
baseline fingerprinting protection (bFPP) enabled in Nightly,
14+
screen.availWidth/Height are spoofed while window dimensions are not,
15+
causing the heuristic to fail.
16+
See https://bugzilla.mozilla.org/show_bug.cgi?id=1990514 for details.
17+
"""
18+
capabilities = request.getfixturevalue("default_capabilities")
19+
20+
if sys.platform.startswith("linux"):
21+
deep_update(
22+
capabilities,
23+
{
24+
"moz:firefoxOptions": {
25+
"prefs": {
26+
"privacy.baselineFingerprintingProtection": False
27+
}
28+
}
29+
}
30+
)
31+
32+
return capabilities
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import sys
2+
3+
import pytest
4+
from tests.support.helpers import deep_update
5+
6+
7+
@pytest.fixture
8+
def default_capabilities(request):
9+
"""Firefox/Linux workaround to disable baseline FPP for maximize tests.
10+
11+
This is a hack for Firefox on Linux only. The maximize detection heuristic
12+
compares window.outerWidth/Height to screen.availWidth/Height. With Firefox's
13+
baseline fingerprinting protection (bFPP) enabled in Nightly,
14+
screen.availWidth/Height are spoofed while window dimensions are not,
15+
causing the heuristic to fail.
16+
See https://bugzilla.mozilla.org/show_bug.cgi?id=1990514 for details.
17+
"""
18+
capabilities = request.getfixturevalue("default_capabilities")
19+
20+
if sys.platform.startswith("linux"):
21+
deep_update(
22+
capabilities,
23+
{
24+
"moz:firefoxOptions": {
25+
"prefs": {
26+
"privacy.baselineFingerprintingProtection": False
27+
}
28+
}
29+
}
30+
)
31+
32+
return capabilities
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import sys
2+
3+
import pytest
4+
from tests.support.helpers import deep_update
5+
6+
7+
@pytest.fixture
8+
def default_capabilities(request):
9+
"""Firefox/Linux workaround to disable baseline FPP for minimize tests.
10+
11+
This is a hack for Firefox on Linux only. The maximize detection heuristic
12+
compares window.outerWidth/Height to screen.availWidth/Height. With Firefox's
13+
baseline fingerprinting protection (bFPP) enabled in Nightly,
14+
screen.availWidth/Height are spoofed while window dimensions are not,
15+
causing the heuristic to fail.
16+
See https://bugzilla.mozilla.org/show_bug.cgi?id=1990514 for details.
17+
"""
18+
capabilities = request.getfixturevalue("default_capabilities")
19+
20+
if sys.platform.startswith("linux"):
21+
deep_update(
22+
capabilities,
23+
{
24+
"moz:firefoxOptions": {
25+
"prefs": {
26+
"privacy.baselineFingerprintingProtection": False
27+
}
28+
}
29+
}
30+
)
31+
32+
return capabilities
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import sys
2+
3+
import pytest
4+
from tests.support.helpers import deep_update
5+
6+
7+
@pytest.fixture
8+
def default_capabilities(request):
9+
"""Firefox workaround to disable baseline FPP for set_window_rect tests.
10+
11+
This is a hack for Firefox on Linux and Mac. The maximize detection heuristic
12+
compares window.outerWidth/Height to screen.availWidth/Height. With Firefox's
13+
baseline fingerprinting protection (bFPP) enabled in Nightly,
14+
screen.availWidth/Height are spoofed while window dimensions are not,
15+
causing the heuristic to fail.
16+
See https://bugzilla.mozilla.org/show_bug.cgi?id=1990514 for details.
17+
"""
18+
capabilities = request.getfixturevalue("default_capabilities")
19+
20+
if sys.platform.startswith("linux") or sys.platform == "darwin":
21+
deep_update(
22+
capabilities,
23+
{
24+
"moz:firefoxOptions": {
25+
"prefs": {
26+
"privacy.baselineFingerprintingProtection": False
27+
}
28+
}
29+
}
30+
)
31+
32+
return capabilities

0 commit comments

Comments
 (0)