diff options
author | Peter Zhang <peter@innocraft.com> | 2022-02-14 10:06:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 10:06:37 +0300 |
commit | 48020c27e137c7e9ce9db6c20794cdfd2ddefa8b (patch) | |
tree | 208c4f86d92cb8cfdeeada52808b5443b6a44d01 /tests | |
parent | f6b343d980128f51a736755751249470fc7b9db5 (diff) |
add enable browser detection and some tests (#18633)
* add enableBrowserFeatureDetection and simple tests
add enableBrowserFeatureDetection and simple tests
* Update AnonymousPiwikUsageMeasurement
update tests
* rebuilt piwik.js
* Revert "Update AnonymousPiwikUsageMeasurement"
This reverts commit 21de4c77ba8032c085ed9f4b1924bac4eee228f0.
* Update index.php
add tests
* Update index.php
* Update index.php
update wrong function
* Update index.php
update tests
* Update index.php
update tests
* Update .eslintignore
disable jslint for complie js
* update jsLint error
update jsLint error
* remove space
remove space
* Update index.php
update wording
Co-authored-by: peterhashair <peterhashair@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/javascript/index.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php index 38c023f336..0d77932c0f 100644 --- a/tests/javascript/index.php +++ b/tests/javascript/index.php @@ -5220,6 +5220,24 @@ if ($mysql) { ok( diffTime >= 2000, 'setLinkTrackingTimer(): ' + diffTime); }); + test("Browser detector feature Disable and enable", function() { + var pattern = /(res=)|(cookie=)/; + var tracker = Piwik.getTracker(); + var siteIdPattern = /idsite/; + + tracker.enableBrowserFeatureDetection(); + var requestWithFingerprint = tracker.getRequest('hello=world'); + + equal(siteIdPattern.test(requestWithFingerprint), true); + equal(pattern.test(requestWithFingerprint), true, 'When browser fingerprint is enabled the request should include browser resolution or cookie'); + + tracker.disableBrowserFeatureDetection(); + var requestWithoutFingerprint = tracker.getRequest('hello=world'); + + equal(siteIdPattern.test(requestWithoutFingerprint), true); + equal(pattern.test(requestWithoutFingerprint), false, 'When browser fingerprint is disabled the request should not include browser resolution or cookie'); + }); + <?php } ?> |