From 03def5b20708022ea1626705c096c36c04adf317 Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Fri, 3 Jun 2016 12:26:28 +0200 Subject: [PATCH] Bug 1277524 - Add a WebExtension test that moz-extension is considered a trustworthy origin. r=kmag MozReview-Commit-ID: 1LLNWwIU90 --HG-- extra : rebase_source : 759718dea882e10ce1307fca1b9d415c8f10c067 extra : histedit_source : 1f8fd6a084d0314e5a264b73164bcf2d35127c6b --- .../extensions/test/mochitest/chrome.ini | 2 + .../extensions/test/mochitest/chrome_head.js | 12 +++++ ...st_chrome_ext_background_debug_global.html | 4 +- .../test_chrome_ext_background_page.html | 4 +- ...ontentscript_unrecognizedprop_warning.html | 1 + .../test_chrome_ext_downloads_download.html | 7 +-- .../test_chrome_ext_downloads_misc.html | 7 +-- .../test_chrome_ext_downloads_search.html | 7 +-- .../test_chrome_ext_eventpage_warning.html | 1 + .../test_chrome_ext_native_messaging.html | 4 +- .../test_chrome_ext_trustworthy_origin.html | 54 +++++++++++++++++++ ...hrome_ext_webnavigation_resolved_urls.html | 1 + .../test_chrome_native_messaging_paths.html | 4 +- .../mochitest/test_ext_cookies_expiry.html | 1 + .../test_ext_cookies_permissions.html | 1 + .../test/mochitest/test_ext_jsversion.html | 1 + .../test/mochitest/test_ext_schema.html | 1 + 17 files changed, 82 insertions(+), 30 deletions(-) create mode 100644 toolkit/components/extensions/test/mochitest/chrome_head.js create mode 100644 toolkit/components/extensions/test/mochitest/test_chrome_ext_trustworthy_origin.html diff --git a/toolkit/components/extensions/test/mochitest/chrome.ini b/toolkit/components/extensions/test/mochitest/chrome.ini index 7e23f8bf80fe..ebf79801605a 100644 --- a/toolkit/components/extensions/test/mochitest/chrome.ini +++ b/toolkit/components/extensions/test/mochitest/chrome.ini @@ -1,5 +1,6 @@ [DEFAULT] support-files = + chrome_head.js head.js file_download.html file_download.txt @@ -18,6 +19,7 @@ skip-if = (toolkit == 'android') # android doesn't have devtools skip-if = os == "android" # native messaging is not supported on android [test_chrome_ext_contentscript_unrecognizedprop_warning.html] skip-if = (os == 'android') # browser.tabs is undefined. Bug 1258975 on android. +[test_chrome_ext_trustworthy_origin.html] [test_chrome_ext_webnavigation_resolved_urls.html] skip-if = (os == 'android') # browser.tabs is undefined. Bug 1258975 on android. [test_chrome_native_messaging_paths.html] diff --git a/toolkit/components/extensions/test/mochitest/chrome_head.js b/toolkit/components/extensions/test/mochitest/chrome_head.js new file mode 100644 index 000000000000..da2f53a02b52 --- /dev/null +++ b/toolkit/components/extensions/test/mochitest/chrome_head.js @@ -0,0 +1,12 @@ +"use strict"; + +const { + classes: Cc, + interfaces: Ci, + utils: Cu, + results: Cr, +} = Components; + +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/NetUtil.jsm"); + diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_background_debug_global.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_background_debug_global.html index 06d3a71d65d4..3203a6e4730e 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_background_debug_global.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_background_debug_global.html @@ -5,6 +5,7 @@ + @@ -12,9 +13,6 @@ + @@ -13,9 +14,6 @@ + diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_download.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_download.html index c3e79f817017..bf728b6e874d 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_download.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_download.html @@ -5,6 +5,7 @@ + @@ -13,18 +14,12 @@ + @@ -13,12 +14,6 @@ + @@ -13,12 +14,6 @@ + diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_native_messaging.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_native_messaging.html index 7ed450f45bcd..445b60161990 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_native_messaging.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_native_messaging.html @@ -5,6 +5,7 @@ + @@ -15,12 +16,9 @@ /* globals OS */ -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - Cu.import("resource://gre/modules/AppConstants.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/osfile.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); let {Subprocess, SubprocessImpl} = Cu.import("resource://gre/modules/Subprocess.jsm"); Components.utils.import("resource://gre/modules/Task.jsm"); diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_trustworthy_origin.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_trustworthy_origin.html new file mode 100644 index 000000000000..46c4bc8eee84 --- /dev/null +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_trustworthy_origin.html @@ -0,0 +1,54 @@ + + + + WebExtension test + + + + + + + + + + + + + diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html index d545ffb3c9a3..9e8a716c896e 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html @@ -5,6 +5,7 @@ + diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_native_messaging_paths.html b/toolkit/components/extensions/test/mochitest/test_chrome_native_messaging_paths.html index e0b991d444dd..29a148063eff 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_native_messaging_paths.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_native_messaging_paths.html @@ -5,6 +5,7 @@ + @@ -13,13 +14,10 @@ + diff --git a/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html b/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html index ef49688358fd..b6f48667c786 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html @@ -5,6 +5,7 @@ + diff --git a/toolkit/components/extensions/test/mochitest/test_ext_jsversion.html b/toolkit/components/extensions/test/mochitest/test_ext_jsversion.html index 10d65724d1c3..fbcdb3ac69ca 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_jsversion.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_jsversion.html @@ -6,6 +6,7 @@ + diff --git a/toolkit/components/extensions/test/mochitest/test_ext_schema.html b/toolkit/components/extensions/test/mochitest/test_ext_schema.html index 9c724b98fab1..189e069c593d 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_schema.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_schema.html @@ -5,6 +5,7 @@ +