Bug 1390874 - Add a hidpi test directory to emulate high screen resolution for browser_startup_images.js. r=florian draft
authorJohann Hofmann <jhofmann@mozilla.com>
Wed, 16 Aug 2017 15:33:14 +0200
changeset 661342 30a52bcceeb19648e59c10ad29e1c71ca2e4e427
parent 660422 d8e238b811d3dc74515065ae8cab6c74baf0295f
child 730534 baf51fafcf86d87a626db8289177fb835ea1f355
push id78718
push userbmo:jhofmann@mozilla.com
push dateFri, 08 Sep 2017 09:37:34 +0000
reviewersflorian
bugs1390874
milestone57.0a1
Bug 1390874 - Add a hidpi test directory to emulate high screen resolution for browser_startup_images.js. r=florian Also adds a warning that the test should only be used in debug mode. MozReview-Commit-ID: 6X8jSz5O2ue
browser/base/content/test/performance/browser.ini
browser/base/content/test/performance/browser_startup_images.js
browser/base/content/test/performance/hidpi/browser.ini
browser/base/content/test/performance/lowdpi/browser.ini
browser/base/moz.build
--- a/browser/base/content/test/performance/browser.ini
+++ b/browser/base/content/test/performance/browser.ini
@@ -1,18 +1,16 @@
 [DEFAULT]
 support-files =
   head.js
 [browser_appmenu_reflows.js]
 skip-if = asan || debug # Bug 1382809, bug 1369959
 [browser_startup.js]
 [browser_startup_content.js]
 skip-if = !e10s
-[browser_startup_images.js]
-skip-if = !debug
 [browser_tabclose_grow_reflows.js]
 [browser_tabclose_reflows.js]
 [browser_tabopen_reflows.js]
 [browser_tabopen_squeeze_reflows.js]
 [browser_tabstrip_overflow_underflow_reflows.js]
 [browser_tabswitch_reflows.js]
 [browser_toolbariconcolor_restyles.js]
 [browser_urlbar_keyed_search_reflows.js]
--- a/browser/base/content/test/performance/browser_startup_images.js
+++ b/browser/base/content/test/performance/browser_startup_images.js
@@ -37,17 +37,23 @@ const whitelist = [
   {
     file: "chrome://browser/skin/tracking-protection-16.svg#enabled",
     platforms: ["linux", "win", "macosx"],
   },
 
   {
     file: "chrome://browser/skin/tabbrowser/tabDragIndicator.png",
     hidpi: "chrome://browser/skin/tabbrowser/tabDragIndicator@2x.png",
-    platforms: ["linux", "win", "macosx"],
+    platforms: ["macosx"],
+  },
+
+  {
+    file: "chrome://browser/skin/tabbrowser/tabDragIndicator.png",
+    hidpi: "<not loaded>",
+    platforms: ["linux", "win"],
   },
 
   {
     file: "resource://gre-resources/loading-image.png",
     platforms: ["win", "macosx"],
     intermittentNotLoaded: ["win", "macosx"],
   },
   {
@@ -63,16 +69,20 @@ const whitelist = [
 
   {
     file: "chrome://global/skin/icons/resizer.png",
     platforms: ["win"],
   },
 ];
 
 add_task(async function() {
+  if (!AppConstants.DEBUG) {
+    ok(false, "You need to run this test on a debug build.");
+  }
+
   let startupRecorder = Cc["@mozilla.org/test/startuprecorder;1"].getService().wrappedJSObject;
   await startupRecorder.done;
 
   let data = startupRecorder.data.images;
   let filteredWhitelist = whitelist.filter(el => {
     return el.platforms.includes(AppConstants.platform);
   });
 
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/performance/hidpi/browser.ini
@@ -0,0 +1,6 @@
+[DEFAULT]
+prefs =
+  layout.css.devPixelsPerPx='2'
+
+[../browser_startup_images.js]
+skip-if = !debug || (os == 'win' && os_version == '6.1') # hidpi results in the toolbar overflowing on Win 7
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/performance/lowdpi/browser.ini
@@ -0,0 +1,6 @@
+[DEFAULT]
+prefs =
+  layout.css.devPixelsPerPx='1'
+
+[../browser_startup_images.js]
+skip-if = !debug
--- a/browser/base/moz.build
+++ b/browser/base/moz.build
@@ -22,16 +22,18 @@ BROWSER_CHROME_MANIFESTS += [
     'content/test/alerts/browser.ini',
     'content/test/captivePortal/browser.ini',
     'content/test/contextMenu/browser.ini',
     'content/test/forms/browser.ini',
     'content/test/general/browser.ini',
     'content/test/newtab/browser.ini',
     'content/test/pageinfo/browser.ini',
     'content/test/performance/browser.ini',
+    'content/test/performance/hidpi/browser.ini',
+    'content/test/performance/lowdpi/browser.ini',
     'content/test/permissions/browser.ini',
     'content/test/plugins/browser.ini',
     'content/test/popupNotifications/browser.ini',
     'content/test/popups/browser.ini',
     'content/test/referrer/browser.ini',
     'content/test/sidebar/browser.ini',
     'content/test/siteIdentity/browser.ini',
     'content/test/static/browser.ini',