mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 11:38:16 +00:00
Bug 679320 - Add currentURI as a property to the xul:editor element r=ehsan
This commit is contained in:
parent
b4ea8dc43d
commit
01ba709913
@ -77,6 +77,10 @@ _TEST_FILES = \
|
||||
videomask.css \
|
||||
$(NULL)
|
||||
|
||||
_CHROME_TEST_FILES = \
|
||||
test_editor_currentURI.xul \
|
||||
$(NULL)
|
||||
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
_TEST_FILES += test_menubar.xul \
|
||||
window_menubar.xul
|
||||
@ -87,3 +91,7 @@ libs:: $(_CHROME_FILES)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_CHROME_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
|
||||
|
||||
|
40
toolkit/content/tests/widgets/test_editor_currentURI.xul
Normal file
40
toolkit/content/tests/widgets/test_editor_currentURI.xul
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin"
|
||||
type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="Editor currentURI Tests" onload="runTest();">
|
||||
<title>Editor currentURI Tests</title>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<p/>
|
||||
<editor xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="editor"
|
||||
type="content"
|
||||
editortype="html"
|
||||
style="width: 400px; height: 100px;"/>
|
||||
<p/>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
<script class="testbody" type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
var editor = document.getElementById("editor");
|
||||
// Check that currentURI is a property of editor.
|
||||
var result = "currentURI" in editor;
|
||||
is(result, true, "currentURI is a property of editor");
|
||||
is(editor.currentURI.spec, "about:blank", "currentURI.spec is about:blank");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
@ -102,6 +102,9 @@
|
||||
<property name="docShell"
|
||||
onget="return this.boxObject.QueryInterface(Components.interfaces.nsIContainerBoxObject).docShell;"
|
||||
readonly="true"/>
|
||||
<property name="currentURI"
|
||||
readonly="true"
|
||||
onget="return this.webNavigation.currentURI;"/>
|
||||
<property name="contentWindow"
|
||||
readonly="true"
|
||||
onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user