Backed out changeset 6c89df01905f (bug 893501) for Android mochitest-7 orange.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 16 Jul 2013 15:15:19 -0400
changeset 138742 f3169dd4bfb6f493c7672fcaa62091fd39824f70
parent 138741 d9579a00bb9301ee682a0ef63791d6a34d569997
child 138743 7f177c80f3b977a2a6941446685519557f4ad8d8
push idunknown
push userunknown
push dateunknown
bugs893501
milestone25.0a1
backs out6c89df01905fa1154925f704034921e9025e0c35
Backed out changeset 6c89df01905f (bug 893501) for Android mochitest-7 orange.
dom/src/notification/DesktopNotification.h
dom/tests/mochitest/notification/Makefile.in
dom/tests/mochitest/notification/test_bug893501.html
--- a/dom/src/notification/DesktopNotification.h
+++ b/dom/src/notification/DesktopNotification.h
@@ -41,24 +41,20 @@ class DesktopNotificationCenter MOZ_FINA
                                             public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DesktopNotificationCenter)
 
   DesktopNotificationCenter(nsPIDOMWindow *aWindow)
   {
-    MOZ_ASSERT(aWindow);
     mOwner = aWindow;
 
-    nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(aWindow);
-    MOZ_ASSERT(sop);
-
-    mPrincipal = sop->GetPrincipal();
-    MOZ_ASSERT(mPrincipal);
+    // Grab the uri of the document
+    mPrincipal = mOwner->GetDoc()->NodePrincipal();
 
     SetIsDOMBinding();
   }
 
   virtual ~DesktopNotificationCenter()
   {
   }
 
--- a/dom/tests/mochitest/notification/Makefile.in
+++ b/dom/tests/mochitest/notification/Makefile.in
@@ -17,12 +17,11 @@ MOCHITEST_CHROME_FILES = \
 MOCHITEST_FILES	= \
 		test_basic_notification.html \
 		test_basic_notification_click.html \
 		test_web_notifications.html \
 		test_notification_tag.html \
 		test_leak_windowClose.html \
 		create_notification.html \
 		notification_common.js \
-		test_bug893501.html \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/dom/tests/mochitest/notification/test_bug893501.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-<html>
-<head>
-  <title>bug893501 - crash test</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="notification_common.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<div id="foo"></div>
-</div>
-<pre id="test">
-<script type="application/javascript"><!--
-if (is_feature_enabled()) {
-  SimpleTest.waitForExplicitFinish();
-
-  function showNotifications() {
-    ok(navigator.mozNotification, "test for notification.");
-
-    var div = document.getElementById('foo');
-    var frame = document.createElement('iframe');
-    div.appendChild(frame);
-
-    var frameNavigator = frame.contentWindow.navigator;
-    frame.addEventListener("load", n, false);
-    frame.src = "data:text/html,hello world";
-
-    function n()
-    {
-      ok(frameNavigator.mozNotification, "Still alive!");
-      SimpleTest.finish();
-    }
-  }
-
-  setup_notifications(true, false, showNotifications);
-} else {
-  ok(true, "Desktop notifications not enabled.");
-}
-// -->
-</script>
-</pre>
-</body>
-</html>
-