mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1188639 - Fix typo in BrowserElement.webidl and add tests for it. r=yoshi,bz
This commit is contained in:
parent
bb1294bc8c
commit
37be5dc5be
30
dom/browser-element/mochitest/browserElement_SetNFCFocus.js
Normal file
30
dom/browser-element/mochitest/browserElement_SetNFCFocus.js
Normal file
@ -0,0 +1,30 @@
|
||||
/* Any copyright is dedicated to the public domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Bug 1188639 - Check permission to use setNFCFocus
|
||||
"use strict";
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
function hasSetNFCFocus() {
|
||||
return new Promise((resolve, reject) => {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
iframe.addEventListener('mozbrowserloadend', e => {
|
||||
is(iframe.setNFCFocus !== undefined, true,
|
||||
"has permission to use setNFCFocus");
|
||||
resolve();
|
||||
});
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ 'type': 'nfc-manager', 'allow': 1, 'context': document }],
|
||||
() => hasSetNFCFocus().then(SimpleTest.finish));
|
||||
}
|
||||
|
||||
addEventListener('testready', runTest);
|
@ -113,3 +113,4 @@ disabled = bug 924771
|
||||
disabled = bug 924771
|
||||
[test_browserElement_oop_GetContentDimensions.html]
|
||||
[test_browserElement_oop_AudioChannel.html]
|
||||
[test_browserElement_oop_SetNFCFocus.html]
|
||||
|
@ -61,6 +61,7 @@ support-files =
|
||||
browserElement_SendEvent.js
|
||||
browserElement_SelectionStateBlur.js
|
||||
browserElement_SetInputMethodActive.js
|
||||
browserElement_SetNFCFocus.js
|
||||
browserElement_SetVisible.js
|
||||
browserElement_SetVisibleFrames.js
|
||||
browserElement_SetVisibleFrames2.js
|
||||
@ -230,3 +231,4 @@ skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 936226
|
||||
disabled = bug 774100
|
||||
[test_browserElement_inproc_GetContentDimensions.html]
|
||||
[test_browserElement_inproc_AudioChannel.html]
|
||||
[test_browserElement_inproc_SetNFCFocus.html]
|
||||
|
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Bug 1188639</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript;version=1.7" src="browserElement_SetNFCFocus.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Bug 1188639</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript;version=1.7" src="browserElement_SetNFCFocus.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -151,7 +151,7 @@ interface BrowserElementPrivileged {
|
||||
|
||||
[Throws,
|
||||
Pref="dom.mozBrowserFramesEnabled",
|
||||
CheckAllPermissions="browser setNFCFocus"]
|
||||
CheckAllPermissions="browser nfc-manager"]
|
||||
void setNFCFocus(boolean isFocus);
|
||||
|
||||
[Throws,
|
||||
|
Loading…
Reference in New Issue
Block a user