From 26def1236a777c06b049a15a785be0f86966200a Mon Sep 17 00:00:00 2001 From: David Dick Date: Thu, 26 Dec 2024 19:16:48 +1100 Subject: [PATCH] Adding CLEAR_MESSAGING_LAYER_SECURITY_STATE method --- lib/Firefox/Marionette/Cache.pm | 12 ++++++++---- t/01-marionette.t | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/Firefox/Marionette/Cache.pm b/lib/Firefox/Marionette/Cache.pm index 501fd14..415260c 100644 --- a/lib/Firefox/Marionette/Cache.pm +++ b/lib/Firefox/Marionette/Cache.pm @@ -33,6 +33,7 @@ our @EXPORT_OK = qw( CLEAR_COOKIE_BANNER_EXECUTED_RECORD CLEAR_FINGERPRINTING_PROTECTION_STATE CLEAR_BOUNCE_TRACKING_PROTECTION_STATE + CLEAR_MESSAGING_LAYER_SECURITY_STATE CLEAR_STORAGE_PERMISSIONS CLEAR_SHUTDOWN_EXCEPTIONS CLEAR_ALL @@ -56,6 +57,7 @@ sub CLEAR_DOM_QUOTA { return 128 } sub CLEAR_PREDICTOR_NETWORK_DATA { return 256 } sub CLEAR_DOM_PUSH_NOTIFICATIONS { return 512 } sub CLEAR_HISTORY { return 1024 } +sub CLEAR_MESSAGING_LAYER_SECURITY_STATE { return 2048 } sub CLEAR_AUTH_TOKENS { return 4096 } sub CLEAR_AUTH_CACHE { return 8192 } sub CLEAR_SITE_PERMISSIONS { return 16_384 } @@ -95,7 +97,8 @@ sub CLEAR_COOKIES_AND_SITE_DATA { return CLEAR_COOKIES() | CLEAR_COOKIE_BANNER_EXECUTED_RECORD() | CLEAR_DOM_STORAGES() | CLEAR_HSTS() | CLEAR_EME() | CLEAR_AUTH_TOKENS() | CLEAR_AUTH_CACHE() | CLEAR_FINGERPRINTING_PROTECTION_STATE() | - CLEAR_BOUNCE_TRACKING_PROTECTION_STATE() | CLEAR_STORAGE_PERMISSIONS(); + CLEAR_BOUNCE_TRACKING_PROTECTION_STATE() | CLEAR_STORAGE_PERMISSIONS() | + CLEAR_MESSAGING_LAYER_SECURITY_STATE(); } sub CLEAR_FORGET_ABOUT_SITE { @@ -107,7 +110,8 @@ sub CLEAR_FORGET_ABOUT_SITE { CLEAR_CERT_EXCEPTIONS() | CLEAR_CREDENTIAL_MANAGER_STATE() | CLEAR_COOKIE_BANNER_EXCEPTION() | CLEAR_COOKIE_BANNER_EXECUTED_RECORD() | CLEAR_FINGERPRINTING_PROTECTION_STATE() | - CLEAR_BOUNCE_TRACKING_PROTECTION_STATE(); + CLEAR_BOUNCE_TRACKING_PROTECTION_STATE() | + CLEAR_MESSAGING_LAYER_SECURITY_STATE(); } 1; # Magic true value required at end of module @@ -279,11 +283,11 @@ returns the value of CLEAR_DOM_STORAGES, which is (L | L | L | L | L | L | L | L | L | L | L | L | L | L | L | L) +returns the value of CLEAR_FORGET_ABOUT_SITE, which is (L | L | L | L | L | L | L | L | L | L | L | L | L | L | L | L | L) =head2 CLEAR_COOKIES_AND_SITE_DATA -returns the value of CLEAR_COOKIES_AND_SITE_DATA, which is (L | L | L | L | L | L | L | L | L | L) +returns the value of CLEAR_COOKIES_AND_SITE_DATA, which is (L | L | L | L | L | L | L | L | L | L | L) =head1 SUBROUTINES/METHODS diff --git a/t/01-marionette.t b/t/01-marionette.t index ff82a5f..f124add 100755 --- a/t/01-marionette.t +++ b/t/01-marionette.t @@ -1954,6 +1954,7 @@ SKIP: { local $TODO = $TODO || ($major_version < 129 && $name =~ /^(?:CLEAR_PERMISSIONS|CLEAR_FORGET_ABOUT_SITE)$/) ? "Old firefox (less than 129) can have different values for Firefox::Marionette::Cache constants" : q[]; local $TODO = $TODO || ($major_version < 130 && $name =~ /^(?:CLEAR_ALL_CACHES|CLEAR_FORGET_ABOUT_SITE)$/) ? "Old firefox (less than 130) can have different values for Firefox::Marionette::Cache constants" : q[]; local $TODO = $TODO || ($major_version < 132 && $name =~ /^(?:CLEAR_SESSION_HISTORY|CLEAR_FORGET_ABOUT_SITE)$/) ? "Old firefox (less than 132) can have different values for Firefox::Marionette::Cache constants" : q[]; + local $TODO = $TODO || ($major_version < 135 && $name =~ /^(?:CLEAR_COOKIES_AND_SITE_DATA|CLEAR_FORGET_ABOUT_SITE)$/) ? "Old firefox (less than 135) can have different values for Firefox::Marionette::Cache constants" : q[]; my $result = $firefox->check_cache_key($name); ok($result == &$name(), "\$firefox->check_cache_key($name) eq Firefox::Marionette::Cache::${name} which should be $result and is " . &$name()); }