Bug 790732 - Components shim tests. r=mrbkap

This commit is contained in:
Bobby Holley 2013-03-27 18:27:27 -07:00
Родитель 398515b5c2
Коммит c876f38aa7
3 изменённых файлов: 104 добавлений и 0 удалений

Просмотреть файл

@ -80,6 +80,8 @@ MOCHITEST_FILES = chrome_wrappers_helper.html \
file_bug781476.html \
test_bug785096.html \
test_bug789713.html \
test_bug790732.html \
file_bug790732.html \
test_bug793969.html \
file_bug795275.html \
file_bug795275.xml \

Просмотреть файл

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<script>
function testShim() {
// Basic stuff
ok(Components, "Components shim exists!");
var Ci = Components.interfaces;
ok(Ci, "interfaces shim exists!");
is(typeof Components.classes, 'undefined', "Shouldn't have a Cc");
// Check each interface that we shim. We start by checking specific
// constants for a couple of interfaces, and then once it's pretty clear that
// it's working as intended we just check that the objects themselves are the
// same.
is(Ci.nsIDOMFileReader.DONE, FileReader.DONE);
is(Ci.nsIXMLHttpRequest.HEADERS_RECEIVED, XMLHttpRequest.HEADERS_RECEIVED);
is(Ci.nsIDOMDOMException.DATA_CLONE_ERR, DOMException.DATA_CLONE_ERR);
is(Ci.nsIDOMNode.DOCUMENT_NODE, Node.DOCUMENT_NODE);
is(Ci.nsIDOMUserDataHandler.NODE_CLONED, UserDataHandler.NODE_CLONED);
is(Ci.nsIDOMCSSPrimitiveValue.CSS_PX, CSSPrimitiveValue.CSS_PX);
is(Ci.nsIDOMCSSRule.NAMESPACE_RULE, CSSRule.NAMESPACE_RULE);
is(Ci.nsIDOMCSSValue.CSS_PRIMITIVE_VALUE, CSSValue.CSS_PRIMITIVE_VALUE);
is(Ci.nsIDOMEvent.FOCUS, Event.FOCUS);
is(Ci.nsIDOMNSEvent.CLICK, Event.CLICK);
is(Ci.nsIDOMKeyEvent, KeyEvent);
is(Ci.nsIDOMMouseEvent, MouseEvent);
is(Ci.nsIDOMMouseScrollEvent, MouseScrollEvent);
is(Ci.nsIDOMMutationEvent, MutationEvent);
is(Ci.nsIDOMSimpleGestureEvent, SimpleGestureEvent);
is(Ci.nsIDOMUIEvent, UIEvent);
is(Ci.nsIDOMGeoPositionError, GeoPositionError);
is(Ci.nsIDOMHTMLMediaElement, HTMLMediaElement);
is(Ci.nsIDOMMediaError, MediaError);
is(Ci.nsIDOMLoadStatus, LoadStatus);
is(Ci.nsIDOMOfflineResourceList, OfflineResourceList);
is(Ci.nsIDOMRange, Range);
is(Ci.nsIDOMSVGFETurbulenceElement, SVGFETurbulenceElement);
is(Ci.nsIDOMSVGFEMorphologyElement, SVGFEMorphologyElement);
is(Ci.nsIDOMSVGFEConvolveMatrixElement, SVGFEConvolveMatrixElement);
is(Ci.nsIDOMSVGFEDisplacementMapElement, SVGFEDisplacementMapElement);
is(Ci.nsIDOMSVGLength, SVGLength);
is(Ci.nsIDOMSVGUnitTypes, SVGUnitTypes);
is(Ci.nsIDOMNodeFilter, NodeFilter);
is(Ci.nsIDOMXPathNamespace, XPathNamespace);
is(Ci.nsIDOMXPathResult, XPathResult);
is(Ci.nsIDOMXULButtonElement, XULButtonElement);
is(Ci.nsIDOMXULCheckboxElement, XULCheckboxElement);
is(Ci.nsIDOMXULPopupElement, XULPopupElement);
}
</script>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -0,0 +1,46 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=790732
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 790732</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for the Components shim. We split into two files because this stuff
is currently pref-controlled. **/
SimpleTest.waitForExplicitFinish();
function prepare() {
SpecialPowers.pushPrefEnv({set: [['dom.omit_components_in_content', true]]},
function () { $('ifr').onload = go;
$('ifr').contentWindow.location =
'/tests/js/xpconnect/tests/mochitest/file_bug790732.html'; }
);
}
function go() {
ok(true, "Started test");
var iwin = $('ifr').contentWindow;
iwin.ok = ok;
iwin.is = is;
iwin.testShim();
SimpleTest.finish();
}
</script>
</head>
<body onload="prepare()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=790732">Mozilla Bug 790732</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
<iframe id="ifr"></iframe>
</body>
</html>