diff --git a/CLOBBER b/CLOBBER index d788c5f8a688..864c1c575427 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Bug 1178892 requires clobber for profiler file moves. +Bug 1178850 requires clobber for Android JNI header changes diff --git a/b2g/config/mozconfigs/common.override b/b2g/config/mozconfigs/common.override index b94b773c0032..abe73b4605d0 100644 --- a/b2g/config/mozconfigs/common.override +++ b/b2g/config/mozconfigs/common.override @@ -5,3 +5,4 @@ # This file is included at the bottom of all b2g mozconfigs . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/b2g/config/mozconfigs/ics_armv7a_gecko/debug b/b2g/config/mozconfigs/ics_armv7a_gecko/debug index 494df42c02ba..1cacb8a7551d 100644 --- a/b2g/config/mozconfigs/ics_armv7a_gecko/debug +++ b/b2g/config/mozconfigs/ics_armv7a_gecko/debug @@ -12,7 +12,6 @@ export GONK_PRODUCT=generic ac_add_options --with-gonk-toolchain-prefix="$topsrcdir/gonk-toolchain/prebuilt/$TOOLCHAIN_HOST/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-" ac_add_options --enable-debug-symbols ac_add_options --enable-debug -#. "$topsrcdir/build/mozconfig.cache" ENABLE_MARIONETTE=1 # Enable dump() from JS. diff --git a/b2g/config/mozconfigs/ics_armv7a_gecko/nightly b/b2g/config/mozconfigs/ics_armv7a_gecko/nightly index ece18271d8ae..c2f1ae0fa99a 100644 --- a/b2g/config/mozconfigs/ics_armv7a_gecko/nightly +++ b/b2g/config/mozconfigs/ics_armv7a_gecko/nightly @@ -13,7 +13,6 @@ export GONK_PRODUCT=generic ac_add_options --with-gonk-toolchain-prefix="$topsrcdir/gonk-toolchain/prebuilt/$TOOLCHAIN_HOST/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-" ac_add_options --enable-debug-symbols # ac_add_options --enable-profiling -#. "$topsrcdir/build/mozconfig.cache" ENABLE_MARIONETTE=1 # Enable dump() from JS. diff --git a/b2g/config/mozconfigs/linux32_gecko/debug b/b2g/config/mozconfigs/linux32_gecko/debug index ec6476cd27fa..917f4a5f09a0 100644 --- a/b2g/config/mozconfigs/linux32_gecko/debug +++ b/b2g/config/mozconfigs/linux32_gecko/debug @@ -9,9 +9,6 @@ ac_add_options --enable-update-packaging ac_add_options --enable-signmar ac_add_options --enable-debug -# Nightlies only since this has a cost in performance -#ac_add_options --enable-js-diagnostics - # This will overwrite the default of stripping everything and keep the symbol table. # This is useful for profiling and debugging and only increases the package size # by 2 MBs. @@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors # Use sccache no_sccache= -. "$topsrcdir/build/mozconfig.cache" #B2G options ac_add_options --enable-application=b2g diff --git a/b2g/config/mozconfigs/linux32_gecko/nightly b/b2g/config/mozconfigs/linux32_gecko/nightly index 7b38c3189333..8f41f9609f51 100644 --- a/b2g/config/mozconfigs/linux32_gecko/nightly +++ b/b2g/config/mozconfigs/linux32_gecko/nightly @@ -9,9 +9,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-packaging ac_add_options --enable-signmar -# Nightlies only since this has a cost in performance -#ac_add_options --enable-js-diagnostics - # This will overwrite the default of stripping everything and keep the symbol table. # This is useful for profiling and debugging and only increases the package size # by 2 MBs. @@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors # Use sccache no_sccache= -. "$topsrcdir/build/mozconfig.cache" #B2G options ac_add_options --enable-application=b2g diff --git a/b2g/config/mozconfigs/linux64_gecko/debug b/b2g/config/mozconfigs/linux64_gecko/debug index 31b818e15d99..4fa78e29e11d 100644 --- a/b2g/config/mozconfigs/linux64_gecko/debug +++ b/b2g/config/mozconfigs/linux64_gecko/debug @@ -9,9 +9,6 @@ ac_add_options --enable-update-packaging ac_add_options --enable-signmar ac_add_options --enable-debug -# Nightlies only since this has a cost in performance -#ac_add_options --enable-js-diagnostics - # This will overwrite the default of stripping everything and keep the symbol table. # This is useful for profiling and debugging and only increases the package size # by 2 MBs. @@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors # Use sccache no_sccache= -. "$topsrcdir/build/mozconfig.cache" #B2G options ac_add_options --enable-application=b2g diff --git a/b2g/config/mozconfigs/linux64_gecko/nightly b/b2g/config/mozconfigs/linux64_gecko/nightly index f098f7110658..25fd0e756890 100644 --- a/b2g/config/mozconfigs/linux64_gecko/nightly +++ b/b2g/config/mozconfigs/linux64_gecko/nightly @@ -9,9 +9,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-packaging ac_add_options --enable-signmar -# Nightlies only since this has a cost in performance -#ac_add_options --enable-js-diagnostics - # This will overwrite the default of stripping everything and keep the symbol table. # This is useful for profiling and debugging and only increases the package size # by 2 MBs. @@ -27,7 +24,6 @@ ac_add_options --enable-warnings-as-errors # Use sccache no_sccache= -. "$topsrcdir/build/mozconfig.cache" #B2G options ac_add_options --enable-application=b2g diff --git a/b2g/config/mozconfigs/macosx64_gecko/debug b/b2g/config/mozconfigs/macosx64_gecko/debug index 876475decf47..a3d19eb395cc 100644 --- a/b2g/config/mozconfigs/macosx64_gecko/debug +++ b/b2g/config/mozconfigs/macosx64_gecko/debug @@ -11,9 +11,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-packaging ac_add_options --enable-signmar -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 diff --git a/b2g/config/mozconfigs/macosx64_gecko/nightly b/b2g/config/mozconfigs/macosx64_gecko/nightly index 05eb3c9e8776..a1b5b061a07f 100644 --- a/b2g/config/mozconfigs/macosx64_gecko/nightly +++ b/b2g/config/mozconfigs/macosx64_gecko/nightly @@ -12,9 +12,6 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-packaging ac_add_options --enable-signmar -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 diff --git a/b2g/config/mozconfigs/win32_gecko/debug b/b2g/config/mozconfigs/win32_gecko/debug index fc12dc7bcd19..e67d627e2fe1 100644 --- a/b2g/config/mozconfigs/win32_gecko/debug +++ b/b2g/config/mozconfigs/win32_gecko/debug @@ -9,9 +9,6 @@ ac_add_options --enable-jemalloc ac_add_options --enable-signmar ac_add_options --enable-debug -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 diff --git a/b2g/config/mozconfigs/win32_gecko/nightly b/b2g/config/mozconfigs/win32_gecko/nightly index 7fc27a5f831d..9bb1203ae91f 100644 --- a/b2g/config/mozconfigs/win32_gecko/nightly +++ b/b2g/config/mozconfigs/win32_gecko/nightly @@ -9,9 +9,6 @@ ac_add_options --enable-update-packaging ac_add_options --enable-jemalloc ac_add_options --enable-signmar -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 diff --git a/b2g/config/tooltool-manifests/linux32/releng.manifest b/b2g/config/tooltool-manifests/linux32/releng.manifest index 174251d80bf2..4b9f7ad4ed1b 100644 --- a/b2g/config/tooltool-manifests/linux32/releng.manifest +++ b/b2g/config/tooltool-manifests/linux32/releng.manifest @@ -1,28 +1,23 @@ [ { -"size": 51, -"digest": "c8e40edb314eeabfb92c77cf5ff9a7857033f15dd65a00349bcf9e3e5b75624afc71f733b2ff7e029c20a78313038409c2bd022bf7e5a7e0c487fc2c2d640986", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 80458572, "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad", "algorithm": "sha512", "filename": "gcc.tar.xz", -"unpack": "True" +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true }, { "size": 31057326, "digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51", "algorithm": "sha512", "filename": "moztt.tar.bz2", -"unpack": "True" +"unpack": true } ] diff --git a/b2g/config/tooltool-manifests/linux64/releng.manifest b/b2g/config/tooltool-manifests/linux64/releng.manifest index 174251d80bf2..4b9f7ad4ed1b 100644 --- a/b2g/config/tooltool-manifests/linux64/releng.manifest +++ b/b2g/config/tooltool-manifests/linux64/releng.manifest @@ -1,28 +1,23 @@ [ { -"size": 51, -"digest": "c8e40edb314eeabfb92c77cf5ff9a7857033f15dd65a00349bcf9e3e5b75624afc71f733b2ff7e029c20a78313038409c2bd022bf7e5a7e0c487fc2c2d640986", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 80458572, "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad", "algorithm": "sha512", "filename": "gcc.tar.xz", -"unpack": "True" +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true }, { "size": 31057326, "digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51", "algorithm": "sha512", "filename": "moztt.tar.bz2", -"unpack": "True" +"unpack": true } ] diff --git a/b2g/config/tooltool-manifests/macosx64/releng.manifest b/b2g/config/tooltool-manifests/macosx64/releng.manifest index 5e1cdaf2561c..0867e800a5cb 100644 --- a/b2g/config/tooltool-manifests/macosx64/releng.manifest +++ b/b2g/config/tooltool-manifests/macosx64/releng.manifest @@ -3,28 +3,24 @@ "clang_version": "r183744" }, { -"size": 88, -"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 59602619, "digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true }, { "size": 31057326, "digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51", "algorithm": "sha512", "filename": "moztt.tar.bz2", -"unpack": "True" +"unpack": true } ] diff --git a/b2g/config/tooltool-manifests/win32/releng.manifest b/b2g/config/tooltool-manifests/win32/releng.manifest index b0768e4bd556..8cbd9fcee384 100644 --- a/b2g/config/tooltool-manifests/win32/releng.manifest +++ b/b2g/config/tooltool-manifests/win32/releng.manifest @@ -10,6 +10,13 @@ "digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51", "algorithm": "sha512", "filename": "moztt.tar.bz2", -"unpack": "True" +"unpack": true +}, +{ +"size": 167175, +"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", +"algorithm": "sha512", +"filename": "sccache.tar.bz2", +"unpack": true } ] diff --git a/b2g/dev/config/mozconfigs/macosx64/mulet b/b2g/dev/config/mozconfigs/macosx64/mulet index 2d459a23278d..93bbf41eebd2 100644 --- a/b2g/dev/config/mozconfigs/macosx64/mulet +++ b/b2g/dev/config/mozconfigs/macosx64/mulet @@ -12,9 +12,6 @@ ac_add_options --enable-profiling ac_add_options --enable-instruments ac_add_options --enable-dtrace -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 @@ -30,3 +27,4 @@ export MOZ_PACKAGE_JSSHELL=1 MOZTTDIR=$topsrcdir/moztt . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/b2g/dev/config/tooltool-manifests/linux64/releng.manifest b/b2g/dev/config/tooltool-manifests/linux64/releng.manifest index aee1d62d60f8..4b9f7ad4ed1b 100644 --- a/b2g/dev/config/tooltool-manifests/linux64/releng.manifest +++ b/b2g/dev/config/tooltool-manifests/linux64/releng.manifest @@ -1,27 +1,23 @@ [ { -"size": 82, -"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 80458572, "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad", "algorithm": "sha512", -"filename": "gcc.tar.xz" +"filename": "gcc.tar.xz", +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true }, { "size": 31057326, "digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51", "algorithm": "sha512", "filename": "moztt.tar.bz2", -"unpack": "True" +"unpack": true } ] diff --git a/b2g/dev/config/tooltool-manifests/macosx64/releng.manifest b/b2g/dev/config/tooltool-manifests/macosx64/releng.manifest index 5e1cdaf2561c..0867e800a5cb 100644 --- a/b2g/dev/config/tooltool-manifests/macosx64/releng.manifest +++ b/b2g/dev/config/tooltool-manifests/macosx64/releng.manifest @@ -3,28 +3,24 @@ "clang_version": "r183744" }, { -"size": 88, -"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 59602619, "digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true }, { "size": 31057326, "digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51", "algorithm": "sha512", "filename": "moztt.tar.bz2", -"unpack": "True" +"unpack": true } ] diff --git a/b2g/dev/config/tooltool-manifests/win32/releng.manifest b/b2g/dev/config/tooltool-manifests/win32/releng.manifest index cbd38cec879a..a01b77812445 100644 --- a/b2g/dev/config/tooltool-manifests/win32/releng.manifest +++ b/b2g/dev/config/tooltool-manifests/win32/releng.manifest @@ -6,22 +6,17 @@ "filename": "mozmake.exe" }, { -"size": 51, -"digest": "c8e40edb314eeabfb92c77cf5ff9a7857033f15dd65a00349bcf9e3e5b75624afc71f733b2ff7e029c20a78313038409c2bd022bf7e5a7e0c487fc2c2d640986", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true }, { "size": 31057326, "digest": "b844c3e52be493d2cacafa58c4a924b89c9be8d2dcc2a7c71aed58c253d8035fba4d51df309f73e3c4342a1f3c3898a9a25c4815e2112888d1280f43c41c8e51", "algorithm": "sha512", "filename": "moztt.tar.bz2", -"unpack": "True" +"unpack": true } ] diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml index 60f5367f1ba2..5408f20bd448 100644 --- a/browser/app/blocklist.xml +++ b/browser/app/blocklist.xml @@ -1,5 +1,5 @@ - + @@ -162,7 +162,7 @@ - + @@ -293,7 +293,7 @@ - + @@ -484,7 +484,7 @@ - + @@ -776,7 +776,7 @@ - + @@ -821,7 +821,7 @@ - + @@ -995,7 +995,7 @@ - + @@ -1723,7 +1723,7 @@ - + @@ -3061,6 +3061,18 @@ https://get.adobe.com/flashplayer/ + + + https://get.adobe.com/flashplayer/ + + + + https://get.adobe.com/flashplayer/ + + + + https://get.adobe.com/flashplayer/ + diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 47e4aa8027d3..4539add20085 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -404,8 +404,13 @@ pref("browser.search.order.1", "chrome://browser-region/locale/re pref("browser.search.order.2", "chrome://browser-region/locale/region.properties"); pref("browser.search.order.3", "chrome://browser-region/locale/region.properties"); -// Market-specific search defaults (US market only) -pref("browser.search.geoSpecificDefaults", true); +// Market-specific search defaults +// This is disabled globally, and then enabled for individual locales +// in firefox-l10n.js (eg. it's enabled for en-US). +pref("browser.search.geoSpecificDefaults", false); +pref("browser.search.geoSpecificDefaults.url", ""); + +// US specific default (used as a fallback if the geoSpecificDefaults request fails). pref("browser.search.defaultenginename.US", "data:text/plain,browser.search.defaultenginename.US=Yahoo"); pref("browser.search.order.US.1", "data:text/plain,browser.search.order.US.1=Yahoo"); pref("browser.search.order.US.2", "data:text/plain,browser.search.order.US.2=Google"); @@ -1359,7 +1364,6 @@ pref("services.sync.prefs.sync.xpinstall.whitelist.required", true); // Developer edition preferences #ifdef MOZ_DEV_EDITION sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@mozilla.org"); -sticky_pref("browser.devedition.theme.enabled", true); #else sticky_pref("lightweightThemes.selectedThemeID", ""); #endif diff --git a/browser/base/content/test/general/browser_contextSearchTabPosition.js b/browser/base/content/test/general/browser_contextSearchTabPosition.js index 261926500550..b8ac3c043560 100644 --- a/browser/base/content/test/general/browser_contextSearchTabPosition.js +++ b/browser/base/content/test/general/browser_contextSearchTabPosition.js @@ -53,8 +53,10 @@ function test() { ok(data.days.hasDay(now), "Have data for today."); let day = data.days.getDay(now); - // Will need to be changed if Yahoo isn't the default search engine. - let defaultProviderID = "yahoo"; + // Will need to be changed if Google isn't the default search engine. + // Note: geoSpecificDefaults are disabled for mochitests, so this is the + // non-US en-US default. + let defaultProviderID = "google"; let field = defaultProviderID + ".contextmenu"; ok(day.has(field), "Have search recorded for context menu."); @@ -66,4 +68,3 @@ function test() { }); }); } - diff --git a/browser/base/content/test/general/browser_devedition.js b/browser/base/content/test/general/browser_devedition.js index b33c7e63f6a6..06ee42e7e849 100644 --- a/browser/base/content/test/general/browser_devedition.js +++ b/browser/base/content/test/general/browser_devedition.js @@ -1,8 +1,8 @@ /* * Testing changes for Developer Edition theme. * A special stylesheet should be added to the browser.xul document - * when browser.devedition.theme.enabled is set to true and no themes - * are applied. + * when the firefox-devedition@mozilla.org lightweight theme + * is applied. */ const PREF_LWTHEME_USED_THEMES = "lightweightThemes.usedThemes"; diff --git a/browser/base/content/test/general/browser_trackingUI_1.js b/browser/base/content/test/general/browser_trackingUI_1.js index 444cb9e79806..817e1e68b880 100644 --- a/browser/base/content/test/general/browser_trackingUI_1.js +++ b/browser/base/content/test/general/browser_trackingUI_1.js @@ -9,6 +9,7 @@ // * A page with tracking elements is loaded and they are not blocked. // See also Bugs 1175327, 1043801, 1178985 +const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; const PREF = "privacy.trackingprotection.enabled"; const PB_PREF = "privacy.trackingprotection.pbmode.enabled"; const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html"; @@ -16,8 +17,11 @@ const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/ let TrackingProtection = null; let browser = null; +let {UrlClassifierTestUtils} = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {}); + registerCleanupFunction(function() { TrackingProtection = browser = null; + UrlClassifierTestUtils.cleanupTestTrackers(); Services.prefs.clearUserPref(PREF); Services.prefs.clearUserPref(PB_PREF); while (gBrowser.tabs.length > 1) { @@ -108,7 +112,7 @@ function* testTrackingProtectionForTab(tab) { } add_task(function* testNormalBrowsing() { - yield updateTrackingProtectionDatabase(); + yield UrlClassifierTestUtils.addTestTrackers(); browser = gBrowser; let tab = browser.selectedTab = browser.addTab(); diff --git a/browser/base/content/test/general/browser_trackingUI_2.js b/browser/base/content/test/general/browser_trackingUI_2.js index 0524b8f0b32a..c8a30e16419e 100644 --- a/browser/base/content/test/general/browser_trackingUI_2.js +++ b/browser/base/content/test/general/browser_trackingUI_2.js @@ -6,6 +6,7 @@ // Control Center when the feature is off. // See also Bugs 1175327, 1043801, 1178985. +const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; const PREF = "privacy.trackingprotection.enabled"; const PB_PREF = "privacy.trackingprotection.pbmode.enabled"; const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/general/benignPage.html"; @@ -13,8 +14,11 @@ const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/ let TrackingProtection = null; let browser = null; +let {UrlClassifierTestUtils} = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {}); + registerCleanupFunction(function() { TrackingProtection = browser = null; + UrlClassifierTestUtils.cleanupTestTrackers(); Services.prefs.clearUserPref(PREF); Services.prefs.clearUserPref(PB_PREF); while (gBrowser.tabs.length > 1) { @@ -23,7 +27,7 @@ registerCleanupFunction(function() { }); add_task(function* testNormalBrowsing() { - yield updateTrackingProtectionDatabase(); + yield UrlClassifierTestUtils.addTestTrackers(); browser = gBrowser; let tab = browser.selectedTab = browser.addTab(); diff --git a/browser/base/content/test/general/browser_urlbar_search_healthreport.js b/browser/base/content/test/general/browser_urlbar_search_healthreport.js index 540e20c932d0..0d672c06216a 100644 --- a/browser/base/content/test/general/browser_urlbar_search_healthreport.js +++ b/browser/base/content/test/general/browser_urlbar_search_healthreport.js @@ -27,8 +27,10 @@ add_task(function* test_healthreport_search_recording() { let now = new Date(); let oldCount = 0; - // This will to be need changed if default search engine is not Yahoo. - let defaultEngineID = "yahoo"; + // This will to be need changed if default search engine is not Google. + // Note: geoSpecificDefaults are disabled for mochitests, so this is the + // non-US en-US default. + let defaultEngineID = "google"; let field = defaultEngineID + ".urlbar"; diff --git a/browser/base/content/test/general/head.js b/browser/base/content/test/general/head.js index 8dc1eba8c2e3..db2be4ddb754 100644 --- a/browser/base/content/test/general/head.js +++ b/browser/base/content/test/general/head.js @@ -660,55 +660,6 @@ function promiseIndicatorWindow() { return promiseWindow("chrome://browser/content/webrtcIndicator.xul"); } -/** - * Add some entries to a test tracking protection database, and reset - * back to the default database after the test ends. - */ -function updateTrackingProtectionDatabase() { - let TABLE = "urlclassifier.trackingTable"; - Services.prefs.setCharPref(TABLE, "test-track-simple"); - - registerCleanupFunction(function() { - Services.prefs.clearUserPref(TABLE); - }); - - // Add some URLs to the tracking database (to be blocked) - let testData = "tracking.example.com/"; - let testUpdate = - "n:1000\ni:test-track-simple\nad:1\n" + - "a:524:32:" + testData.length + "\n" + - testData; - - return new Promise((resolve, reject) => { - let dbService = Cc["@mozilla.org/url-classifier/dbservice;1"] - .getService(Ci.nsIUrlClassifierDBService); - let listener = { - QueryInterface: iid => { - if (iid.equals(Ci.nsISupports) || - iid.equals(Ci.nsIUrlClassifierUpdateObserver)) - return listener; - - throw Cr.NS_ERROR_NO_INTERFACE; - }, - updateUrlRequested: url => { }, - streamFinished: status => { }, - updateError: errorCode => { - ok(false, "Couldn't update classifier."); - resolve(); - }, - updateSuccess: requestedTimeout => { - resolve(); - } - }; - - dbService.beginUpdate(listener, "test-track-simple", ""); - dbService.beginStream("", ""); - dbService.updateStream(testUpdate); - dbService.finishStream(); - dbService.finishUpdate(); - }); -} - function assertWebRTCIndicatorStatus(expected) { let ui = Cu.import("resource:///modules/webrtcUI.jsm", {}).webrtcUI; let expectedState = expected ? "visible" : "hidden"; diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml index 8d80e872230b..be7463f4f093 100644 --- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -216,17 +216,16 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. if (!this._formattingEnabled || !this.editor) return; - // Always clear the strike-out selection first. let controller = this.editor.selectionController; let strikeOut = controller.getSelection(controller.SELECTION_URLSTRIKEOUT); strikeOut.removeAllRanges(); - if (this.focused) - return; - let selection = controller.getSelection(controller.SELECTION_URLSECONDARY); selection.removeAllRanges(); + if (this.focused) + return; + let textNode = this.editor.rootElement.firstChild; let value = textNode.textContent; @@ -286,17 +285,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. ]]> - - - - @@ -991,11 +980,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. event.stopPropagation(); ]]> - - { // Close the find bar in case it's open in the remaining tab diff --git a/browser/components/uitour/test/browser_UITour_pocket.js b/browser/components/uitour/test/browser_UITour_pocket.js index f3f0c3764ddc..93ecd6e48d44 100644 --- a/browser/components/uitour/test/browser_UITour_pocket.js +++ b/browser/components/uitour/test/browser_UITour_pocket.js @@ -8,8 +8,6 @@ let gContentAPI; let gContentWindow; let button; -Components.utils.import("resource:///modules/UITour.jsm"); - function test() { UITourTest(); } diff --git a/browser/components/uitour/test/browser_UITour_registerPageID.js b/browser/components/uitour/test/browser_UITour_registerPageID.js index 10d077ad148f..448078b48f1f 100644 --- a/browser/components/uitour/test/browser_UITour_registerPageID.js +++ b/browser/components/uitour/test/browser_UITour_registerPageID.js @@ -7,7 +7,6 @@ let gTestTab; let gContentAPI; let gContentWindow; -Components.utils.import("resource:///modules/UITour.jsm"); Components.utils.import("resource://gre/modules/UITelemetry.jsm"); Components.utils.import("resource:///modules/BrowserUITelemetry.jsm"); diff --git a/browser/components/uitour/test/browser_UITour_resetProfile.js b/browser/components/uitour/test/browser_UITour_resetProfile.js index a38655717455..b6e06f2c3c4d 100644 --- a/browser/components/uitour/test/browser_UITour_resetProfile.js +++ b/browser/components/uitour/test/browser_UITour_resetProfile.js @@ -7,8 +7,6 @@ let gTestTab; let gContentAPI; let gContentWindow; -Components.utils.import("resource:///modules/UITour.jsm"); - function test() { UITourTest(); } diff --git a/browser/components/uitour/test/browser_UITour_sync.js b/browser/components/uitour/test/browser_UITour_sync.js index 9d600ad0bf32..956223939a89 100644 --- a/browser/components/uitour/test/browser_UITour_sync.js +++ b/browser/components/uitour/test/browser_UITour_sync.js @@ -7,8 +7,6 @@ let gTestTab; let gContentAPI; let gContentWindow; -Components.utils.import("resource:///modules/UITour.jsm"); - function test() { registerCleanupFunction(function() { Services.prefs.clearUserPref("services.sync.username"); diff --git a/browser/components/uitour/test/browser_UITour_toggleReaderMode.js b/browser/components/uitour/test/browser_UITour_toggleReaderMode.js index f4c7109dd827..80bae9a70f23 100644 --- a/browser/components/uitour/test/browser_UITour_toggleReaderMode.js +++ b/browser/components/uitour/test/browser_UITour_toggleReaderMode.js @@ -4,8 +4,6 @@ let gTestTab; let gContentAPI; let gContentWindow; -Components.utils.import("resource:///modules/UITour.jsm"); - function test() { UITourTest(); } diff --git a/browser/components/uitour/test/browser_backgroundTab.js b/browser/components/uitour/test/browser_backgroundTab.js index 092d1386c2a7..5516cffc5879 100644 --- a/browser/components/uitour/test/browser_backgroundTab.js +++ b/browser/components/uitour/test/browser_backgroundTab.js @@ -4,8 +4,6 @@ let gTestTab; let gContentAPI; let gContentWindow; -Components.utils.import("resource:///modules/UITour.jsm"); - function test() { requestLongerTimeout(2); UITourTest(); diff --git a/browser/components/uitour/test/browser_openPreferences.js b/browser/components/uitour/test/browser_openPreferences.js index 72f093ad362f..d1de57ffbbd3 100644 --- a/browser/components/uitour/test/browser_openPreferences.js +++ b/browser/components/uitour/test/browser_openPreferences.js @@ -9,8 +9,6 @@ let gTestTab; let gContentAPI; let gContentWindow; -Cu.import("resource:///modules/UITour.jsm"); - function test() { UITourTest(); } diff --git a/browser/components/uitour/test/browser_openSearchPanel.js b/browser/components/uitour/test/browser_openSearchPanel.js index 1a7aa91f3471..433361b375e0 100644 --- a/browser/components/uitour/test/browser_openSearchPanel.js +++ b/browser/components/uitour/test/browser_openSearchPanel.js @@ -7,9 +7,6 @@ let gTestTab; let gContentAPI; let gContentWindow; -Components.utils.import("resource:///modules/UITour.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm"); - function test() { UITourTest(); } diff --git a/browser/components/uitour/test/head.js b/browser/components/uitour/test/head.js index c28eada3c96a..73e5e4c66b2a 100644 --- a/browser/components/uitour/test/head.js +++ b/browser/components/uitour/test/head.js @@ -204,8 +204,6 @@ function UITourTest() { waitForExplicitFinish(); registerCleanupFunction(function() { - delete window.UITour; - delete window.UITourMetricsProvider; delete window.gContentWindow; delete window.gContentAPI; if (gTestTab) diff --git a/browser/config/mozconfigs/linux32/debug b/browser/config/mozconfigs/linux32/debug index 97d6210b2369..a8f90546f308 100644 --- a/browser/config/mozconfigs/linux32/debug +++ b/browser/config/mozconfigs/linux32/debug @@ -11,7 +11,6 @@ MOZ_AUTOMATION_L10N_CHECK=0 export MOZILLA_OFFICIAL=1 #Use ccache -. "$topsrcdir/build/mozconfig.cache" # Treat warnings as errors in directories with FAIL_ON_WARNINGS. ac_add_options --enable-warnings-as-errors @@ -22,3 +21,4 @@ export MOZ_PACKAGE_JSSHELL=1 ac_add_options --with-branding=browser/branding/nightly . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/linux32/nightly b/browser/config/mozconfigs/linux32/nightly index 3fe67cbe2fc1..05ab10e63b3c 100644 --- a/browser/config/mozconfigs/linux32/nightly +++ b/browser/config/mozconfigs/linux32/nightly @@ -3,9 +3,6 @@ ac_add_options --enable-signmar ac_add_options --enable-profiling -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - # This will overwrite the default of stripping everything and keep the symbol table. # This is useful for profiling and debugging and only increases the package size # by 2 MBs. @@ -13,7 +10,5 @@ STRIP_FLAGS="--strip-debug" ac_add_options --with-branding=browser/branding/nightly -# Use ccache -. "$topsrcdir/build/mozconfig.cache" - . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/linux64/debug b/browser/config/mozconfigs/linux64/debug index 8f1f458ff219..ef5aa0dc5490 100644 --- a/browser/config/mozconfigs/linux64/debug +++ b/browser/config/mozconfigs/linux64/debug @@ -10,9 +10,6 @@ MOZ_AUTOMATION_L10N_CHECK=0 # Needed to enable breakpad in application.ini export MOZILLA_OFFICIAL=1 -# Use ccache -. "$topsrcdir/build/mozconfig.cache" - # Treat warnings as errors in directories with FAIL_ON_WARNINGS. ac_add_options --enable-warnings-as-errors @@ -22,3 +19,4 @@ export MOZ_PACKAGE_JSSHELL=1 ac_add_options --with-branding=browser/branding/nightly . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/linux64/nightly b/browser/config/mozconfigs/linux64/nightly index 6f7812f131c3..b6b9c998527e 100644 --- a/browser/config/mozconfigs/linux64/nightly +++ b/browser/config/mozconfigs/linux64/nightly @@ -3,9 +3,6 @@ ac_add_options --enable-signmar ac_add_options --enable-profiling -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - # This will overwrite the default of stripping everything and keep the symbol table. # This is useful for profiling and debugging and only increases the package size # by 2 MBs. @@ -13,7 +10,5 @@ STRIP_FLAGS="--strip-debug" ac_add_options --with-branding=browser/branding/nightly -# Use ccache -. "$topsrcdir/build/mozconfig.cache" - . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx-universal/beta b/browser/config/mozconfigs/macosx-universal/beta index cc2f44d0ef03..80c77b484d03 100644 --- a/browser/config/mozconfigs/macosx-universal/beta +++ b/browser/config/mozconfigs/macosx-universal/beta @@ -3,3 +3,4 @@ ac_add_options --enable-official-branding . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx-universal/l10n-mozconfig b/browser/config/mozconfigs/macosx-universal/l10n-mozconfig index dd400d2b64f7..a9ff62c8eed3 100644 --- a/browser/config/mozconfigs/macosx-universal/l10n-mozconfig +++ b/browser/config/mozconfigs/macosx-universal/l10n-mozconfig @@ -10,8 +10,7 @@ if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then ac_add_options --with-macbundlename-prefix=Firefox fi -. "$topsrcdir/build/mozconfig.cache" - export MOZILLA_OFFICIAL=1 . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx-universal/nightly b/browser/config/mozconfigs/macosx-universal/nightly index 33fdfa98dc56..19cf57cce917 100644 --- a/browser/config/mozconfigs/macosx-universal/nightly +++ b/browser/config/mozconfigs/macosx-universal/nightly @@ -6,9 +6,6 @@ ac_add_options --enable-profiling ac_add_options --enable-instruments ac_add_options --enable-dtrace -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then ac_add_options --with-macbundlename-prefix=Firefox fi @@ -16,3 +13,4 @@ fi ac_add_options --with-branding=browser/branding/nightly . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx-universal/release b/browser/config/mozconfigs/macosx-universal/release index ab8a4698c960..d5e493341ac6 100644 --- a/browser/config/mozconfigs/macosx-universal/release +++ b/browser/config/mozconfigs/macosx-universal/release @@ -9,3 +9,4 @@ ac_add_options --enable-official-branding export BUILDING_RELEASE=1 . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx64/debug b/browser/config/mozconfigs/macosx64/debug index 148c1909913c..bf387ff07555 100644 --- a/browser/config/mozconfigs/macosx64/debug +++ b/browser/config/mozconfigs/macosx64/debug @@ -21,3 +21,4 @@ export MOZ_PACKAGE_JSSHELL=1 ac_add_options --with-branding=browser/branding/nightly . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx64/debug-static-analysis b/browser/config/mozconfigs/macosx64/debug-static-analysis index d451e78c99a0..d55de9559084 100644 --- a/browser/config/mozconfigs/macosx64/debug-static-analysis +++ b/browser/config/mozconfigs/macosx64/debug-static-analysis @@ -13,3 +13,4 @@ ac_add_options --enable-warnings-as-errors ac_add_options --enable-clang-plugin . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx64/l10n-mozconfig b/browser/config/mozconfigs/macosx64/l10n-mozconfig index 7c15cb01997f..952ab3da3dcd 100644 --- a/browser/config/mozconfigs/macosx64/l10n-mozconfig +++ b/browser/config/mozconfigs/macosx64/l10n-mozconfig @@ -4,6 +4,6 @@ ac_add_options --with-l10n-base=../../l10n ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL} ac_add_options --enable-update-packaging ac_add_options --with-branding=browser/branding/nightly -. "$topsrcdir/build/mozconfig.cache" . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx64/nightly b/browser/config/mozconfigs/macosx64/nightly index 087a17d77402..ceb1ba33f229 100644 --- a/browser/config/mozconfigs/macosx64/nightly +++ b/browser/config/mozconfigs/macosx64/nightly @@ -19,3 +19,4 @@ export MOZ_PACKAGE_JSSHELL=1 ac_add_options --with-branding=browser/branding/nightly . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/whitelist b/browser/config/mozconfigs/whitelist index db3c5a1ce912..8e41fe6c5e0b 100644 --- a/browser/config/mozconfigs/whitelist +++ b/browser/config/mozconfigs/whitelist @@ -22,7 +22,6 @@ for platform in ['linux32', 'linux64', 'macosx-universal']: for platform in ['linux32', 'linux64', 'macosx-universal', 'win32', 'win64']: whitelist['nightly'][platform] += ['ac_add_options --enable-signmar'] - whitelist['nightly'][platform] += ['ac_add_options --enable-js-diagnostics'] whitelist['nightly']['linux32'] += [ 'CXX=$REAL_CXX', diff --git a/browser/config/mozconfigs/win32/debug b/browser/config/mozconfigs/win32/debug index 5eabdd8952a6..118cb5256c09 100644 --- a/browser/config/mozconfigs/win32/debug +++ b/browser/config/mozconfigs/win32/debug @@ -28,6 +28,5 @@ export MOZ_PACKAGE_JSSHELL=1 ac_add_options --with-branding=browser/branding/nightly -. "$topsrcdir/build/mozconfig.cache" - . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/win32/nightly b/browser/config/mozconfigs/win32/nightly index 398478980ff0..de440c2c7d5d 100644 --- a/browser/config/mozconfigs/win32/nightly +++ b/browser/config/mozconfigs/win32/nightly @@ -4,11 +4,7 @@ ac_add_options --enable-signmar ac_add_options --enable-profiling -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - ac_add_options --with-branding=browser/branding/nightly -. "$topsrcdir/build/mozconfig.cache" - . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/win64/debug b/browser/config/mozconfigs/win64/debug index 40905ae9c9e9..b22f1891011c 100644 --- a/browser/config/mozconfigs/win64/debug +++ b/browser/config/mozconfigs/win64/debug @@ -30,6 +30,5 @@ ac_add_options --with-branding=browser/branding/nightly . $topsrcdir/build/win64/mozconfig.vs2013 -. "$topsrcdir/build/mozconfig.cache" - . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/win64/nightly b/browser/config/mozconfigs/win64/nightly index 9464437b316c..76054cf5e7da 100644 --- a/browser/config/mozconfigs/win64/nightly +++ b/browser/config/mozconfigs/win64/nightly @@ -5,11 +5,7 @@ ac_add_options --enable-signmar ac_add_options --enable-profiling -# Nightlies only since this has a cost in performance -ac_add_options --enable-js-diagnostics - ac_add_options --with-branding=browser/branding/nightly -. "$topsrcdir/build/mozconfig.cache" - . "$topsrcdir/build/mozconfig.common.override" +. "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/tooltool-manifests/linux32/asan.manifest b/browser/config/tooltool-manifests/linux32/asan.manifest index 304afbc13451..87ce925a9bd7 100644 --- a/browser/config/tooltool-manifests/linux32/asan.manifest +++ b/browser/config/tooltool-manifests/linux32/asan.manifest @@ -3,15 +3,10 @@ "clang_version": "r185949" }, { -"size": 47, -"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 72573411, "digest": "491753968f34d1bd3c58280688349499a92f31a118eb6f28e86746be62615004370394b8e1b10d48dc3fba4bc6d4fbb4ce6c7dbc4fadb39447de9aa55573c58e", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/linux32/clang.manifest b/browser/config/tooltool-manifests/linux32/clang.manifest index 7685c443f074..6d75f637c117 100644 --- a/browser/config/tooltool-manifests/linux32/clang.manifest +++ b/browser/config/tooltool-manifests/linux32/clang.manifest @@ -3,15 +3,10 @@ "clang_version": "r183744" }, { -"size": 47, -"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 70206124, "digest": "a6b8046bd9485f9387dcb1c14b8d442822f02b1caa61b653e8b6cfd96906deadfb4b29809f2cd2b71f919b321d97dd2ebec6020c15f6d485f1641c0f710a762f", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true, } ] diff --git a/browser/config/tooltool-manifests/linux32/releng.manifest b/browser/config/tooltool-manifests/linux32/releng.manifest index a419d505fa0a..80c50dfaea99 100644 --- a/browser/config/tooltool-manifests/linux32/releng.manifest +++ b/browser/config/tooltool-manifests/linux32/releng.manifest @@ -1,20 +1,16 @@ [ { -"size": 82, -"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 80458572, "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad", "algorithm": "sha512", -"filename": "gcc.tar.xz" +"filename": "gcc.tar.xz", +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/linux64/asan.manifest b/browser/config/tooltool-manifests/linux64/asan.manifest index bf0aee6fe6d8..820177316a8a 100644 --- a/browser/config/tooltool-manifests/linux64/asan.manifest +++ b/browser/config/tooltool-manifests/linux64/asan.manifest @@ -3,15 +3,10 @@ "clang_version": "r200213" }, { -"size": 47, -"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 71282740, "digest": "ee9edb1ef3afd9ab29e39565145545ad57e8d8d2538be4d822d7dbd64038f4529b0b287cecf48bf83def52a26ac2c6faa331686c3ad5e8b4ba4c22686ee0808f", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/linux64/clang.manifest b/browser/config/tooltool-manifests/linux64/clang.manifest index 05bb628280e7..2bad4b994b96 100644 --- a/browser/config/tooltool-manifests/linux64/clang.manifest +++ b/browser/config/tooltool-manifests/linux64/clang.manifest @@ -3,15 +3,10 @@ "clang_version": "r183744" }, { -"size": 47, -"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 70350828, "digest": "6cd04e8ec44c6fef159349c22bd0476891e4a2d46479f9586283eaf3305e42f79c720d40dfec0e78d8899c1651189b12e285de60862ffd0612b0dac7a0c336c6", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/linux64/releng.manifest b/browser/config/tooltool-manifests/linux64/releng.manifest index a419d505fa0a..80c50dfaea99 100644 --- a/browser/config/tooltool-manifests/linux64/releng.manifest +++ b/browser/config/tooltool-manifests/linux64/releng.manifest @@ -1,20 +1,16 @@ [ { -"size": 82, -"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 80458572, "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad", "algorithm": "sha512", -"filename": "gcc.tar.xz" +"filename": "gcc.tar.xz", +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/macosx64/asan.manifest b/browser/config/tooltool-manifests/macosx64/asan.manifest index e675b7de9271..a9edd97de77b 100644 --- a/browser/config/tooltool-manifests/macosx64/asan.manifest +++ b/browser/config/tooltool-manifests/macosx64/asan.manifest @@ -3,15 +3,10 @@ "clang_version": "r200213" }, { -"size": 47, -"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 58997296, "digest": "9757d142142442c881b8d1eb31c2fe80e1979a858e6133473b5574a5a3b9cdaf9abed32b2e246b715c9f0eb0969103337918215fc491feae196219e8fb03f0b1", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/macosx64/clang.manifest b/browser/config/tooltool-manifests/macosx64/clang.manifest index c4e4a942cc53..aa1ef98af6c3 100644 --- a/browser/config/tooltool-manifests/macosx64/clang.manifest +++ b/browser/config/tooltool-manifests/macosx64/clang.manifest @@ -3,21 +3,17 @@ "clang_version": "r183744" }, { -"size": 88, -"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 59602619, "digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/macosx64/releng.manifest b/browser/config/tooltool-manifests/macosx64/releng.manifest index c4e4a942cc53..aa1ef98af6c3 100644 --- a/browser/config/tooltool-manifests/macosx64/releng.manifest +++ b/browser/config/tooltool-manifests/macosx64/releng.manifest @@ -3,21 +3,17 @@ "clang_version": "r183744" }, { -"size": 88, -"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 59602619, "digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b", "algorithm": "sha512", -"filename": "clang.tar.bz2" +"filename": "clang.tar.bz2", +"unpack": true }, { "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/win32/releng.manifest b/browser/config/tooltool-manifests/win32/releng.manifest index 726819f16785..6343fb6d8163 100644 --- a/browser/config/tooltool-manifests/win32/releng.manifest +++ b/browser/config/tooltool-manifests/win32/releng.manifest @@ -6,15 +6,10 @@ "filename": "mozmake.exe" }, { -"size": 176, -"digest": "2809058907ac5eefdc394113d2e4fe76ba559ac61c2eca2f88e7a12a74bdf44a15d9039fa8aa229f7362a14b67d67395063f68147ae098beac5dfcc78aff98da", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true } ] diff --git a/browser/config/tooltool-manifests/win64/releng.manifest b/browser/config/tooltool-manifests/win64/releng.manifest index 726819f16785..6343fb6d8163 100644 --- a/browser/config/tooltool-manifests/win64/releng.manifest +++ b/browser/config/tooltool-manifests/win64/releng.manifest @@ -6,15 +6,10 @@ "filename": "mozmake.exe" }, { -"size": 176, -"digest": "2809058907ac5eefdc394113d2e4fe76ba559ac61c2eca2f88e7a12a74bdf44a15d9039fa8aa229f7362a14b67d67395063f68147ae098beac5dfcc78aff98da", -"algorithm": "sha512", -"filename": "setup.sh" -}, -{ "size": 167175, "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831", "algorithm": "sha512", -"filename": "sccache.tar.bz2" +"filename": "sccache.tar.bz2", +"unpack": true } ] diff --git a/browser/devtools/debugger/debugger-controller.js b/browser/devtools/debugger/debugger-controller.js index 5010eb685941..0b055de5ffc8 100644 --- a/browser/devtools/debugger/debugger-controller.js +++ b/browser/devtools/debugger/debugger-controller.js @@ -1886,6 +1886,12 @@ EventListeners.prototype = { definitionSite = fetchedDefinitions.get(listener.function.actor); } else if (listener.function.class == "Function") { definitionSite = yield this._getDefinitionSite(listener.function); + if (!definitionSite) { + // We don't know where this listener comes from so don't show it in + // the UI as breaking on it doesn't work (bug 942899). + continue; + } + fetchedDefinitions.set(listener.function.actor, definitionSite); } listener.function.url = definitionSite; @@ -1926,8 +1932,10 @@ EventListeners.prototype = { // Don't make this error fatal, because it would break the entire events pane. const msg = "Error getting function definition site: " + aResponse.message; DevToolsUtils.reportException("_getDefinitionSite", msg); + deferred.resolve(null); + } else { + deferred.resolve(aResponse.source.url); } - deferred.resolve(aResponse.source.url); }); return deferred.promise; diff --git a/browser/devtools/debugger/test/browser.ini b/browser/devtools/debugger/test/browser.ini index 5313956de2ce..c05a4d28f519 100644 --- a/browser/devtools/debugger/test/browser.ini +++ b/browser/devtools/debugger/test/browser.ini @@ -235,6 +235,8 @@ skip-if = e10s && debug skip-if = e10s && debug [browser_dbg_event-listeners-03.js] skip-if = e10s && debug +[browser_dbg_event-listeners-04.js] +skip-if = debug || e10s # debug bug 1142597, e10s bug 1146603. [browser_dbg_file-reload.js] skip-if = e10s && debug [browser_dbg_function-display-name.js] @@ -351,7 +353,7 @@ skip-if = e10s && debug [browser_dbg_promises-allocation-stack.js] skip-if = e10s && debug [browser_dbg_promises-chrome-allocation-stack.js] -skip-if = e10s && debug +skip-if = (e10s || os == "linux") && debug [browser_dbg_reload-preferred-script-01.js] skip-if = e10s && debug [browser_dbg_reload-preferred-script-02.js] diff --git a/browser/devtools/debugger/test/browser_dbg_event-listeners-04.js b/browser/devtools/debugger/test/browser_dbg_event-listeners-04.js new file mode 100644 index 000000000000..ebc743c8143b --- /dev/null +++ b/browser/devtools/debugger/test/browser_dbg_event-listeners-04.js @@ -0,0 +1,43 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Test that event listeners are properly fetched even if one of the listeners + * don't have a Debugger.Source object (bug 942899). + * + * This test is skipped on debug and e10s builds for following reasons: + * - debug: requiring sdk/tabs causes memory leaks when new windows are opened + * in tests executed after this one. Bug 1142597. + * - e10s: tab.attach is not e10s safe and only works when add-on compatibility + * shims are in place. Bug 1146603. + */ + +const TAB_URL = EXAMPLE_URL + "doc_event-listeners-01.html"; + +add_task(function* () { + let tab = yield addTab(TAB_URL); + + // Create a sandboxed content script the Add-on SDK way. Inspired by bug + // 1145996. + let tabs = require('sdk/tabs'); + let sdkTab = [...tabs].find(tab => tab.url === TAB_URL); + ok(sdkTab, "Add-on SDK found the loaded tab."); + + info("Attaching an event handler via add-on sdk content scripts."); + let worker = sdkTab.attach({ + contentScript: "document.body.addEventListener('click', e => alert(e))", + onError: ok.bind(this, false) + }); + + let [,, panel, win] = yield initDebugger(tab); + let gDebugger = panel.panelWin; + let fetched = waitForDebuggerEvents(panel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED); + + info("Scheduling event listener fetch."); + gDebugger.DebuggerController.Breakpoints.DOM.scheduleEventListenersFetch(); + + info("Waiting for updated event listeners to arrive."); + yield fetched; + + ok(true, "The listener update did not hang."); +}); diff --git a/browser/devtools/shared/test/browser.ini b/browser/devtools/shared/test/browser.ini index 8efd5108a52a..946455df820c 100644 --- a/browser/devtools/shared/test/browser.ini +++ b/browser/devtools/shared/test/browser.ini @@ -34,6 +34,9 @@ support-files = [browser_filter-editor-08.js] [browser_filter-editor-09.js] [browser_filter-editor-10.js] +[browser_filter-presets-01.js] +[browser_filter-presets-02.js] +[browser_filter-presets-03.js] [browser_flame-graph-01.js] [browser_flame-graph-02.js] [browser_flame-graph-03a.js] diff --git a/browser/devtools/shared/test/browser_filter-editor-02.js b/browser/devtools/shared/test/browser_filter-editor-02.js index a673d78e0519..7a814e2f308b 100644 --- a/browser/devtools/shared/test/browser_filter-editor-02.js +++ b/browser/devtools/shared/test/browser_filter-editor-02.js @@ -68,7 +68,7 @@ add_task(function*() { widget.setCssValue(cssValue); if (cssValue === "none") { - const text = container.querySelector(".filters").textContent; + const text = container.querySelector("#filters").textContent; ok(text.indexOf(L10N.getStr("emptyFilterList")) > -1, "Contains |emptyFilterList| string when given value 'none'"); ok(text.indexOf(L10N.getStr("addUsingList")) > -1, diff --git a/browser/devtools/shared/test/browser_filter-editor-04.js b/browser/devtools/shared/test/browser_filter-editor-04.js index e048d155019e..832a9bdde8cc 100644 --- a/browser/devtools/shared/test/browser_filter-editor-04.js +++ b/browser/devtools/shared/test/browser_filter-editor-04.js @@ -17,7 +17,7 @@ add_task(function*() { const initialValue = "blur(2px) contrast(200%) brightness(200%)"; let widget = new CSSFilterEditorWidget(container, initialValue); - const filters = widget.el.querySelector(".filters"); + const filters = widget.el.querySelector("#filters"); function first() { return filters.children[0]; } @@ -28,6 +28,7 @@ add_task(function*() { return filters.children[2]; } + info("Test re-ordering neighbour filters"); widget._mouseDown({ target: first().querySelector("i"), @@ -67,7 +68,7 @@ add_task(function*() { pageY: 0 }); widget._mouseMove({ pageY: -LIST_ITEM_HEIGHT * 5 }); - ok(first().offsetTop >= boundaries.top, + ok(first().getBoundingClientRect().top >= boundaries.top, "First filter should not move outside filter list"); widget._mouseUp(); @@ -78,7 +79,7 @@ add_task(function*() { pageY: 0 }); widget._mouseMove({ pageY: -LIST_ITEM_HEIGHT * 5 }); - ok(last().offsetTop <= boundaries.bottom, + ok(last().getBoundingClientRect().bottom <= boundaries.bottom, "Last filter should not move outside filter list"); widget._mouseUp(); diff --git a/browser/devtools/shared/test/browser_filter-editor-05.js b/browser/devtools/shared/test/browser_filter-editor-05.js index b6423f871914..5d5101ec78bd 100644 --- a/browser/devtools/shared/test/browser_filter-editor-05.js +++ b/browser/devtools/shared/test/browser_filter-editor-05.js @@ -22,7 +22,7 @@ add_task(function*() { const container = doc.querySelector("#container"); let widget = new CSSFilterEditorWidget(container, "grayscale(0%) url(test.svg)"); - const filters = widget.el.querySelector(".filters"); + const filters = widget.el.querySelector("#filters"); const grayscale = filters.children[0], url = filters.children[1]; diff --git a/browser/devtools/shared/test/browser_filter-editor-06.js b/browser/devtools/shared/test/browser_filter-editor-06.js index e12b7f7350dc..89ee6def7b5d 100644 --- a/browser/devtools/shared/test/browser_filter-editor-06.js +++ b/browser/devtools/shared/test/browser_filter-editor-06.js @@ -22,7 +22,7 @@ add_task(function*() { let widget = new CSSFilterEditorWidget(container, "none"); const select = widget.el.querySelector("select"), - add = widget.el.querySelector("button"); + add = widget.el.querySelector("#add-filter"); const TEST_DATA = [ { @@ -62,7 +62,8 @@ add_task(function*() { is(widget.getValueAt(index), `0${filter.unit}`, `Should add ${filter.unit} to ${filter.type} filters`); } else if (filter.placeholder) { - const input = widget.el.querySelector(`.filter:nth-child(${index + 1}) input`); + let i = index + 1; + const input = widget.el.querySelector(`.filter:nth-child(${i}) input`); is(input.placeholder, filter.placeholder, "Should set the appropriate placeholder for string-type filters"); } diff --git a/browser/devtools/shared/test/browser_filter-editor-08.js b/browser/devtools/shared/test/browser_filter-editor-08.js index f041419a9f7c..724655116fe7 100644 --- a/browser/devtools/shared/test/browser_filter-editor-08.js +++ b/browser/devtools/shared/test/browser_filter-editor-08.js @@ -70,7 +70,7 @@ add_task(function*() { // Triggers the specified keyCode and modifier key on // first filter's input function triggerKey(key, modifier) { - const filter = this.el.querySelector(".filters").children[0]; + const filter = this.el.querySelector("#filters").children[0]; const input = filter.querySelector("input"); this._keyDown({ diff --git a/browser/devtools/shared/test/browser_filter-editor-09.js b/browser/devtools/shared/test/browser_filter-editor-09.js index f3d6b7c01ffe..d2ef931dcf21 100644 --- a/browser/devtools/shared/test/browser_filter-editor-09.js +++ b/browser/devtools/shared/test/browser_filter-editor-09.js @@ -20,7 +20,7 @@ add_task(function*() { const container = doc.querySelector("#container"); const initialValue = "drop-shadow(rgb(0, 0, 0) 1px 1px 0px)"; let widget = new CSSFilterEditorWidget(container, initialValue); - widget.el.querySelector("input").setSelectionRange(13, 13); + widget.el.querySelector("#filters input").setSelectionRange(13, 13); let value = 1; @@ -102,7 +102,7 @@ add_task(function*() { // Triggers the specified keyCode and modifier key on // first filter's input function triggerKey(key, modifier) { - const filter = this.el.querySelector(".filters").children[0]; + const filter = this.el.querySelector("#filters").children[0]; const input = filter.querySelector("input"); this._keyDown({ diff --git a/browser/devtools/shared/test/browser_filter-editor-10.js b/browser/devtools/shared/test/browser_filter-editor-10.js index 2965ceea8304..c445b9532aa3 100644 --- a/browser/devtools/shared/test/browser_filter-editor-10.js +++ b/browser/devtools/shared/test/browser_filter-editor-10.js @@ -20,7 +20,7 @@ add_task(function*() { const container = doc.querySelector("#container"); const initialValue = "drop-shadow(rgb(0, 0, 0) 10px 1px 0px)"; let widget = new CSSFilterEditorWidget(container, initialValue); - const input = widget.el.querySelector("input"); + const input = widget.el.querySelector("#filters input"); let value = 10; @@ -66,7 +66,7 @@ add_task(function*() { // Triggers the specified keyCode and modifier key on // first filter's input function triggerKey(key, modifier) { - const filter = this.el.querySelector(".filters").children[0]; + const filter = this.el.querySelector("#filters").children[0]; const input = filter.querySelector("input"); this._keyDown({ diff --git a/browser/devtools/shared/test/browser_filter-presets-01.js b/browser/devtools/shared/test/browser_filter-presets-01.js new file mode 100644 index 000000000000..ccb253eded44 --- /dev/null +++ b/browser/devtools/shared/test/browser_filter-presets-01.js @@ -0,0 +1,98 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Tests saving presets + +const TEST_URI = "chrome://browser/content/devtools/filter-frame.xhtml"; +const {CSSFilterEditorWidget} = require("devtools/shared/widgets/FilterWidget"); + +add_task(function* () { + yield promiseTab("about:blank"); + + let [host, win, doc] = yield createHost("bottom", TEST_URI); + + const container = doc.querySelector("#container"); + let widget = new CSSFilterEditorWidget(container, "none"); + // First render + yield widget.once("render"); + + const VALUE = "blur(2px) contrast(150%)"; + const NAME = "Test"; + + yield showFilterPopupPresetsAndCreatePreset(widget, NAME, VALUE); + + let preset = widget.el.querySelector(".preset"); + is(preset.querySelector("label").textContent, NAME, + "Should show preset name correctly"); + is(preset.querySelector("span").textContent, VALUE, + "Should show preset value preview correctly"); + + let list = yield widget.getPresets(); + let input = widget.el.querySelector(".presets-list .footer input"); + let data = list[0]; + + is(data.name, NAME, + "Should add the preset to asyncStorage - name property"); + is(data.value, VALUE, + "Should add the preset to asyncStorage - name property"); + + info("Test overriding preset by using the same name"); + + const VALUE_2 = "saturate(50%) brightness(10%)"; + + widget.setCssValue(VALUE_2); + + yield savePreset(widget); + + is(widget.el.querySelectorAll(".preset").length, 1, + "Should override the preset with the same name - render"); + + list = yield widget.getPresets(); + data = list[0]; + + is(list.length, 1, + "Should override the preset with the same name - asyncStorage"); + + is(data.name, NAME, + "Should override the preset with the same name - prop name"); + is(data.value, VALUE_2, + "Should override the preset with the same name - prop value"); + + yield widget.setPresets([]); + + info("Test saving a preset without name"); + input.value = ""; + + yield savePreset(widget, "preset-save-error"); + + list = yield widget.getPresets(); + is(list.length, 0, + "Should not add a preset without name"); + + info("Test saving a preset without filters"); + + input.value = NAME; + widget.setCssValue("none"); + + yield savePreset(widget, "preset-save-error"); + + list = yield widget.getPresets(); + is(list.length, 0, + "Should not add a preset without filters (value: none)"); +}); + +/** + * Call savePreset on widget and wait for the specified event to emit + * @param {CSSFilterWidget} widget + * @param {string} expectEvent="render" The event to listen on + * @return {Promise} + */ +function savePreset(widget, expectEvent = "render") { + let onEvent = widget.once(expectEvent); + widget._savePreset({ + preventDefault: () => {}, + }); + return onEvent; +} diff --git a/browser/devtools/shared/test/browser_filter-presets-02.js b/browser/devtools/shared/test/browser_filter-presets-02.js new file mode 100644 index 000000000000..df2c46cf0bd8 --- /dev/null +++ b/browser/devtools/shared/test/browser_filter-presets-02.js @@ -0,0 +1,44 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Tests loading presets + +const TEST_URI = "chrome://browser/content/devtools/filter-frame.xhtml"; +const {CSSFilterEditorWidget} = require("devtools/shared/widgets/FilterWidget"); + +add_task(function* () { + yield promiseTab("about:blank"); + + let [host, win, doc] = yield createHost("bottom", TEST_URI); + + const container = doc.querySelector("#container"); + let widget = new CSSFilterEditorWidget(container, "none"); + // First render + yield widget.once("render"); + + const VALUE = "blur(2px) contrast(150%)"; + const NAME = "Test"; + + yield showFilterPopupPresetsAndCreatePreset(widget, NAME, VALUE); + + let onRender = widget.once("render"); + // reset value + widget.setCssValue("saturate(100%) brightness(150%)"); + yield onRender; + + let preset = widget.el.querySelector(".preset"); + + onRender = widget.once("render"); + widget._presetClick({ + target: preset + }); + + yield onRender; + + is(widget.getCssValue(), VALUE, + "Should set widget's value correctly"); + is(widget.el.querySelector(".presets-list .footer input").value, NAME, + "Should set input's value to name"); +}); diff --git a/browser/devtools/shared/test/browser_filter-presets-03.js b/browser/devtools/shared/test/browser_filter-presets-03.js new file mode 100644 index 000000000000..01ccf4439fb2 --- /dev/null +++ b/browser/devtools/shared/test/browser_filter-presets-03.js @@ -0,0 +1,39 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Tests deleting presets + +const TEST_URI = "chrome://browser/content/devtools/filter-frame.xhtml"; +const {CSSFilterEditorWidget} = require("devtools/shared/widgets/FilterWidget"); + +add_task(function* () { + yield promiseTab("about:blank"); + + let [host, win, doc] = yield createHost("bottom", TEST_URI); + + const container = doc.querySelector("#container"); + let widget = new CSSFilterEditorWidget(container, "none"); + // First render + yield widget.once("render"); + + const NAME = "Test"; + const VALUE = "blur(2px) contrast(150%)"; + + yield showFilterPopupPresetsAndCreatePreset(widget, NAME, VALUE); + + let removeButton = widget.el.querySelector(".preset .remove-button"); + let onRender = widget.once("render"); + widget._presetClick({ + target: removeButton + }); + + yield onRender; + is(widget.el.querySelector(".preset"), null, + "Should re-render after removing preset"); + + let list = yield widget.getPresets(); + is(list.length, 0, + "Should remove presets from asyncStorage"); +}); diff --git a/browser/devtools/shared/test/head.js b/browser/devtools/shared/test/head.js index 9fb9dccfe636..6f846b0aa111 100644 --- a/browser/devtools/shared/test/head.js +++ b/browser/devtools/shared/test/head.js @@ -283,3 +283,39 @@ function waitUntil(predicate, interval = 10) { }, interval); }); } + +/** + * Show the presets list sidebar in the cssfilter widget popup + * @param {CSSFilterWidget} widget + * @return {Promise} + */ +function showFilterPopupPresets(widget) { + let onRender = widget.once("render"); + widget._togglePresets(); + return onRender; +} + +/** + * Show presets list and create a sample preset with the name and value provided + * @param {CSSFilterWidget} widget + * @param {string} name + * @param {string} value + * @return {Promise} + */ +let showFilterPopupPresetsAndCreatePreset = Task.async(function*(widget, name, value) { + yield showFilterPopupPresets(widget); + + let onRender = widget.once("render"); + widget.setCssValue(value); + yield onRender; + + let footer = widget.el.querySelector(".presets-list .footer"); + footer.querySelector("input").value = name; + + onRender = widget.once("render"); + widget._savePreset({ + preventDefault: () => {} + }); + + yield onRender; +}); diff --git a/browser/devtools/shared/widgets/FilterWidget.js b/browser/devtools/shared/widgets/FilterWidget.js index 2174004f77af..8e024f1ba834 100644 --- a/browser/devtools/shared/widgets/FilterWidget.js +++ b/browser/devtools/shared/widgets/FilterWidget.js @@ -16,6 +16,9 @@ const STRINGS_URI = "chrome://browser/locale/devtools/filterwidget.properties"; const L10N = new ViewHelpers.L10N(STRINGS_URI); const {cssTokenizer} = require("devtools/sourceeditor/css-tokenizer"); +loader.lazyGetter(this, "asyncStorage", + () => require("devtools/toolkit/shared/async-storage")); + const DEFAULT_FILTER_TYPE = "length"; const UNIT_MAPPING = { percentage: "%", @@ -116,31 +119,54 @@ function CSSFilterEditorWidget(el, value = "") { this._mouseDown = this._mouseDown.bind(this); this._keyDown = this._keyDown.bind(this); this._input = this._input.bind(this); + this._presetClick = this._presetClick.bind(this); + this._savePreset = this._savePreset.bind(this); + this._togglePresets = this._togglePresets.bind(this); + + // Passed to asyncStorage, requires binding + this.renderPresets = this.renderPresets.bind(this); this._initMarkup(); this._buildFilterItemMarkup(); + this._buildPresetItemMarkup(); this._addEventListeners(); EventEmitter.decorate(this); this.filters = []; this.setCssValue(value); + this.renderPresets(); } exports.CSSFilterEditorWidget = CSSFilterEditorWidget; CSSFilterEditorWidget.prototype = { _initMarkup: function() { - const list = this.el.querySelector(".filters"); - this.el.appendChild(list); - this.el.insertBefore(list, this.el.firstChild); - this.container = this.el; - this.list = list; - + this.filtersList = this.el.querySelector("#filters"); + this.presetsList = this.el.querySelector("#presets"); + this.togglePresets = this.el.querySelector("#toggle-presets"); this.filterSelect = this.el.querySelector("select"); + this.addPresetButton = this.el.querySelector(".presets-list .add"); + this.addPresetInput = this.el.querySelector(".presets-list .footer input"); + + this.el.querySelector(".presets-list input").value = ""; + this._populateFilterSelect(); }, + _destroyMarkup: function() { + this._filterItemMarkup.remove(); + this.el.remove(); + this.el = this.filtersList = this._filterItemMarkup = null; + this.presetsList = this.togglePresets = this.filterSelect = null; + this.addPresetButton = null; + }, + + destroy: function() { + this._removeEventListeners(); + this._destroyMarkup(); + }, + /** * Creates