From 2da62564a855f6d0a3f9289251d48e832b5c15b7 Mon Sep 17 00:00:00 2001 From: Alex Gibson Date: Mon, 19 Aug 2019 10:33:20 +0100 Subject: [PATCH] Drop 1st class support for IE9 (Fixes #7559) --- bedrock/base/templates/base-article.html | 2 +- bedrock/base/templates/base-pebbles.html | 46 ++++---- bedrock/base/templates/base-protocol.html | 6 +- bedrock/base/templates/base-resp.html | 28 +++-- .../templates/firefox/election/index.html | 11 -- .../templates/firefox/fights-for-you.de.html | 12 -- .../templates/firefox/fights-for-you.fr.html | 12 -- .../templates/firefox/fights-for-you.html | 12 -- .../firefox/templates/firefox/home/index.html | 14 ++- .../mozorg/contribute/contribute-embed.html | 4 +- docs/stub-attribution.rst | 2 +- media/css/firefox/home/home.scss | 99 +---------------- media/css/firefox/home/ie9.scss | 7 ++ media/css/firefox/home/includes/_header.scss | 104 ++++++++++++++++++ media/js/firefox/new/scene2.js | 18 ++- .../base-page-init-ie.js} | 4 +- .../mozilla-utils-ie.js} | 16 +-- media/js/libs/matchMedia.addListener.js | 47 -------- media/js/libs/matchMedia.js | 34 ------ media/static-bundles.json | 19 ++-- .../firefox/features/test_landing.py | 1 - tests/functional/firefox/test_developer.py | 1 - tests/unit/karma.conf.js | 4 +- .../mozilla-utils-ie.js} | 22 ++-- 24 files changed, 203 insertions(+), 322 deletions(-) create mode 100644 media/css/firefox/home/ie9.scss create mode 100644 media/css/firefox/home/includes/_header.scss rename media/js/{ie8/base-page-init-ie8.js => ie/base-page-init-ie.js} (85%) rename media/js/{ie8/mozilla-utils-ie8.js => ie/mozilla-utils-ie.js} (81%) delete mode 100644 media/js/libs/matchMedia.addListener.js delete mode 100644 media/js/libs/matchMedia.js rename tests/unit/spec/{ie8/mozilla-utils-ie8.js => ie/mozilla-utils-ie.js} (70%) diff --git a/bedrock/base/templates/base-article.html b/bedrock/base/templates/base-article.html index f0d838b9672..5b86ef21a5a 100644 --- a/bedrock/base/templates/base-article.html +++ b/bedrock/base/templates/base-article.html @@ -40,7 +40,7 @@ {% block site_js %} {{ super() }} - + {{ js_bundle('basic-article') }} {% endblock %} diff --git a/bedrock/base/templates/base-pebbles.html b/bedrock/base/templates/base-pebbles.html index 9f1e5970fb0..36f93c0d6c1 100644 --- a/bedrock/base/templates/base-pebbles.html +++ b/bedrock/base/templates/base-pebbles.html @@ -9,7 +9,7 @@ {{ js_bundle('site') }} - + {% block experiments %}{% endblock %} @@ -50,28 +50,30 @@ {{ l10n_css() }} - - {# Basic styles, only for IE8 and lower #} + - - {# Global styles, hidden from IE8 and lower #} + + {# Global styles, hidden from IE9 and lower #} {% block site_css %} {{ css_bundle('pebbles') }} {% endblock %} - {# Page-specific styles, hidden from IE8 and lower #} + {# Page-specific styles, hidden from IE9 and lower #} {% block page_css %}{% endblock %} {% block extrahead %} - {# Extra header stuff (scripts, styles, metadata, etc) seen by all browsers. Use the 'page_css' block for CSS you want to hide from IE7 and lower. #} + {# Extra header stuff (scripts, styles, metadata, etc) seen by all browsers. Use the 'page_css' block for CSS you want to hide from IE9 and lower. #} {% endblock %} {% block js_pretrack %}{# include JavaScript that must be run pre GA tracking here #}{% endblock %} @@ -91,29 +93,25 @@ data-global-fx-out-of-date-banner-confirm="{{ _('Update Firefox') }}" {% block string_data %}{% endblock %}> - {% block site_header %} - {% include 'includes/protocol/navigation/index.html' %} - {% endblock %} - -
- {% block content %}{% endblock %} - - {% block site_footer %} - {% include 'includes/site-footer.html' %} + {% block site_header %} + {% include 'includes/protocol/navigation/index.html' %} {% endblock %} -
- +
+ {% block content %}{% endblock %} + + {% block site_footer %} + {% include 'includes/site-footer.html' %} + {% endblock %} +
{% block site_js %} - + {{ js_bundle('common') }} - {% endblock %} @@ -124,7 +122,7 @@ {% endif %} {% endblock %} - + {% block js %}{% endblock %} {# Bug 1381776 #} diff --git a/bedrock/base/templates/base-protocol.html b/bedrock/base/templates/base-protocol.html index 432c88f51bb..20c73f8fe11 100644 --- a/bedrock/base/templates/base-protocol.html +++ b/bedrock/base/templates/base-protocol.html @@ -13,12 +13,12 @@ {% endblock %} {% block site_js %} - + {{ js_bundle('common-protocol') }} - {% endblock %} diff --git a/bedrock/base/templates/base-resp.html b/bedrock/base/templates/base-resp.html index 0ae0344a6e5..3804714fd3e 100644 --- a/bedrock/base/templates/base-resp.html +++ b/bedrock/base/templates/base-resp.html @@ -9,7 +9,7 @@ {{ js_bundle('site') }} - + {% block experiments %}{% endblock %} @@ -50,26 +50,28 @@ {{ l10n_css() }} - - {# Basic styles, only for IE8 and lower #} + - - {# Global styles, hidden from IE8 and lower #} + + {# Global styles, hidden from IE9 and lower #} {% block site_css %} {{ css_bundle('responsive') }} {% endblock %} - {# Page-specific styles, hidden from IE8 and lower #} + {# Page-specific styles, hidden from IE9 and lower #} {% block page_css %}{% endblock %} {% block extrahead %} - {# Extra header stuff (scripts, styles, metadata, etc) seen by all browsers. Use the 'page_css' block for CSS you want to hide from IE8 and lower. #} + {# Extra header stuff (scripts, styles, metadata, etc) seen by all browsers. Use the 'page_css' block for CSS you want to hide from IE9 and lower. #} {% endblock %} {% block js_pretrack %}{# include JavaScript that must be run pre GA tracking here #}{% endblock %} @@ -127,17 +129,13 @@ - - {% block site_js %} - + {{ js_bundle('common') }} - {% endblock %} @@ -148,7 +146,7 @@ {% endif %} {% endblock %} - + {% block js %}{% endblock %} {# Bug 1381776 #} diff --git a/bedrock/firefox/templates/firefox/election/index.html b/bedrock/firefox/templates/firefox/election/index.html index 93dbea710d3..02c0364ae36 100644 --- a/bedrock/firefox/templates/firefox/election/index.html +++ b/bedrock/firefox/templates/firefox/election/index.html @@ -18,17 +18,6 @@ {% block body_class %}election{% endblock %} -{% block extrahead %} - -{% endblock %} - {% block site_header %} {% include 'includes/protocol/navigation/index.html' %} {% endblock %} diff --git a/bedrock/firefox/templates/firefox/fights-for-you.de.html b/bedrock/firefox/templates/firefox/fights-for-you.de.html index b69ea20e5a8..97406dfaae3 100644 --- a/bedrock/firefox/templates/firefox/fights-for-you.de.html +++ b/bedrock/firefox/templates/firefox/fights-for-you.de.html @@ -16,18 +16,6 @@ {{ css_bundle('fights-for-you') }} {% endblock %} -{% block extrahead %} - -{% endblock %} - {% block body_id %}fights-for-you{% endblock %} {% block content %} diff --git a/bedrock/firefox/templates/firefox/fights-for-you.fr.html b/bedrock/firefox/templates/firefox/fights-for-you.fr.html index 132e5e0c284..439f25fe91f 100644 --- a/bedrock/firefox/templates/firefox/fights-for-you.fr.html +++ b/bedrock/firefox/templates/firefox/fights-for-you.fr.html @@ -16,18 +16,6 @@ {{ css_bundle('fights-for-you') }} {% endblock %} -{% block extrahead %} - -{% endblock %} - {% block body_id %}fights-for-you{% endblock %} {% block content %} diff --git a/bedrock/firefox/templates/firefox/fights-for-you.html b/bedrock/firefox/templates/firefox/fights-for-you.html index cf7538007f9..c8450f38d9e 100644 --- a/bedrock/firefox/templates/firefox/fights-for-you.html +++ b/bedrock/firefox/templates/firefox/fights-for-you.html @@ -17,18 +17,6 @@ {{ css_bundle('fights-for-you') }} {% endblock %} -{% block extrahead %} - -{% endblock %} - {% block body_id %}fights-for-you{% endblock %} {% block content %} diff --git a/bedrock/firefox/templates/firefox/home/index.html b/bedrock/firefox/templates/firefox/home/index.html index a50c9455a48..12d3d07d559 100644 --- a/bedrock/firefox/templates/firefox/home/index.html +++ b/bedrock/firefox/templates/firefox/home/index.html @@ -21,6 +21,12 @@ {{ css_bundle('firefox-home') }} {% endblock %} +{% block extrahead %} + + {{ css_bundle('firefox-home-ie9') }} + +{% endblock %} + {% block body_id %}firefox-home{% endblock %} {% block body_attrs %}{% if variation %}data-variant="{{ variation }}"{% endif %}{% endblock %} @@ -85,7 +91,7 @@

{{ _('Faster Page Loading') }}

-
+
{{ lazy_img(image_url='firefox/home/private-browsing.png', placeholder_url='firefox/home/spacer.gif', include_highres_image=True, optional_attributes={'alt': '', 'width': '502', 'height': '325'}) }} {{ lazy_img(image_url='firefox/home/tracking-protection.png', placeholder_url='firefox/home/spacer.gif', include_highres_image=True, optional_attributes={'alt': '', 'width': '503', 'height': '305'}) }}
@@ -112,7 +118,7 @@

{{ _('Sync you {% endif %}

-
+
{{ lazy_img(image_url='firefox/home/sync.png', placeholder_url='firefox/home/spacer.gif', include_highres_image=True, optional_attributes={'alt': _('Image of Gif shared from desktop to mobile using the Send Tab feature.'), 'width': '788', 'height': '571'}) }}
@@ -204,7 +210,7 @@

{{ _('30% lighter than Chrome') }}

{% endtrans %}

-
+
{{ lazy_img(image_url='firefox/home/less-memory.png', placeholder_url='firefox/home/spacer.gif', include_highres_image=True, optional_attributes={'alt': '', 'width': '645', 'height': '400'}) }}
@@ -226,7 +232,7 @@

{{ _('Moving bro {{ _('Learn more') }} -
+
{{ lazy_img(image_url='firefox/home/switch-to-firefox.png', placeholder_url='firefox/home/spacer.gif', include_highres_image=True, optional_attributes={'width': '643', 'height': '377'}) }} diff --git a/bedrock/mozorg/templates/mozorg/contribute/contribute-embed.html b/bedrock/mozorg/templates/mozorg/contribute/contribute-embed.html index 253d76af45e..58eedb15fb6 100644 --- a/bedrock/mozorg/templates/mozorg/contribute/contribute-embed.html +++ b/bedrock/mozorg/templates/mozorg/contribute/contribute-embed.html @@ -12,8 +12,8 @@ Mozilla — {{_('Get Involved: Volunteer Opportunities at Mozilla')}} — mozilla.org - {{ css_bundle('responsive') }} diff --git a/docs/stub-attribution.rst b/docs/stub-attribution.rst index 89188a891be..63261ab9cba 100644 --- a/docs/stub-attribution.rst +++ b/docs/stub-attribution.rst @@ -82,7 +82,7 @@ the page template where an experiment exists: {% block stub_attribution %} {% if settings.STUB_ATTRIBUTION_RATE %} - + {{ js_bundle('stub-attribution-custom') }} {{ js_bundle('my-page-experiment-script') }} diff --git a/media/css/firefox/home/home.scss b/media/css/firefox/home/home.scss index b2d938437bb..fcaad72631d 100644 --- a/media/css/firefox/home/home.scss +++ b/media/css/firefox/home/home.scss @@ -3,6 +3,7 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. @import '../../pebbles/includes/lib'; +@import 'includes/header'; @import '../../pebbles/components/video-poster'; @import '../../hubs/sections'; @import '../../hubs/sub-nav'; @@ -75,104 +76,6 @@ body { } } -/* -------------------------------------------------------------------------- */ -// Main page header - -.main-header-section { - - h1 { - @include at2x('/media/img/logos/firefox/logo-quantum.png', 90px, 90px); - @include font-size-level2; - background-position: top center; - background-repeat: no-repeat; - color: #000; - margin: 0 auto 10px; - padding-top: 110px; - } - - h2 { - @include font-size-level3; - margin-top: 20px; - } - - h3 { - @include font-size-level3; - } - - .download-button { - margin: 40px 0; - } - - .fx-privacy-link a { - color: #000; - } - - @media #{$mq-tablet} { - min-height: 550px; - text-align: left; - padding-top: 40px; - - h1 { - background-position: left center; - margin: -40px 0 10px; - padding: 40px 0 40px 110px; - } - - .header-content { - float: left; - width: 55%; - } - - .header-image { - margin-bottom: 0; - position: absolute; - right: 0; - top: 20px; - width: 45%; - - img { - display: block; - height: auto; - max-width: none; - width: 903px; - } - } - } - - @media #{$mq-desktop-wide} { - padding-top: 80px; - - .header-content { - width: 43%; - } - - .header-image { - width: 57%; - } - } -} - -html[dir="rtl"] .main-header-section { - - @media #{$mq-tablet} { - - h1 { - background-position: right center; - padding: 40px 110px 40px 0; - } - - .header-content { - float: right; - text-align: right; - } - - .header-image { - left: 0; - right: auto; - } - } -} - /* -------------------------------------------------------------------------- */ // Key features section diff --git a/media/css/firefox/home/ie9.scss b/media/css/firefox/home/ie9.scss new file mode 100644 index 00000000000..29a4a1c795f --- /dev/null +++ b/media/css/firefox/home/ie9.scss @@ -0,0 +1,7 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +@import '../../pebbles/includes/lib'; +@import 'includes/header'; + diff --git a/media/css/firefox/home/includes/_header.scss b/media/css/firefox/home/includes/_header.scss new file mode 100644 index 00000000000..414a03642d5 --- /dev/null +++ b/media/css/firefox/home/includes/_header.scss @@ -0,0 +1,104 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +@import '../../../pebbles/includes/lib'; + +/* -------------------------------------------------------------------------- */ +// Main page header + +.main-header-section { + + h1 { + @include at2x('/media/img/logos/firefox/logo-quantum.png', 90px, 90px); + @include font-size-level2; + background-position: top center; + background-repeat: no-repeat; + color: #000; + margin: 0 auto 10px; + padding-top: 110px; + } + + h2 { + @include font-size-level3; + margin-top: 20px; + } + + h3 { + @include font-size-level3; + } + + .download-button { + margin: 40px 0; + } + + .fx-privacy-link a { + color: #000; + } + + @media #{$mq-tablet} { + position: relative; + min-height: 550px; + text-align: left; + padding-top: 40px; + + h1 { + background-position: left center; + margin: -40px 0 10px; + padding: 40px 0 40px 110px; + } + + .header-content { + float: left; + width: 55%; + } + + .header-image { + margin-bottom: 0; + position: absolute; + right: 0; + top: 20px; + width: 45%; + + img { + display: block; + height: auto; + max-width: none; + width: 903px; + } + } + } + + @media #{$mq-desktop-wide} { + padding-top: 80px; + + .header-content { + width: 43%; + } + + .header-image { + width: 57%; + } + } +} + +html[dir="rtl"] .main-header-section { + + @media #{$mq-tablet} { + + h1 { + background-position: right center; + padding: 40px 110px 40px 0; + } + + .header-content { + float: right; + text-align: right; + } + + .header-image { + left: 0; + right: auto; + } + } +} diff --git a/media/js/firefox/new/scene2.js b/media/js/firefox/new/scene2.js index d53409824d2..71fbadcf94e 100644 --- a/media/js/firefox/new/scene2.js +++ b/media/js/firefox/new/scene2.js @@ -5,7 +5,6 @@ (function($) { 'use strict'; - var isIELT9 = window.Mozilla.Client.platform === 'windows' && /MSIE\s[1-8]\./.test(navigator.userAgent); var $directDownloadLink = $('#direct-download-link'); var $platformLink = $('#download-button-wrapper-desktop .download-list li:visible .download-link'); var downloadURL; @@ -21,16 +20,13 @@ // TODO: Remove and generate link in bedrock. $directDownloadLink.attr('href', downloadURL); - // If user is not on an IE that blocks JS triggered downloads, start the - // platform-detected download a second after DOM ready event. We don't rely on - // the window load event as we have third-party tracking pixels. - if (!isIELT9) { - $(function() { - setTimeout(function() { - window.location.href = downloadURL; - }, 1000); - }); - } + // Start the platform-detected download a second after DOM ready event. + // We don't rely on the window load event as we have third-party tracking pixels. + $(function() { + setTimeout(function() { + window.location.href = downloadURL; + }, 1000); + }); } })(window.jQuery); diff --git a/media/js/ie8/base-page-init-ie8.js b/media/js/ie/base-page-init-ie.js similarity index 85% rename from media/js/ie8/base-page-init-ie8.js rename to media/js/ie/base-page-init-ie.js index 587d9cf5139..f414d93abdc 100644 --- a/media/js/ie8/base-page-init-ie8.js +++ b/media/js/ie/base-page-init-ie.js @@ -9,10 +9,10 @@ $(document).ready(function() { 'use strict'; // Initialize download buttons. - Mozilla.UtilsIE8.initDownloadLinks(); + Mozilla.UtilsIE.initDownloadLinks(); // Initialize navigation. - Mozilla.UtilsIE8.initNavigation(); + Mozilla.UtilsIE.initNavigation(); $(window).on('load', function() { $('html').addClass('loaded'); diff --git a/media/js/ie8/mozilla-utils-ie8.js b/media/js/ie/mozilla-utils-ie.js similarity index 81% rename from media/js/ie8/mozilla-utils-ie8.js rename to media/js/ie/mozilla-utils-ie.js index cea47e5be1f..db5bf778938 100644 --- a/media/js/ie8/mozilla-utils-ie8.js +++ b/media/js/ie/mozilla-utils-ie.js @@ -10,18 +10,18 @@ if (typeof window.Mozilla === 'undefined') { (function() { 'use strict'; - var UtilsIE8 = {}; + var UtilsIE = {}; /** - * Bug 393263 A special function for IE < 9. + * Bug 393263 A special function for IE < 10. * Without this hack there is no prompt to download after they click. sigh. * @param {link} direct link to download URL * @param {userAgent} optional UA string for testing purposes. */ - UtilsIE8.triggerIEDownload = function(link, userAgent) { + UtilsIE.triggerIEDownload = function(link, userAgent) { var ua = userAgent !== undefined ? userAgent : navigator.userAgent; // Only open if we got a link and this is IE < 9. - if (link && window.site.platform === 'windows' && /MSIE\s[1-8]\./.test(ua)) { + if (link && window.site.platform === 'windows' && /MSIE\s[1-9]\./.test(ua)) { window.open(link, 'download_window', 'toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0'); window.focus(); } @@ -29,17 +29,17 @@ if (typeof window.Mozilla === 'undefined') { // attach an event to all the download buttons to trigger the special // ie functionality if on ie - UtilsIE8.initDownloadLinks = function() { + UtilsIE.initDownloadLinks = function() { $('.download-link').each(function() { var $el = $(this); $el.click(function() { - UtilsIE8.triggerIEDownload($el.data('direct-link')); + UtilsIE.triggerIEDownload($el.data('direct-link')); }); }); $('.download-list').attr('role', 'presentation'); }; - UtilsIE8.initNavigation = function() { + UtilsIE.initNavigation = function() { $('.mzp-c-navigation-menu-button').on('click', function(e) { e.preventDefault(); var $menuButton = $(e.target); @@ -48,6 +48,6 @@ if (typeof window.Mozilla === 'undefined') { }); }; - window.Mozilla.UtilsIE8 = UtilsIE8; + window.Mozilla.UtilsIE = UtilsIE; })(); diff --git a/media/js/libs/matchMedia.addListener.js b/media/js/libs/matchMedia.addListener.js deleted file mode 100644 index 11a7f89e738..00000000000 --- a/media/js/libs/matchMedia.addListener.js +++ /dev/null @@ -1,47 +0,0 @@ -/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */ -(function(){ - // monkeypatch unsupported addListener/removeListener with polling - if( !window.matchMedia( "all" ).addListener ){ - var oldMM = window.matchMedia; - - window.matchMedia = function( q ){ - var ret = oldMM( q ), - listeners = [], - last = ret.matches, - timer, - check = function(){ - var list = oldMM( q ), - unmatchToMatch = list.matches && !last, - matchToUnmatch = !list.matches && last; - - //fire callbacks only if transitioning to or from matched state - if( unmatchToMatch || matchToUnmatch ){ - for( var i =0, il = listeners.length; i< il; i++ ){ - listeners[ i ].call( ret, list ); - } - } - last = list.matches; - }; - - ret.addListener = function( cb ){ - listeners.push( cb ); - if( !timer ){ - timer = setInterval( check, 1000 ); - } - }; - - ret.removeListener = function( cb ){ - for( var i =0, il = listeners.length; i< il; i++ ){ - if( listeners[ i ] === cb ){ - listeners.splice( i, 1 ); - } - } - if( !listeners.length && timer ){ - clearInterval( timer ); - } - }; - - return ret; - }; - } -}()); diff --git a/media/js/libs/matchMedia.js b/media/js/libs/matchMedia.js deleted file mode 100644 index 70c0acfb835..00000000000 --- a/media/js/libs/matchMedia.js +++ /dev/null @@ -1,34 +0,0 @@ -/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ - -window.matchMedia = window.matchMedia || (function( doc, undefined ) { - - "use strict"; - - var bool, - docElem = doc.documentElement, - refNode = docElem.firstElementChild || docElem.firstChild, - // fakeBody required for - fakeBody = doc.createElement( "body" ), - div = doc.createElement( "div" ); - - div.id = "mq-test-1"; - div.style.cssText = "position:absolute;top:-100em"; - fakeBody.style.background = "none"; - fakeBody.appendChild(div); - - return function(q){ - - div.innerHTML = "­"; - - docElem.insertBefore( fakeBody, refNode ); - bool = div.offsetWidth === 42; - docElem.removeChild( fakeBody ); - - return { - matches: bool, - media: q - }; - - }; - -}( document )); diff --git a/media/static-bundles.json b/media/static-bundles.json index d294f8d5180..3eaf72c8878 100644 --- a/media/static-bundles.json +++ b/media/static-bundles.json @@ -666,6 +666,12 @@ ], "name": "firefox-home" }, + { + "files": [ + "css/firefox/home/ie9.scss" + ], + "name": "firefox-home-ie9" + }, { "files": [ "css/mozorg/book.scss" @@ -1357,14 +1363,14 @@ { "files": [ "js/libs/jquery-1.11.3.min.js", - "js/ie8/mozilla-utils-ie8.js", + "js/ie/mozilla-utils-ie.js", "js/base/mozilla-client.js", - "js/ie8/base-page-init-ie8.js", + "js/ie/base-page-init-ie.js", "js/base/core-datalayer.js", "js/base/core-datalayer-init.js", "js/base/search-params.js" ], - "name": "common-ie8" + "name": "common-ie" }, { "files": [ @@ -1551,13 +1557,6 @@ ], "name": "basic-article" }, - { - "files": [ - "js/libs/matchMedia.js", - "js/libs/matchMedia.addListener.js" - ], - "name": "matchmedia" - }, { "files": [ "js/libs/modernizr.custom.inputtypes.js", diff --git a/tests/functional/firefox/features/test_landing.py b/tests/functional/firefox/features/test_landing.py index 22dd6990c2b..aec48337e74 100644 --- a/tests/functional/firefox/features/test_landing.py +++ b/tests/functional/firefox/features/test_landing.py @@ -7,7 +7,6 @@ from pages.firefox.features.landing import FeaturesLandingPage -@pytest.mark.sanity @pytest.mark.nondestructive def test_download_button_is_displayed(base_url, selenium): page = FeaturesLandingPage(selenium, base_url).open() diff --git a/tests/functional/firefox/test_developer.py b/tests/functional/firefox/test_developer.py index 0e423f0e131..84bfdc7fc64 100644 --- a/tests/functional/firefox/test_developer.py +++ b/tests/functional/firefox/test_developer.py @@ -7,7 +7,6 @@ from pages.firefox.developer import DeveloperPage -@pytest.mark.sanity @pytest.mark.nondestructive def test_download_buttons_are_displayed(base_url, selenium): page = DeveloperPage(selenium, base_url).open() diff --git a/tests/unit/karma.conf.js b/tests/unit/karma.conf.js index 2d6911878c9..c46806d3bf1 100644 --- a/tests/unit/karma.conf.js +++ b/tests/unit/karma.conf.js @@ -37,7 +37,7 @@ module.exports = function(config) { 'media/js/firefox/all/all-downloads-unified.js', 'media/js/firefox/new/yandex/scene1.js', 'media/js/firefox/tracking-protection-tour.js', - 'media/js/ie8/mozilla-utils-ie8.js', + 'media/js/ie/mozilla-utils-ie.js', 'tests/unit/spec/base/core-datalayer-page-id.js', 'tests/unit/spec/base/core-datalayer.js', 'tests/unit/spec/base/dnt-helper.js', @@ -61,7 +61,7 @@ module.exports = function(config) { 'tests/unit/spec/firefox/all/all-downloads-unified.js', 'tests/unit/spec/firefox/new/yandex/scene1.js', 'tests/unit/spec/firefox/tracking-protection-tour.js', - 'tests/unit/spec/ie8/mozilla-utils-ie8.js', + 'tests/unit/spec/ie/mozilla-utils-ie.js', { pattern: 'node_modules/sinon/pkg/sinon.js', watched: false, diff --git a/tests/unit/spec/ie8/mozilla-utils-ie8.js b/tests/unit/spec/ie/mozilla-utils-ie.js similarity index 70% rename from tests/unit/spec/ie8/mozilla-utils-ie8.js rename to tests/unit/spec/ie/mozilla-utils-ie.js index 7a3824d06f9..1df7cfe7ecf 100644 --- a/tests/unit/spec/ie8/mozilla-utils-ie8.js +++ b/tests/unit/spec/ie/mozilla-utils-ie.js @@ -5,7 +5,7 @@ /* global sinon */ -describe('mozilla-utils.js', function() { +describe('mozilla-utils-ie.js', function() { 'use strict'; @@ -19,24 +19,24 @@ describe('mozilla-utils.js', function() { window.site.platform = 'other'; }); - it('should open a popup for IE < 9', function () { - var userAgent = 'Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.4; InfoPath.2; SV1; .NET CLR 3.3.69573; WOW64; en-US)'; + it('should open a popup for IE < 10', function () { + var userAgent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)'; window.open = sinon.stub(); - Mozilla.UtilsIE8.triggerIEDownload('foo', userAgent); + Mozilla.UtilsIE.triggerIEDownload('foo', userAgent); expect(window.open.called).toBeTruthy(); }); - it('should not open a popup for IE 9', function () { - var userAgent = 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)'; + it('should not open a popup for IE 10', function () { + var userAgent = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)'; window.open = sinon.stub(); - Mozilla.UtilsIE8.triggerIEDownload('foo', userAgent); + Mozilla.UtilsIE.triggerIEDownload('foo', userAgent); expect(window.open.called).not.toBeTruthy(); }); it('should not open a popup for other browsers', function () { var userAgent = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'; window.open = sinon.stub(); - Mozilla.UtilsIE8.triggerIEDownload('foo', userAgent); + Mozilla.UtilsIE.triggerIEDownload('foo', userAgent); expect(window.open.called).not.toBeTruthy(); }); @@ -56,10 +56,10 @@ describe('mozilla-utils.js', function() { }); it('should call triggerIEDownload when clicked', function () { - spyOn(Mozilla.UtilsIE8, 'triggerIEDownload'); - Mozilla.UtilsIE8.initDownloadLinks(); + spyOn(Mozilla.UtilsIE, 'triggerIEDownload'); + Mozilla.UtilsIE.initDownloadLinks(); $('.download-link').trigger('click'); - expect(Mozilla.UtilsIE8.triggerIEDownload).toHaveBeenCalled(); + expect(Mozilla.UtilsIE.triggerIEDownload).toHaveBeenCalled(); }); });