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
authorTim Huang <tihuang@mozilla.com>
Tue, 02 May 2017 18:11:51 +0800
changeset 356041 8c277e5c00213e8015cd81d879f600f469e1b47d
parent 356040 c8ccbff7c112f380c3702b3a86e2feae60d98675
child 356042 83fe6517d5bed5ee65f76618decb29389bfe383c
push id41899
push userryanvm@gmail.com
push dateTue, 02 May 2017 17:14:24 +0000
treeherderautoland@8c277e5c0021 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1352305
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
browser/components/resistfingerprinting/test/browser/browser.ini
browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js
--- a/browser/components/resistfingerprinting/test/browser/browser.ini
+++ b/browser/components/resistfingerprinting/test/browser/browser.ini
@@ -1,13 +1,14 @@
 [DEFAULT]
 tags = resistfingerprinting
 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]
 [browser_roundedWindow_open_min.js]
 [browser_roundedWindow_windowSetting_max.js]
 [browser_roundedWindow_windowSetting_mid.js]
 [browser_roundedWindow_windowSetting_min.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js
@@ -0,0 +1,40 @@
+/**
+ * Bug 1352305 - A test case for dialog windows that it should not be rounded
+ *   even after fingerprinting resistance is enabled.
+ */
+
+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);
+}
+
+add_task(async function setup() {
+  await SpecialPowers.pushPrefEnv({"set":
+    [["privacy.resistFingerprinting", true]]
+  });
+});
+
+add_task(test_dialog_window);
+
+add_task(async function test_dialog_window_without_resistFingerprinting() {
+  // Test dialog windows with 'privacy.resistFingerprinting' is false.
+  await SpecialPowers.pushPrefEnv({"set":
+    [["privacy.resistFingerprinting", false]]
+  });
+
+  await test_dialog_window();
+});