forked from mirrors/gecko-dev
		
	Bug 1508823 - Enable ESLint for dom/browser-element (manual changes). r=mccr8
Depends on D21215 Differential Revision: https://phabricator.services.mozilla.com/D14130 --HG-- extra : moz-landing-system : lando
This commit is contained in:
		
							parent
							
								
									e29933c06a
								
							
						
					
					
						commit
						e15a06b5ac
					
				
					 66 changed files with 207 additions and 102 deletions
				
			
		|  | @ -167,7 +167,6 @@ dom/base/test/unit/test_serializers_entities*.js | ||||||
| dom/base/test/unit_ipc/** | dom/base/test/unit_ipc/** | ||||||
| dom/base/test/jsmodules/** | dom/base/test/jsmodules/** | ||||||
| dom/bindings/** | dom/bindings/** | ||||||
| dom/browser-element/** |  | ||||||
| dom/canvas/** | dom/canvas/** | ||||||
| dom/encoding/** | dom/encoding/** | ||||||
| dom/events/** | dom/events/** | ||||||
|  |  | ||||||
|  | @ -2,6 +2,9 @@ | ||||||
|  * License, v. 2.0. If a copy of the MPL was not distributed with this file, |  * 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/. */
 |  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 | ||||||
| 
 | 
 | ||||||
|  | /* eslint-env mozilla/frame-script */ | ||||||
|  | /* global api, CopyPasteAssistent */ | ||||||
|  | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
| var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); | var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* eslint-env mozilla/frame-script */ | ||||||
|  | 
 | ||||||
