Bug 745283 - Part 2: Add udp-socket permission. r=sicking, r=baku
☠☠ backed out by 607421044238 ☠ ☠
authorShih-Chiang Chien <schien@mozilla.com>
Wed, 28 May 2014 13:56:23 +0800
changeset 201648 37c10c9f2a4db72f1c7ba00aa714a43900d5a638
parent 201647 bc0ab47e8ac775d49d6e8a57d8e99be112918d39
child 201649 9fc6f4275bbb4de91a1e688b22ac6f05bede479b
push id27375
push userryanvm@gmail.com
push dateTue, 26 Aug 2014 19:56:59 +0000
treeherdermozilla-central@f9bfe115fee5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking, baku
bugs745283
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 745283 - Part 2: Add udp-socket permission. r=sicking, r=baku
dom/apps/src/PermissionsTable.jsm
dom/permission/tests/mochitest.ini
dom/permission/tests/test_udp-socket.html
--- a/dom/apps/src/PermissionsTable.jsm
+++ b/dom/apps/src/PermissionsTable.jsm
@@ -47,16 +47,21 @@ this.PermissionsTable =  { geolocation: 
                              privileged: ALLOW_ACTION,
                              certified: ALLOW_ACTION
                            },
                            "tcp-socket": {
                              app: DENY_ACTION,
                              privileged: ALLOW_ACTION,
                              certified: ALLOW_ACTION
                            },
+                           "udp-socket": {
+                             app: DENY_ACTION,
+                             privileged: ALLOW_ACTION,
+                             certified: ALLOW_ACTION
+                           },
                            "network-events": {
                              app: DENY_ACTION,
                              privileged: DENY_ACTION,
                              certified: ALLOW_ACTION
                            },
                            contacts: {
                              app: DENY_ACTION,
                              privileged: PROMPT_ACTION,
--- a/dom/permission/tests/mochitest.ini
+++ b/dom/permission/tests/mochitest.ini
@@ -11,16 +11,17 @@ skip-if = ((buildapp == 'mulet' || build
 [test_idle.html]
 skip-if = (toolkit == 'gonk' && debug) #debug-only failure
 [test_permission_basics.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(https not working, bug 907770) b2g-debug(https not working, bug 907770) b2g-desktop(Bug 907770)
 [test_permissions.html]
 [test_power.html]
 [test_systemXHR.html]
 [test_tcp-socket.html]
+[test_udp-socket.html]
 [test_webapps-manage.html]
 [test_camera.html]
 disabled = disabled until bug 859593 is fixed
 [test_keyboard.html]
 skip-if = toolkit == 'android'
 [test_input-manage.html]
 skip-if = toolkit == 'android'
 [test_wifi-manage.html]
new file mode 100644
--- /dev/null
+++ b/dom/permission/tests/test_udp-socket.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=745283
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 745283 </title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=745283">Mozilla Bug 745283 </a>
+<p id="display"></p>
+<div id="content" style="display: none"></div>
+<pre id="test">
+<script type="application/javascript;version=1.8" src="file_framework.js"></script>
+<script type="application/javascript;version=1.8">
+function verifier(success, failure) {
+  try {
+    var socket = new UDPSocket();
+
+    if (socket) {
+      success("Opened socket");
+    } else {
+      failure("failed to open socket");
+    }
+  } catch (e) {
+    failure("Got an exception " + e);
+  }
+}
+
+var gData = [
+  {
+    perm: ["udp-socket"],
+    needParentPerm: true,
+    obj: "UDPSocket",
+    webidl: "UDPSocket",
+    settings: [["dom.udpsocket.enabled", true]],
+    verifier: verifier.toSource(),
+  }
+]
+</script>
+</pre>
+</body>
+</html>
+