[tbb-commits] [tor-browser/tor-browser-52.0.2esr-7.0-2] Bug 1352305 - Part2: Add a test case for making sure dialog windows will not be enforced to rounded sizes when fingerprinting resistance is enabled. r?ehsan

gk at torproject.org gk at torproject.org
Wed Apr 12 08:15:31 UTC 2017


commit e761b3ca2087275c165fb67b7f876a55286d47dd
Author: Tim Huang <tihuang at mozilla.com>
Date:   Fri Mar 31 00:11:41 2017 -0800

    Bug 1352305 - Part2: Add a test case for making sure dialog windows will not be enforced to rounded sizes when fingerprinting resistance is enabled. r?ehsan
    
    A browser chrome test which ensures the dialog windows will not be enforced to
    be rounded sizes when fingerprinting resistance is enabled.
    
    MozReview-Commit-ID: LQG13FMANav
---
 .../resistfingerprinting/test/browser/browser.ini  |  1 +
 .../browser/browser_roundedWindow_dialogWindow.js  | 30 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/browser/components/resistfingerprinting/test/browser/browser.ini b/browser/components/resistfingerprinting/test/browser/browser.ini
index 713f3d2..4b81c91 100644
--- a/browser/components/resistfingerprinting/test/browser/browser.ini
+++ b/browser/components/resistfingerprinting/test/browser/browser.ini
@@ -4,6 +4,7 @@ support-files =
   file_dummy.html
   head.js
 
+[browser_roundedWindow_dialogWindow.js]
 [browser_roundedWindow_newWindow.js]
 [browser_roundedWindow_open_max.js]
 [browser_roundedWindow_open_mid.js]
diff --git a/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js b/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js
new file mode 100644
index 0000000..839388e
--- /dev/null
+++ b/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js
@@ -0,0 +1,30 @@
+/**
+ * Bug 1352305 - A test case for dialog windows that it should not be rounded
+ *   even after fingerprinting resistance is enabled.
+ */
+
+add_task(async function setup() {
+  await SpecialPowers.pushPrefEnv({"set":
+    [["privacy.resistFingerprinting", true]]
+  });
+});
+
+add_task(async function test_dialog_window() {
+
+  let diagWin;
+
+  await new Promise(resolve => {
+    // Open a dialog window which is not rounded size.
+    diagWin = window.openDialog("about:blank", null,
+                                "innerWidth=250,innerHeight=350");
+
+    diagWin.addEventListener("load", function() {
+      resolve();
+    }, {once: true});
+  });
+
+  is(diagWin.innerWidth, 250, "The dialog window doesn't have a rounded size.");
+  is(diagWin.innerHeight, 350, "The dialog window doesn't have a rounded size.");
+
+  await BrowserTestUtils.closeWindow(diagWin);
+});



More information about the tbb-commits mailing list