diff --git a/shared-storage/interest-groups.tentative.https.sub.html b/shared-storage/interest-groups.tentative.https.sub.html new file mode 100644 index 00000000000000..2889500be232ee --- /dev/null +++ b/shared-storage/interest-groups.tentative.https.sub.html @@ -0,0 +1,41 @@ + + + + + + + + + + diff --git a/shared-storage/resources/simple-module.js b/shared-storage/resources/simple-module.js index 11b650811dcc9c..2c241476421926 100644 --- a/shared-storage/resources/simple-module.js +++ b/shared-storage/resources/simple-module.js @@ -50,8 +50,35 @@ class VerifyKeyNotFound { } } +class VerifyInterestGroups { + async run(urls, data) { + if (data && + data.hasOwnProperty('expectedOwner') && + data.hasOwnProperty('expectedName')) { + + const groups = await interestGroups(); + + if (groups.length !== 1) { + return -1; + } + + if (groups[0]["owner"] !== data['expectedOwner']) { + return -1; + } + + if (groups[0]["name"] !== data['expectedName']) { + return -1; + } + + return 1; + } + return -1; + } +} + register('test-url-selection-operation', TestURLSelectionOperation); register('increment-global-variable-and-return-original-value-operation', IncrementGlobalVariableAndReturnOriginalValueOperation); register('verify-key-value', VerifyKeyValue); register('verify-key-not-found', VerifyKeyNotFound); +register('verify-interest-groups', VerifyInterestGroups);