Bug 745283 - Part 2: Add udp-socket permission. r=sicking, r=baku
☠☠ backed out by 5258e5e96848 ☠ ☠
authorShih-Chiang Chien <schien@mozilla.com>
Wed, 28 May 2014 13:56:23 +0800
changeset 222999 ce19c464f5d844f9b027c97773861d347e5b5a4c
parent 222998 c6ad8ab94461b790aca8fb6a8a54e3633966b03f
child 223000 fc08327b3d3e0ef355911433ad40874518712e41
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [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>
+