Skip to content

Commit

Permalink
Adding CLEAR_MESSAGING_LAYER_SECURITY_STATE method
Browse files Browse the repository at this point in the history
  • Loading branch information
david-dick committed Dec 26, 2024
1 parent 10f00c7 commit e28f24f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/Firefox/Marionette/Cache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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 }
Expand Down Expand Up @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -181,6 +185,10 @@ returns the value of CLEAR_DOM_PUSH_NOTIFICATIONS, which is 1 << 9 = 512
returns the value of CLEAR_HISTORY, which is 1 << 10 = 1024 (Places history)
=head2 CLEAR_MESSAGING_LAYER_SECURITY_STATE
returns the value of CLEAR_MESSAGING_LAYER_SECURITY_STATE, which is 1 << 11 = 2048
=head2 CLEAR_AUTH_TOKENS
returns the value of CLEAR_AUTH_TOKENS, which is 1 << 12 = 4096
Expand Down Expand Up @@ -279,11 +287,11 @@ returns the value of CLEAR_DOM_STORAGES, which is (L<CLEAR_DOM_QUOTA|/CLEAR_DOM_
=head2 CLEAR_FORGET_ABOUT_SITE
returns the value of CLEAR_FORGET_ABOUT_SITE, which is (L<CLEAR_HISTORY|/CLEAR_HISTORY> | L<CLEAR_ALL_CACHES|/CLEAR_ALL_CACHES> | L<CLEAR_COOKIES|/CLEAR_COOKIES> | L<CLEAR_EME|/CLEAR_EME> | L<CLEAR_DOWNLOADS|/CLEAR_DOWNLOADS> | L<CLEAR_PERMISSIONS|/CLEAR_PERMISSIONS> | L<CLEAR_DOM_STORAGES|/CLEAR_DOM_STORAGES> | L<CLEAR_CONTENT_PREFERENCES|/CLEAR_CONTENT_PREFERENCES> | L<CLEAR_PREDICTOR_NETWORK_DATA|/CLEAR_PREDICTOR_NETWORK_DATA> | L<CLEAR_DOM_PUSH_NOTIFICATIONS|/CLEAR_DOM_PUSH_NOTIFICATIONS> | L<CLEAR_CLIENT_AUTH_REMEMBER_SERVICE|/CLEAR_CLIENT_AUTH_REMEMBER_SERVICE> | L<CLEAR_REPORTS|/CLEAR_REPORTS> | L<CLEAR_CERT_EXCEPTIONS|/CLEAR_CERT_EXCEPTIONS> | L<CLEAR_CREDENTIAL_MANAGER_STATE|/CLEAR_CREDENTIAL_MANAGER_STATE> | L<CLEAR_COOKIE_BANNER_EXECUTED_RECORD|/CLEAR_COOKIE_BANNER_EXECUTED_RECORD> | L<CLEAR_FINGERPRINTING_PROTECTION_STATE|/CLEAR_FINGERPRINTING_PROTECTION_STATE>)
returns the value of CLEAR_FORGET_ABOUT_SITE, which is (L<CLEAR_HISTORY|/CLEAR_HISTORY> | L<CLEAR_ALL_CACHES|/CLEAR_ALL_CACHES> | L<CLEAR_COOKIES|/CLEAR_COOKIES> | L<CLEAR_EME|/CLEAR_EME> | L<CLEAR_DOWNLOADS|/CLEAR_DOWNLOADS> | L<CLEAR_PERMISSIONS|/CLEAR_PERMISSIONS> | L<CLEAR_DOM_STORAGES|/CLEAR_DOM_STORAGES> | L<CLEAR_CONTENT_PREFERENCES|/CLEAR_CONTENT_PREFERENCES> | L<CLEAR_PREDICTOR_NETWORK_DATA|/CLEAR_PREDICTOR_NETWORK_DATA> | L<CLEAR_DOM_PUSH_NOTIFICATIONS|/CLEAR_DOM_PUSH_NOTIFICATIONS> | L<CLEAR_CLIENT_AUTH_REMEMBER_SERVICE|/CLEAR_CLIENT_AUTH_REMEMBER_SERVICE> | L<CLEAR_REPORTS|/CLEAR_REPORTS> | L<CLEAR_CERT_EXCEPTIONS|/CLEAR_CERT_EXCEPTIONS> | L<CLEAR_CREDENTIAL_MANAGER_STATE|/CLEAR_CREDENTIAL_MANAGER_STATE> | L<CLEAR_COOKIE_BANNER_EXECUTED_RECORD|/CLEAR_COOKIE_BANNER_EXECUTED_RECORD> | L<CLEAR_FINGERPRINTING_PROTECTION_STATE|/CLEAR_FINGERPRINTING_PROTECTION_STATE> | L<CLEAR_MESSAGING_LAYER_SECURITY_STATE|/CLEAR_MESSAGING_LAYER_SECURITY_STATE>)
=head2 CLEAR_COOKIES_AND_SITE_DATA
returns the value of CLEAR_COOKIES_AND_SITE_DATA, which is (L<CLEAR_COOKIES|/CLEAR_COOKIES> | L<CLEAR_COOKIE_BANNER_EXECUTED_RECORD|/CLEAR_COOKIE_BANNER_EXECUTED_RECORD> | L<CLEAR_DOM_STORAGES|/CLEAR_DOM_STORAGES> | L<CLEAR_HSTS|/CLEAR_HSTS> | L<CLEAR_EME|/CLEAR_EME> | L<CLEAR_AUTH_TOKENS|/CLEAR_AUTH_TOKENS> | L<CLEAR_AUTH_CACHE|/CLEAR_AUTH_CACHE> | L<CLEAR_FINGERPRINTING_PROTECTION_STATE|/CLEAR_FINGERPRINTING_PROTECTION_STATE> | L<CLEAR_BOUNCE_TRACKING_PROTECTION_STATE|/CLEAR_BOUNCE_TRACKING_PROTECTION_STATE> | L<CLEAR_STORAGE_PERMISSIONS|/CLEAR_STORAGE_PERMISSIONS>)
returns the value of CLEAR_COOKIES_AND_SITE_DATA, which is (L<CLEAR_COOKIES|/CLEAR_COOKIES> | L<CLEAR_COOKIE_BANNER_EXECUTED_RECORD|/CLEAR_COOKIE_BANNER_EXECUTED_RECORD> | L<CLEAR_DOM_STORAGES|/CLEAR_DOM_STORAGES> | L<CLEAR_HSTS|/CLEAR_HSTS> | L<CLEAR_EME|/CLEAR_EME> | L<CLEAR_AUTH_TOKENS|/CLEAR_AUTH_TOKENS> | L<CLEAR_AUTH_CACHE|/CLEAR_AUTH_CACHE> | L<CLEAR_FINGERPRINTING_PROTECTION_STATE|/CLEAR_FINGERPRINTING_PROTECTION_STATE> | L<CLEAR_BOUNCE_TRACKING_PROTECTION_STATE|/CLEAR_BOUNCE_TRACKING_PROTECTION_STATE> | L<CLEAR_STORAGE_PERMISSIONS|/CLEAR_STORAGE_PERMISSIONS> | L<CLEAR_MESSAGING_LAYER_SECURITY_STATE|/CLEAR_MESSAGING_LAYER_SECURITY_STATE>)
=head1 SUBROUTINES/METHODS
Expand Down
1 change: 1 addition & 0 deletions t/01-marionette.t
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit e28f24f

Please sign in to comment.