Bug 614392: Use [noscript, notxpcom] instead of "%{C++" for convenience method imgIContainer::GetType. r=joe sr=bz a=blocking-beta9+
☠☠ backed out by e24641018d51 ☠ ☠
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 06 Dec 2010 13:16:11 -0800
changeset 58677 cdb7dae6fdbb3f9daa771d54a0a1b21922844c7a
parent 58676 494159165d84025b9c8274f33dbaa6a718178dce
child 58678 e24641018d51da3572a087fd8ee14a32cae15352
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjoe, bz, blocking-beta9
bugs614392
milestone2.0b8pre
Bug 614392: Use [noscript, notxpcom] instead of "%{C++" for convenience method imgIContainer::GetType. r=joe sr=bz a=blocking-beta9+
modules/libpr0n/public/imgIContainer.idl
modules/libpr0n/test/mochitest/Makefile.in
modules/libpr0n/test/mochitest/test_bug614392.html
--- a/modules/libpr0n/public/imgIContainer.idl
+++ b/modules/libpr0n/public/imgIContainer.idl
@@ -101,20 +101,17 @@ interface imgIContainer : nsISupports
   /**
    * The type of this image (one of the TYPE_* values above).
    */
   readonly attribute unsigned short type;
 
   /**
    * Direct C++ accessor for 'type' attribute, for convenience.
    */
-%{C++
-  virtual PRUint16 GetType() = 0;
-%}
-
+  [noscript, notxpcom] PRUint16 GetType();
 
   /**
    * Whether this image is animated. You can only be guaranteed that querying
    * this will not throw if STATUS_DECODE_COMPLETE is set on the imgIRequest.
    *
    * @throws NS_ERROR_NOT_AVAILABLE if the animated state cannot be determined.
    */
   readonly attribute boolean animated;
--- a/modules/libpr0n/test/mochitest/Makefile.in
+++ b/modules/libpr0n/test/mochitest/Makefile.in
@@ -68,16 +68,17 @@ include $(topsrcdir)/config/rules.mk
                 test_bug512435.html \
                 damon.jpg \
                 shaver.png \
                 test_bug497665.html \
                 bug497665-iframe.html \
                 bug497665.sjs \
                 test_bug553982.html \
                 test_bug601470.html \
+                test_bug614392.html \
 		$(NULL)
 
 # Tests disabled due to intermittent orange
 # test_bug435296.html disabled - See bug 578591
 # test_bug478398.html disabled - See bug 579139
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/modules/libpr0n/test/mochitest/test_bug614392.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=614392
+-->
+<head>
+  <title>Test for Bug 614392</title>
+  <script type="application/javascript" src="/MochiKit/packed.js"></script>
+  <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=614392">Mozilla Bug 614392</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+  <img src="damon.jpg">
+</div>
+<pre id="test">
+<script type="application/javascript">
+/** Test for Bug 614392**/
+
+SimpleTest.waitForExplicitFinish();
+
+window.onload = function() {
+  netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+  var img = document.getElementsByTagName("img")[0];
+  var container = img
+      .QueryInterface(Components.interfaces.nsIImageLoadingContent)
+      .getRequest(Components.interfaces.nsIImageLoadingContent.CURRENT_REQUEST)
+      .image;
+
+  container.animationMode =
+      Components.interfaces.imgIContainer.kDontAnimMode;
+
+  is(container.animationMode,
+     Components.interfaces.imgIContainer.kDontAnimMode,
+     "yay, our animationMode tweak took effect (and we didn't crash!)");
+
+  SimpleTest.finish();
+}
+
+</script>
+</pre>
+</body>
+</html>