| function debug(msg) { | function debug(msg) { | ||||||
|   // dump("BrowserElementChildPreload - " + msg + "\n");
 |   // dump("BrowserElementChildPreload - " + msg + "\n");
 | ||||||
| } | } | ||||||
|  | @ -40,7 +42,7 @@ function sendSyncMsg(msg, data) { | ||||||
|   // Ensure that we don't send any messages before BrowserElementChild.js
 |   // Ensure that we don't send any messages before BrowserElementChild.js
 | ||||||
|   // finishes loading.
 |   // finishes loading.
 | ||||||
|   if (!BrowserElementIsReady) { |   if (!BrowserElementIsReady) { | ||||||
|     return; |     return undefined; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (!data) { |   if (!data) { | ||||||
|  | @ -160,10 +162,8 @@ BrowserElementChild.prototype = { | ||||||
| 
 | 
 | ||||||
|     addMessageListener("browser-element-api:call", this); |     addMessageListener("browser-element-api:call", this); | ||||||
| 
 | 
 | ||||||
|     let els = Cc["@mozilla.org/eventlistenerservice;1"] |  | ||||||
|                 .getService(Ci.nsIEventListenerService); |  | ||||||
|     LISTENED_SYSTEM_EVENTS.forEach(event => { |     LISTENED_SYSTEM_EVENTS.forEach(event => { | ||||||
|       els.addSystemEventListener(global, event.type, this, event.useCapture); |       Services.els.addSystemEventListener(global, event.type, this, event.useCapture); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     OBSERVED_EVENTS.forEach((aTopic) => { |     OBSERVED_EVENTS.forEach((aTopic) => { | ||||||
|  | @ -192,10 +192,8 @@ BrowserElementChild.prototype = { | ||||||
| 
 | 
 | ||||||
|     removeMessageListener("browser-element-api:call", this); |     removeMessageListener("browser-element-api:call", this); | ||||||
| 
 | 
 | ||||||
|     let els = Cc["@mozilla.org/eventlistenerservice;1"] |  | ||||||
|                 .getService(Ci.nsIEventListenerService); |  | ||||||
|     LISTENED_SYSTEM_EVENTS.forEach(event => { |     LISTENED_SYSTEM_EVENTS.forEach(event => { | ||||||
|       els.removeSystemEventListener(global, event.type, this, event.useCapture); |       Services.els.removeSystemEventListener(global, event.type, this, event.useCapture); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     OBSERVED_EVENTS.forEach((aTopic) => { |     OBSERVED_EVENTS.forEach((aTopic) => { | ||||||
|  | @ -281,6 +279,7 @@ BrowserElementChild.prototype = { | ||||||
|     if (message.data.msg_name in mmCalls) { |     if (message.data.msg_name in mmCalls) { | ||||||
|       return mmCalls[message.data.msg_name].apply(self, arguments); |       return mmCalls[message.data.msg_name].apply(self, arguments); | ||||||
|     } |     } | ||||||
|  |     return undefined; | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   _paintFrozenTimer: null, |   _paintFrozenTimer: null, | ||||||
|  | @ -363,6 +362,7 @@ BrowserElementChild.prototype = { | ||||||
|         args.promptType == "custom-prompt") { |         args.promptType == "custom-prompt") { | ||||||
|       return returnValue; |       return returnValue; | ||||||
|     } |     } | ||||||
|  |     return undefined; | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|  | @ -379,7 +379,7 @@ BrowserElementChild.prototype = { | ||||||
|       // I have no idea what waiting for a result means when there's no inner
 |       // I have no idea what waiting for a result means when there's no inner
 | ||||||
|       // window, so let's just bail.
 |       // window, so let's just bail.
 | ||||||
|       debug("_waitForResult: No inner window. Bailing."); |       debug("_waitForResult: No inner window. Bailing."); | ||||||
|       return; |       return undefined; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     this._windowIDDict[outerWindowID] = Cu.getWeakReference(win); |     this._windowIDDict[outerWindowID] = Cu.getWeakReference(win); | ||||||
|  | @ -902,7 +902,7 @@ BrowserElementChild.prototype = { | ||||||
|     if (menu) { |     if (menu) { | ||||||
|       this._maybeCopyAttribute(menu, menuObj, "label"); |       this._maybeCopyAttribute(menu, menuObj, "label"); | ||||||
| 
 | 
 | ||||||
|       for (var i = 0, child; child = menu.children[i++];) { |       for (var i = 0, child; (child = menu.children[i++]);) { | ||||||
|         if (child.nodeName === "MENU") { |         if (child.nodeName === "MENU") { | ||||||
|           menuObj.items.push(this._buildMenuObj(child, idPrefix + i + "_", false)); |           menuObj.items.push(this._buildMenuObj(child, idPrefix + i + "_", false)); | ||||||
|         } else if (child.nodeName === "MENUITEM") { |         } else if (child.nodeName === "MENUITEM") { | ||||||
|  | @ -1026,8 +1026,7 @@ BrowserElementChild.prototype = { | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       // Remove password from uri.
 |       // Remove password from uri.
 | ||||||
|       location = Cc["@mozilla.org/docshell/urifixup;1"] |       location = Services.uriFixup.createExposableURI(location); | ||||||
|         .getService(Ci.nsIURIFixup).createExposableURI(location); |  | ||||||
| 
 | 
 | ||||||
|       var webNav = docShell.QueryInterface(Ci.nsIWebNavigation); |       var webNav = docShell.QueryInterface(Ci.nsIWebNavigation); | ||||||
| 
 | 
 | ||||||
|  | @ -1036,6 +1035,7 @@ BrowserElementChild.prototype = { | ||||||
|                                        canGoForward: webNav.canGoForward }); |                                        canGoForward: webNav.canGoForward }); | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
|  |     // eslint-disable-next-line complexity
 | ||||||
|     onStateChange(webProgress, request, stateFlags, status) { |     onStateChange(webProgress, request, stateFlags, status) { | ||||||
|       if (webProgress != docShell) { |       if (webProgress != docShell) { | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|  | @ -6,6 +6,14 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* | ||||||
|  | global addMessageListener | ||||||
|  | global removeMessageListener | ||||||
|  | global docShell | ||||||
|  | global content | ||||||
|  | global sendAsyncMsg | ||||||
|  | */ | ||||||
|  | 
 | ||||||
| function debug(msg) { | function debug(msg) { | ||||||
|   // dump("BrowserElementCopyPaste - " + msg + "\n");
 |   // dump("BrowserElementCopyPaste - " + msg + "\n");
 | ||||||
| } | } | ||||||
|  | @ -71,7 +79,7 @@ var CopyPasteAssistent = { | ||||||
|     e.stopPropagation(); |     e.stopPropagation(); | ||||||
| 
 | 
 | ||||||
|     let boundingClientRect = e.boundingClientRect; |     let boundingClientRect = e.boundingClientRect; | ||||||
|     let canPaste = this._isCommandEnabled("paste"); |     this._isCommandEnabled("paste"); | ||||||
|     let zoomFactor = content.innerWidth == 0 ? 1 : content.screen.width / content.innerWidth; |     let zoomFactor = content.innerWidth == 0 ? 1 : content.screen.width / content.innerWidth; | ||||||
| 
 | 
 | ||||||
|     let detail = { |     let detail = { | ||||||
|  |  | ||||||
|  | @ -16,14 +16,6 @@ function debug(msg) { | ||||||
|   // dump("BrowserElementParent - " + msg + "\n");
 |   // dump("BrowserElementParent - " + msg + "\n");
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function getIntPref(prefName, def) { |  | ||||||
|   try { |  | ||||||
|     return Services.prefs.getIntPref(prefName); |  | ||||||
|   } catch (err) { |  | ||||||
|     return def; |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| function handleWindowEvent(e) { | function handleWindowEvent(e) { | ||||||
|   if (this._browserElementParents) { |   if (this._browserElementParents) { | ||||||
|     let beps = ChromeUtils.nondeterministicGetWeakMapKeys(this._browserElementParents); |     let beps = ChromeUtils.nondeterministicGetWeakMapKeys(this._browserElementParents); | ||||||
|  | @ -96,10 +88,8 @@ BrowserElementParent.prototype = { | ||||||
|       this._window._browserElementParents = new WeakMap(); |       this._window._browserElementParents = new WeakMap(); | ||||||
|       let handler = handleWindowEvent.bind(this._window); |       let handler = handleWindowEvent.bind(this._window); | ||||||
|       let windowEvents = ["visibilitychange", "fullscreenchange"]; |       let windowEvents = ["visibilitychange", "fullscreenchange"]; | ||||||
|       let els = Cc["@mozilla.org/eventlistenerservice;1"] |  | ||||||
|                   .getService(Ci.nsIEventListenerService); |  | ||||||
|       for (let event of windowEvents) { |       for (let event of windowEvents) { | ||||||
|         els.addSystemEventListener(this._window, event, handler, |         Services.els.addSystemEventListener(this._window, event, handler, | ||||||
|                                             /* useCapture = */ true); |                                             /* useCapture = */ true); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  | @ -138,7 +128,7 @@ BrowserElementParent.prototype = { | ||||||
| 
 | 
 | ||||||
|   receiveMessage(aMsg) { |   receiveMessage(aMsg) { | ||||||
|     if (!this._isAlive()) { |     if (!this._isAlive()) { | ||||||
|       return; |       return undefined; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // Messages we receive are handed to functions which take a (data) argument,
 |     // Messages we receive are handed to functions which take a (data) argument,
 | ||||||
|  | @ -184,6 +174,7 @@ BrowserElementParent.prototype = { | ||||||
|     } else if (aMsg.data.msg_name in mmSecuritySensitiveCalls) { |     } else if (aMsg.data.msg_name in mmSecuritySensitiveCalls) { | ||||||
|       return mmSecuritySensitiveCalls[aMsg.data.msg_name].apply(this, arguments); |       return mmSecuritySensitiveCalls[aMsg.data.msg_name].apply(this, arguments); | ||||||
|     } |     } | ||||||
|  |     return undefined; | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   _removeMessageListener() { |   _removeMessageListener() { | ||||||
|  | @ -210,7 +201,6 @@ BrowserElementParent.prototype = { | ||||||
| 
 | 
 | ||||||
|   promptAuth(authDetail, callback) { |   promptAuth(authDetail, callback) { | ||||||
|     let evt; |     let evt; | ||||||
|     let self = this; |  | ||||||
|     let callbackCalled = false; |     let callbackCalled = false; | ||||||
|     let cancelCallback = function() { |     let cancelCallback = function() { | ||||||
|       if (!callbackCalled) { |       if (!callbackCalled) { | ||||||
|  |  | ||||||
|  | @ -294,8 +294,6 @@ BrowserElementAuthPrompt.prototype = { | ||||||
|       return; |       return; | ||||||
| 
 | 
 | ||||||
|     let prompt = this._asyncPrompts[hashKey]; |     let prompt = this._asyncPrompts[hashKey]; | ||||||
|     let [hostname, httpRealm] = this._getAuthTarget(prompt.channel, |  | ||||||
|                                                     prompt.authInfo); |  | ||||||
| 
 | 
 | ||||||
|     this._asyncPromptInProgress.set(prompt.browserElementParent, true); |     this._asyncPromptInProgress.set(prompt.browserElementParent, true); | ||||||
|     prompt.inProgress = true; |     prompt.inProgress = true; | ||||||
|  | @ -570,16 +568,14 @@ var BrowserElementPromptService = { | ||||||
| 
 | 
 | ||||||
|     // If the pref is disabled, do nothing except wait for the pref to change.
 |     // If the pref is disabled, do nothing except wait for the pref to change.
 | ||||||
|     if (!this._browserFramesPrefEnabled()) { |     if (!this._browserFramesPrefEnabled()) { | ||||||
|       var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); |       Services.prefs.addObserver(BROWSER_FRAMES_ENABLED_PREF, this, /* ownsWeak = */ true); | ||||||
|       prefs.addObserver(BROWSER_FRAMES_ENABLED_PREF, this, /* ownsWeak = */ true); |  | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     this._initialized = true; |     this._initialized = true; | ||||||
|     this._browserElementParentMap = new WeakMap(); |     this._browserElementParentMap = new WeakMap(); | ||||||
| 
 | 
 | ||||||
|     var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService); |     Services.obs.addObserver(this, "outer-window-destroyed", /* ownsWeak = */ true); | ||||||
|     os.addObserver(this, "outer-window-destroyed", /* ownsWeak = */ true); |  | ||||||
| 
 | 
 | ||||||
|     // Wrap the existing @mozilla.org/prompter;1 implementation.
 |     // Wrap the existing @mozilla.org/prompter;1 implementation.
 | ||||||
|     var contractID = "@mozilla.org/prompter;1"; |     var contractID = "@mozilla.org/prompter;1"; | ||||||
|  | @ -644,12 +640,7 @@ var BrowserElementPromptService = { | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   _browserFramesPrefEnabled() { |   _browserFramesPrefEnabled() { | ||||||
|     var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); |     return Services.prefs.getBoolPref(BROWSER_FRAMES_ENABLED_PREF, false); | ||||||
|     try { |  | ||||||
|       return prefs.getBoolPref(BROWSER_FRAMES_ENABLED_PREF); |  | ||||||
|     } catch (e) { |  | ||||||
|       return false; |  | ||||||
|     } |  | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   observe(subject, topic, data) { |   observe(subject, topic, data) { | ||||||
|  |  | ||||||
|  | @ -69,7 +69,7 @@ | ||||||
|               } |               } | ||||||
|             ).catch(err => reject(err)); |             ).catch(err => reject(err)); | ||||||
|           } |           } | ||||||
|           step(gen.next(value)); |           return step(gen.next(value)); | ||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that alert works.
 | // Test that alert works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that alert works from inside an <iframe> inside an <iframe mozbrowser>.
 | // Test that alert works from inside an <iframe> inside an <iframe mozbrowser>.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that auth prompt works.
 | // Test that auth prompt works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -37,9 +39,9 @@ function testHttpAuthCancel(e) { | ||||||
|   // Will cancel authentication, but prompt should not be shown again. Instead,
 |   // Will cancel authentication, but prompt should not be shown again. Instead,
 | ||||||
|   // we will be led to fail message
 |   // we will be led to fail message
 | ||||||
|   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail); |   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail); | ||||||
|   iframe.addEventListener("mozbrowsertitlechange", function(e) { |   iframe.addEventListener("mozbrowsertitlechange", function(f) { | ||||||
|     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); |     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); | ||||||
|     is(e.detail, "http auth failed", "expected authentication to fail"); |     is(f.detail, "http auth failed", "expected authentication to fail"); | ||||||
|     iframe.addEventListener("mozbrowserusernameandpasswordrequired", testHttpAuth); |     iframe.addEventListener("mozbrowserusernameandpasswordrequired", testHttpAuth); | ||||||
|     SimpleTest.executeSoon(function() { |     SimpleTest.executeSoon(function() { | ||||||
|       // Use absolute path because we need to specify host.
 |       // Use absolute path because we need to specify host.
 | ||||||
|  | @ -65,9 +67,9 @@ function testHttpAuth(e) { | ||||||
|   // Will authenticate with correct password, prompt should not be
 |   // Will authenticate with correct password, prompt should not be
 | ||||||
|   // called again.
 |   // called again.
 | ||||||
|   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail); |   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail); | ||||||
|   iframe.addEventListener("mozbrowsertitlechange", function(e) { |   iframe.addEventListener("mozbrowsertitlechange", function(f) { | ||||||
|     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); |     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); | ||||||
|     is(e.detail, "http auth success", "expect authentication to succeed"); |     is(f.detail, "http auth success", "expect authentication to succeed"); | ||||||
|     SimpleTest.executeSoon(testProxyAuth); |     SimpleTest.executeSoon(testProxyAuth); | ||||||
|   }, {once: true}); |   }, {once: true}); | ||||||
| 
 | 
 | ||||||
|  | @ -84,7 +86,7 @@ function testHttpAuth(e) { | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function testProxyAuth(e) { | function testProxyAuth() { | ||||||
|   // The testingSJS simulates the 407 proxy authentication required response
 |   // The testingSJS simulates the 407 proxy authentication required response
 | ||||||
|   // for proxy server, which will trigger the browser element to send prompt
 |   // for proxy server, which will trigger the browser element to send prompt
 | ||||||
|   // event with proxy infomation.
 |   // event with proxy infomation.
 | ||||||
|  | @ -94,9 +96,9 @@ function testProxyAuth(e) { | ||||||
|   function onUserNameAndPasswordRequired(e) { |   function onUserNameAndPasswordRequired(e) { | ||||||
|     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", |     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", | ||||||
|                                onUserNameAndPasswordRequired); |                                onUserNameAndPasswordRequired); | ||||||
|     iframe.addEventListener("mozbrowsertitlechange", function(e) { |     iframe.addEventListener("mozbrowsertitlechange", function(event) { | ||||||
|       iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); |       iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); | ||||||
|       is(e.detail, "http auth success", "expect authentication to succeed"); |       is(event.detail, "http auth success", "expect authentication to succeed"); | ||||||
|       SimpleTest.executeSoon(testAuthJarNoInterfere); |       SimpleTest.executeSoon(testAuthJarNoInterfere); | ||||||
|     }, {once: true}); |     }, {once: true}); | ||||||
| 
 | 
 | ||||||
|  | @ -149,12 +151,10 @@ function testProxyAuth(e) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function testAuthJarNoInterfere(e) { | function testAuthJarNoInterfere(e) { | ||||||
|   var authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"] |   let authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"] | ||||||
|     .getService(SpecialPowers.Ci.nsIHttpAuthManager); |     .getService(SpecialPowers.Ci.nsIHttpAuthManager); | ||||||
|   var secMan = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"] |   let secMan = SpecialPowers.Services.scriptSecurityManager; | ||||||
|                .getService(SpecialPowers.Ci.nsIScriptSecurityManager); |   let ioService = SpecialPowers.Services.io; | ||||||
|   var ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"] |  | ||||||
|                   .getService(SpecialPowers.Ci.nsIIOService); |  | ||||||
|   var uri = ioService.newURI("http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs"); |   var uri = ioService.newURI("http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs"); | ||||||
| 
 | 
 | ||||||
|   // Set a bunch of auth data that should not conflict with the correct auth data already
 |   // Set a bunch of auth data that should not conflict with the correct auth data already
 | ||||||
|  | @ -177,9 +177,9 @@ function testAuthJarNoInterfere(e) { | ||||||
|   // Will authenticate with correct password, prompt should not be
 |   // Will authenticate with correct password, prompt should not be
 | ||||||
|   // called again.
 |   // called again.
 | ||||||
|   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail); |   iframe.addEventListener("mozbrowserusernameandpasswordrequired", testFail); | ||||||
|   iframe.addEventListener("mozbrowsertitlechange", function(e) { |   iframe.addEventListener("mozbrowsertitlechange", function(f) { | ||||||
|     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); |     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", testFail); | ||||||
|     is(e.detail, "http auth success", "expected authentication success"); |     is(f.detail, "http auth success", "expected authentication success"); | ||||||
|     SimpleTest.executeSoon(testAuthJarInterfere); |     SimpleTest.executeSoon(testAuthJarInterfere); | ||||||
|   }, {once: true}); |   }, {once: true}); | ||||||
| 
 | 
 | ||||||
|  | @ -189,12 +189,10 @@ function testAuthJarNoInterfere(e) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function testAuthJarInterfere(e) { | function testAuthJarInterfere(e) { | ||||||
|   var authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"] |   let authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"] | ||||||
|     .getService(SpecialPowers.Ci.nsIHttpAuthManager); |     .getService(SpecialPowers.Ci.nsIHttpAuthManager); | ||||||
|   var secMan = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"] |   let secMan = SpecialPowers.Services.scriptSecurityManager; | ||||||
|                .getService(SpecialPowers.Ci.nsIScriptSecurityManager); |   let ioService = SpecialPowers.Services.io; | ||||||
|   var ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"] |  | ||||||
|                   .getService(SpecialPowers.Ci.nsIIOService); |  | ||||||
|   var uri = ioService.newURI("http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs"); |   var uri = ioService.newURI("http://test/tests/dom/browser-element/mochitest/file_http_401_response.sjs"); | ||||||
| 
 | 
 | ||||||
|   // Set some auth data that should overwrite the successful stored details.
 |   // Set some auth data that should overwrite the successful stored details.
 | ||||||
|  | @ -211,7 +209,7 @@ function testAuthJarInterfere(e) { | ||||||
|   } |   } | ||||||
|   iframe.addEventListener("mozbrowserusernameandpasswordrequired", |   iframe.addEventListener("mozbrowserusernameandpasswordrequired", | ||||||
|                           onUserNameAndPasswordRequired); |                           onUserNameAndPasswordRequired); | ||||||
|   iframe.addEventListener("mozbrowsertitlechange", function(e) { |   iframe.addEventListener("mozbrowsertitlechange", function(f) { | ||||||
|     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", |     iframe.removeEventListener("mozbrowserusernameandpasswordrequired", | ||||||
|                                onUserNameAndPasswordRequired); |                                onUserNameAndPasswordRequired); | ||||||
|     ok(gotusernamepasswordrequired, |     ok(gotusernamepasswordrequired, | ||||||
|  | @ -226,13 +224,11 @@ function testAuthJarInterfere(e) { | ||||||
| 
 | 
 | ||||||
| function testFinish() { | function testFinish() { | ||||||
|   // Clear login information stored in password manager.
 |   // Clear login information stored in password manager.
 | ||||||
|   var authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"] |   let authMgr = SpecialPowers.Cc["@mozilla.org/network/http-auth-manager;1"] | ||||||
|     .getService(SpecialPowers.Ci.nsIHttpAuthManager); |     .getService(SpecialPowers.Ci.nsIHttpAuthManager); | ||||||
|   authMgr.clearAll(); |   authMgr.clearAll(); | ||||||
| 
 | 
 | ||||||
|   var pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"] |   SpecialPowers.Services.logins.removeAllLogins(); | ||||||
|     .getService(SpecialPowers.Ci.nsILoginManager); |  | ||||||
|   pwmgr.removeAllLogins(); |  | ||||||
| 
 | 
 | ||||||
|   SimpleTest.finish(); |   SimpleTest.finish(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // <iframe mozbrowser>.
 | // <iframe mozbrowser>.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -7,6 +7,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -23,12 +25,12 @@ function runTest() { | ||||||
|     ok(true, "Got first mozbrowseropenwindow event."); |     ok(true, "Got first mozbrowseropenwindow event."); | ||||||
|     document.body.appendChild(e.detail.frameElement); |     document.body.appendChild(e.detail.frameElement); | ||||||
| 
 | 
 | ||||||
|     e.detail.frameElement.addEventListener("mozbrowserlocationchange", function(e) { |     e.detail.frameElement.addEventListener("mozbrowserlocationchange", function(f) { | ||||||
|       if (e.detail.url == "http://example.com/#2") { |       if (f.detail.url == "http://example.com/#2") { | ||||||
|         ok(true, "Got locationchange to http://example.com/#2"); |         ok(true, "Got locationchange to http://example.com/#2"); | ||||||
|         SimpleTest.finish(); |         SimpleTest.finish(); | ||||||
|       } else { |       } else { | ||||||
|         ok(true, "Got locationchange to " + e.detail.url); |         ok(true, "Got locationchange to " + f.detail.url); | ||||||
|       } |       } | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|  | @ -40,7 +42,7 @@ function runTest() { | ||||||
|       SpecialPowers.wrap(iframe2).presetOpenerWindow(iframe1.contentWindow); |       SpecialPowers.wrap(iframe2).presetOpenerWindow(iframe1.contentWindow); | ||||||
|       iframe2.setAttribute("mozbrowser", "true"); |       iframe2.setAttribute("mozbrowser", "true"); | ||||||
| 
 | 
 | ||||||
|       iframe2.addEventListener("mozbrowseropenwindow", function(e) { |       iframe2.addEventListener("mozbrowseropenwindow", function(f) { | ||||||
|         ok(false, "Got second mozbrowseropenwindow event."); |         ok(false, "Got second mozbrowseropenwindow event."); | ||||||
|       }); |       }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Bug 891763 - Test the mozbrowserresize event
 | // Bug 891763 - Test the mozbrowserresize event
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that window.close() works.
 | // Test that window.close() works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -19,7 +21,7 @@ function runTest() { | ||||||
|     SimpleTest.finish(); |     SimpleTest.finish(); | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   iframe.src = "data:text/html,<html><body><script>window.close()</scr" + "ipt></body></html>"; |   iframe.src = "data:text/html,<html><body><script>window.close()</script></body></html>"; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| addEventListener("testready", runTest); | addEventListener("testready", runTest); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Bug 764718 - Test that window.close() works from the opener window.
 | // Bug 764718 - Test that window.close() works from the opener window.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -16,7 +18,7 @@ function runTest() { | ||||||
|     ok(true, "got openwindow event."); |     ok(true, "got openwindow event."); | ||||||
|     document.body.appendChild(e.detail.frameElement); |     document.body.appendChild(e.detail.frameElement); | ||||||
| 
 | 
 | ||||||
|     e.detail.frameElement.addEventListener("mozbrowserclose", function(e) { |     e.detail.frameElement.addEventListener("mozbrowserclose", function(f) { | ||||||
|       ok(true, "got mozbrowserclose event."); |       ok(true, "got mozbrowserclose event."); | ||||||
|       SimpleTest.finish(); |       SimpleTest.finish(); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  | @ -1,5 +1,8 @@ | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | /* eslint-env mozilla/frame-script */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.setClipboardPlainTextOnlyPref(false); | browserElementTestHelpers.setClipboardPlainTextOnlyPref(false); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,8 @@ | ||||||
| // third-party.
 | // third-party.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,13 +4,14 @@ | ||||||
| // Test that "cut, copy, paste, selectall" and caretstatechanged event works from inside an <iframe mozbrowser>.
 | // Test that "cut, copy, paste, selectall" and caretstatechanged event works from inside an <iframe mozbrowser>.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| SimpleTest.requestFlakyTimeout("untriaged"); | SimpleTest.requestFlakyTimeout("untriaged"); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.setupAccessibleCaretPref(); | browserElementTestHelpers.setupAccessibleCaretPref(); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
| browserElementTestHelpers.allowTopLevelDataURINavigation(); | browserElementTestHelpers.allowTopLevelDataURINavigation(); | ||||||
| const { Services } = SpecialPowers.Cu.import("resource://gre/modules/Services.jsm"); |  | ||||||
| 
 | 
 | ||||||
| var gTextarea = null; | var gTextarea = null; | ||||||
| var mm; | var mm; | ||||||
|  | @ -72,9 +73,9 @@ function runTest() { | ||||||
|       iframeInner.setAttribute("mozbrowser", true); |       iframeInner.setAttribute("mozbrowser", true); | ||||||
|       iframeInner.setAttribute("remote", "false"); |       iframeInner.setAttribute("remote", "false"); | ||||||
|       contentDoc.body.appendChild(iframeInner); |       contentDoc.body.appendChild(iframeInner); | ||||||
|       iframeInner.addEventListener("mozbrowserloadend", function(e) { |       iframeInner.addEventListener("mozbrowserloadend", function(f) { | ||||||
|         mm = SpecialPowers.getBrowserFrameMessageManager(iframeInner); |         mm = SpecialPowers.getBrowserFrameMessageManager(iframeInner); | ||||||
|         dispatchTest(e); |         dispatchTest(f); | ||||||
|       }, {once: true}); |       }, {once: true}); | ||||||
|     } else { |     } else { | ||||||
|       iframeInner = iframeOuter; |       iframeInner = iframeOuter; | ||||||
|  | @ -96,9 +97,9 @@ function doCommand(cmd) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function dispatchTest(e) { | function dispatchTest(e) { | ||||||
|   iframeInner.addEventListener("mozbrowserloadend", function(e) { |   iframeInner.addEventListener("mozbrowserloadend", function(f) { | ||||||
|     iframeInner.focus(); |     iframeInner.focus(); | ||||||
|     SimpleTest.executeSoon(function() { testSelectAll(e); }); |     SimpleTest.executeSoon(function() { testSelectAll(f); }); | ||||||
|   }, {once: true}); |   }, {once: true}); | ||||||
| 
 | 
 | ||||||
|   switch (state) { |   switch (state) { | ||||||
|  | @ -180,8 +181,7 @@ function dispatchTest(e) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function isChildProcess() { | function isChildProcess() { | ||||||
|   return SpecialPowers.Cc["@mozilla.org/xre/app-info;1"] |   return SpecialPowers.Services.appinfo | ||||||
|                          .getService(SpecialPowers.Ci.nsIXULRuntime) |  | ||||||
|                       .processType != SpecialPowers.Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; |                       .processType != SpecialPowers.Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -189,12 +189,12 @@ function testSelectAll(e) { | ||||||
|   // Skip mozbrowser test if we're at child process.
 |   // Skip mozbrowser test if we're at child process.
 | ||||||
|   if (!isChildProcess()) { |   if (!isChildProcess()) { | ||||||
|     let eventName = "mozbrowsercaretstatechanged"; |     let eventName = "mozbrowsercaretstatechanged"; | ||||||
|     iframeOuter.addEventListener(eventName, function(e) { |     iframeOuter.addEventListener(eventName, function(f) { | ||||||
|       ok(true, "got mozbrowsercaretstatechanged event." + stateMeaning); |       ok(true, "got mozbrowsercaretstatechanged event." + stateMeaning); | ||||||
|       ok(e.detail, "event.detail is not null." + stateMeaning); |       ok(f.detail, "event.detail is not null." + stateMeaning); | ||||||
|       ok(e.detail.width != 0, "event.detail.width is not zero" + stateMeaning); |       ok(f.detail.width != 0, "event.detail.width is not zero" + stateMeaning); | ||||||
|       ok(e.detail.height != 0, "event.detail.height is not zero" + stateMeaning); |       ok(f.detail.height != 0, "event.detail.height is not zero" + stateMeaning); | ||||||
|       SimpleTest.executeSoon(function() { testCopy1(e); }); |       SimpleTest.executeSoon(function() { testCopy1(f); }); | ||||||
|     }, {capture: true, once: true}); |     }, {capture: true, once: true}); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | @ -336,4 +336,3 @@ addEventListener("testready", function() { | ||||||
|     {type: "browser", allow: 1, context}, |     {type: "browser", allow: 1, context}, | ||||||
|   ], runTest); |   ], runTest); | ||||||
| }); | }); | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -4,6 +4,9 @@ | ||||||
| // Test that data: URIs work with mozbrowserlocationchange events.
 | // Test that data: URIs work with mozbrowserlocationchange events.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -2,6 +2,9 @@ | ||||||
|    http://creativecommons.org/publicdomain/zero/1.0/ */
 |    http://creativecommons.org/publicdomain/zero/1.0/ */
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| SimpleTest.requestFlakyTimeout("testing mozbrowser data: navigation is blocked"); | SimpleTest.requestFlakyTimeout("testing mozbrowser data: navigation is blocked"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Bug 829486 - Add mozdocumentbrowserfirstpaint event.
 | // Bug 829486 - Add mozdocumentbrowserfirstpaint event.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -5,6 +5,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // "unexposable" parts before sending them in the locationchange event.
 | // "unexposable" parts before sending them in the locationchange event.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Bug 787378 - Add mozbrowserfirstpaint event.
 | // Bug 787378 - Add mozbrowserfirstpaint event.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -6,6 +6,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,9 @@ | ||||||
| // Bug 804446 - Test that window.open(javascript:..) works with <iframe mozbrowser>.
 | // Bug 804446 - Test that window.open(javascript:..) works with <iframe mozbrowser>.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that the onmozbrowsericonchange event works.
 | // Test that the onmozbrowsericonchange event works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // events when this page is in the whitelist.
 | // events when this page is in the whitelist.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that the onmozbrowsermetachange event works.
 | // Test that the onmozbrowsermetachange event works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // with the same name, we get only one mozbrowseropenwindow event.
 | // with the same name, we get only one mozbrowseropenwindow event.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -23,9 +26,9 @@ function runTest() { | ||||||
|     is(popupFrame.getAttribute("name"), "OpenNamed"); |     is(popupFrame.getAttribute("name"), "OpenNamed"); | ||||||
| 
 | 
 | ||||||
|     // Called when file_browserElement_OpenNamed2.html loads into popupFrame.
 |     // Called when file_browserElement_OpenNamed2.html loads into popupFrame.
 | ||||||
|     popupFrame.addEventListener("mozbrowsershowmodalprompt", function(e) { |     popupFrame.addEventListener("mozbrowsershowmodalprompt", function(f) { | ||||||
|       ok(gotPopup, "Got openwindow event before showmodalprompt event."); |       ok(gotPopup, "Got openwindow event before showmodalprompt event."); | ||||||
|       is(e.detail.message, "success: loaded"); |       is(f.detail.message, "success: loaded"); | ||||||
|       SimpleTest.executeSoon(test2); |       SimpleTest.executeSoon(test2); | ||||||
|     }, {once: true}); |     }, {once: true}); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,6 +4,9 @@ | ||||||
| // Bug 1144015 - test middle/ctrl/cmd-click on a link.
 | // Bug 1144015 - test middle/ctrl/cmd-click on a link.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,9 @@ | ||||||
| // Bug 742944 - Test that window.open works with <iframe mozbrowser>.
 | // Bug 742944 - Test that window.open works with <iframe mozbrowser>.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,9 @@ | ||||||
| // Bug 769182 - window.open to a different origin should load the page.
 | // Bug 769182 - window.open to a different origin should load the page.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -15,12 +18,12 @@ function runTest() { | ||||||
|   iframe.addEventListener("mozbrowseropenwindow", function(e) { |   iframe.addEventListener("mozbrowseropenwindow", function(e) { | ||||||
|     ok(true, "Got first window.open call"); |     ok(true, "Got first window.open call"); | ||||||
| 
 | 
 | ||||||
|     e.detail.frameElement.addEventListener("mozbrowseropenwindow", function(e) { |     e.detail.frameElement.addEventListener("mozbrowseropenwindow", function(f) { | ||||||
|       ok(true, "Got second window.open call"); |       ok(true, "Got second window.open call"); | ||||||
|       document.body.appendChild(e.detail.frameElement); |       document.body.appendChild(f.detail.frameElement); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|     e.detail.frameElement.addEventListener("mozbrowsershowmodalprompt", function(e) { |     e.detail.frameElement.addEventListener("mozbrowsershowmodalprompt", function(f) { | ||||||
|       ok(true, "Got alert from second window."); |       ok(true, "Got alert from second window."); | ||||||
|       SimpleTest.finish(); |       SimpleTest.finish(); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // about:blank as default
 | // about:blank as default
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -10,6 +10,9 @@ | ||||||
| // an iframe.
 | // an iframe.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // reject the call.  This shouldn't cause problems (crashes, leaks).
 | // reject the call.  This shouldn't cause problems (crashes, leaks).
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -9,6 +9,9 @@ | ||||||
| // preventDefault() on the event.
 | // preventDefault() on the event.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that the onmozbrowseropensearch event works.
 | // Test that the onmozbrowseropensearch event works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that the mozprivatebrowsing attribute works.
 | // Test that the mozprivatebrowsing attribute works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -10,6 +10,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -37,6 +39,7 @@ function runTest() { | ||||||
|     } |     } | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|  |   /* eslint-disable no-useless-concat */ | ||||||
|   iframe.src = |   iframe.src = | ||||||
|     'data:text/html,<html><body><script>\ |     'data:text/html,<html><body><script>\ | ||||||
|       addEventListener("load", function() { \ |       addEventListener("load", function() { \ | ||||||
|  | @ -48,6 +51,7 @@ function runTest() { | ||||||
|        }); \ |        }); \ | ||||||
|      }); \ |      }); \ | ||||||
|      </scr' + "ipt></body></html>"; |      </scr' + "ipt></body></html>"; | ||||||
|  |    /* eslint-enable no-useless-concat */ | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // The test harness sets dom.successive_dialog_time_limit to 0 for some bizarre
 | // The test harness sets dom.successive_dialog_time_limit to 0 for some bizarre
 | ||||||
|  |  | ||||||
|  | @ -8,6 +8,8 @@ | ||||||
| // ourselves.
 | // ourselves.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -68,6 +70,7 @@ function runTest() { | ||||||
|     } |     } | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|  |   /* eslint-disable no-useless-concat */ | ||||||
|   iframe.src = |   iframe.src = | ||||||
|     'data:text/html,<html><body><script>\ |     'data:text/html,<html><body><script>\ | ||||||
|       function sendVal(val) { \ |       function sendVal(val) { \ | ||||||
|  | @ -81,6 +84,7 @@ function runTest() { | ||||||
|       sendVal(prompt("6", "initial")); \ |       sendVal(prompt("6", "initial")); \ | ||||||
|       sendVal(prompt("7", "initial")); \ |       sendVal(prompt("7", "initial")); \ | ||||||
|     </scr' + "ipt></body></html>"; |     </scr' + "ipt></body></html>"; | ||||||
|  |   /* eslint-enable no-useless-concat */ | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| addEventListener("testready", runTest); | addEventListener("testready", runTest); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,10 @@ | ||||||
| // Bug 741717 - Test the reload ability of <iframe mozbrowser>.
 | // Bug 741717 - Test the reload ability of <iframe mozbrowser>.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | /* eslint-env mozilla/frame-script */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // POST respest.
 | // POST respest.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| SimpleTest.requestFlakyTimeout("untriaged"); | SimpleTest.requestFlakyTimeout("untriaged"); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
|  | @ -17,10 +20,8 @@ var isPostRequestSubmitted; | ||||||
| 
 | 
 | ||||||
| function getExpectedStrings() { | function getExpectedStrings() { | ||||||
|   let result = {}; |   let result = {}; | ||||||
|   let bundleService = SpecialPowers.Cc["@mozilla.org/intl/stringbundle;1"]. |   let appBundle = Services.strings.createBundle("chrome://global/locale/appstrings.properties"); | ||||||
|     getService(SpecialPowers.Ci.nsIStringBundleService); |   let brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties"); | ||||||
|   let appBundle = bundleService.createBundle("chrome://global/locale/appstrings.properties"); |  | ||||||
|   let brandBundle = bundleService.createBundle("chrome://branding/locale/brand.properties"); |  | ||||||
|   try { |   try { | ||||||
|     let brandName = brandBundle.GetStringFromName("brandShortName"); |     let brandName = brandBundle.GetStringFromName("brandShortName"); | ||||||
|     result.message = appBundle.formatStringFromName("confirmRepostPrompt", |     result.message = appBundle.formatStringFromName("confirmRepostPrompt", | ||||||
|  |  | ||||||
|  | @ -6,6 +6,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that scroll event bubbles up.
 | // Test that scroll event bubbles up.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,9 @@ | ||||||
| // mozbrowsersecuritychange events.
 | // mozbrowsersecuritychange events.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -55,4 +58,3 @@ addEventListener("testready", function() { | ||||||
|     ["browser.safebrowsing.malware.enabled", false], |     ["browser.safebrowsing.malware.enabled", false], | ||||||
|   ]}, runTest); |   ]}, runTest); | ||||||
| }); | }); | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that sendMouseEvent dispatch events.
 | // Test that sendMouseEvent dispatch events.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -9,6 +9,9 @@ | ||||||
| // image load will be cancaelled and mozbrowserloadend should be called.
 | // image load will be cancaelled and mozbrowserloadend should be called.
 | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
|  | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| SimpleTest.requestFlakyTimeout("untriaged"); | SimpleTest.requestFlakyTimeout("untriaged"); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -5,6 +5,8 @@ | ||||||
| // mozbrowser>.
 | // mozbrowser>.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that the onmozbrowsermetachange event for theme-color works.
 | // Test that the onmozbrowsermetachange event for theme-color works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -82,4 +84,3 @@ function runTest() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| window.addEventListener("testready", runTest); | window.addEventListener("testready", runTest); | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that the onmozbrowsertitlechange event works.
 | // Test that the onmozbrowsertitlechange event works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that an <iframe mozbrowser> is a window.{top,parent,frameElement} barrier.
 | // Test that an <iframe mozbrowser> is a window.{top,parent,frameElement} barrier.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Test that the onmozbrowsermetachange event for viewmode works.
 | // Test that the onmozbrowsermetachange event for viewmode works.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -68,4 +70,3 @@ function runTest() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| window.addEventListener("testready", runTest); | window.addEventListener("testready", runTest); | ||||||
| 
 |  | ||||||
|  |  | ||||||
|  | @ -5,6 +5,8 @@ | ||||||
| // <iframe mozbrowser>.
 | // <iframe mozbrowser>.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -4,6 +4,8 @@ | ||||||
| // Bug 690168 - Support Allow-From notation for X-Frame-Options header.
 | // Bug 690168 - Support Allow-From notation for X-Frame-Options header.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  | @ -27,8 +29,6 @@ function arrayBuffersEqual(a, b) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function runTest() { | function runTest() { | ||||||
|   var count = 0; |  | ||||||
| 
 |  | ||||||
|   var iframe = document.createElement("iframe"); |   var iframe = document.createElement("iframe"); | ||||||
|   iframe.setAttribute("mozbrowser", "true"); |   iframe.setAttribute("mozbrowser", "true"); | ||||||
|   iframe.height = "1000px"; |   iframe.height = "1000px"; | ||||||
|  |  | ||||||
|  | @ -5,6 +5,8 @@ | ||||||
| // subframe of <iframe mozbrowser>.
 | // subframe of <iframe mozbrowser>.
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -7,6 +7,8 @@ | ||||||
| 
 | 
 | ||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
|  | /* global browserElementTestHelpers */ | ||||||
|  | 
 | ||||||
| SimpleTest.waitForExplicitFinish(); | SimpleTest.waitForExplicitFinish(); | ||||||
| browserElementTestHelpers.setEnabledPref(true); | browserElementTestHelpers.setEnabledPref(true); | ||||||
| browserElementTestHelpers.addPermission(); | browserElementTestHelpers.addPermission(); | ||||||
|  |  | ||||||
|  | @ -1,5 +1,6 @@ | ||||||
| <script> | <script> | ||||||
|   function testSucceeded() { alert("success"); } |   function testSucceeded() { alert("success"); } | ||||||
|  |   // eslint-disable-next-line no-useless-concat | ||||||
|   function callback() { return "<script>opener.testSucceeded()</" + "script>"; } |   function callback() { return "<script>opener.testSucceeded()</" + "script>"; } | ||||||
|   var w = window.open("javascript:opener.callback();"); |   var w = window.open("javascript:opener.callback();"); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | @ -7,6 +7,7 @@ | ||||||
| Aloha!  My URL is <span id='url'></span>. | Aloha!  My URL is <span id='url'></span>. | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|  | // eslint-disable-next-line no-unsanitized/property | ||||||
| document.getElementById("url").innerHTML = window.location; | document.getElementById("url").innerHTML = window.location; | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -10,6 +10,7 @@ if (location.search == "?1") { | ||||||
|   alert("finish"); |   alert("finish"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // eslint-disable-next-line no-unsanitized/property | ||||||
| document.getElementById("name").innerHTML = location.search; | document.getElementById("name").innerHTML = location.search; | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -6,6 +6,7 @@ | ||||||
| if (location.search == "") { | if (location.search == "") { | ||||||
|   window.open("file_browserElement_TargetTop.html?2", "_top"); |   window.open("file_browserElement_TargetTop.html?2", "_top"); | ||||||
| } | } | ||||||
|  | // eslint-disable-next-line no-unsanitized/property | ||||||
| document.getElementById("url").innerHTML = document.location.href; | document.getElementById("url").innerHTML = document.location.href; | ||||||
| </script> | </script> | ||||||
| </body> | </body> | ||||||
|  |  | ||||||
|  | @ -23,9 +23,7 @@ document.body.appendChild(iframe1); | ||||||
| iframe1.addEventListener("load", function() { | iframe1.addEventListener("load", function() { | ||||||
|   // This causes our embedder to take a screenshot (and blocks until the |   // This causes our embedder to take a screenshot (and blocks until the | ||||||
|   // screenshot is completed). |   // screenshot is completed). | ||||||
|   var iframe2Loaded = false; |  | ||||||
|   iframe2.addEventListener("load", function() { |   iframe2.addEventListener("load", function() { | ||||||
|     iframe2Loaded = true; |  | ||||||
|     alert("finish"); |     alert("finish"); | ||||||
|   }, {once: true}); |   }, {once: true}); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -7,6 +7,7 @@ | ||||||
| Aloha!  My URL is <span id='url'></span>. | Aloha!  My URL is <span id='url'></span>. | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
|  | // eslint-disable-next-line no-unsanitized/property | ||||||
| document.getElementById("url").innerHTML = window.location; | document.getElementById("url").innerHTML = window.location; | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -3,6 +3,7 @@ | ||||||
| 
 | 
 | ||||||
| Aloha!  My URL is <span id='url'></span>. | Aloha!  My URL is <span id='url'></span>. | ||||||
| <script> | <script> | ||||||
|  | // eslint-disable-next-line no-unsanitized/property | ||||||
| document.getElementById("url").innerHTML = window.location; | document.getElementById("url").innerHTML = window.location; | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
|  | @ -13,8 +14,7 @@ document.getElementById("url").innerHTML = window.location; | ||||||
|   var alreadyBlocked = false; |   var alreadyBlocked = false; | ||||||
| 
 | 
 | ||||||
|   addEventListener("keydown", function(e) { |   addEventListener("keydown", function(e) { | ||||||
|     if (e.keyCode == KeyboardEvent.DOM_VK_ESCAPE && |     if (e.keyCode == KeyboardEvent.DOM_VK_ESCAPE && !alreadyBlocked) { | ||||||
|         alreadyBlocked == false) { |  | ||||||
|       alreadyBlocked = true; |       alreadyBlocked = true; | ||||||
|       e.preventDefault(); |       e.preventDefault(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -10,6 +10,7 @@ module.exports = { | ||||||
|   "globals": { |   "globals": { | ||||||
|     // SpecialPowers is injected into the window object via SimpleTest.js
 |     // SpecialPowers is injected into the window object via SimpleTest.js
 | ||||||
|     "SpecialPowers": false, |     "SpecialPowers": false, | ||||||
|  |     "XPCNativeWrapper": false, | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   "overrides": [{ |   "overrides": [{ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Jagmeet Bhamber
						Jagmeet Bhamber