<|start_filename|>tests/module.js<|end_filename|>
define([
	"./_base/module",
	"./infrastructure-module",

	"./general-module",
	"./tree/module",
	"./editor/module",
	"./form/module",
	"./layout/module",

	"./_BidiSupport/module"
], 1);




<|start_filename|>tests/_BidiSupport/layout/module.js<|end_filename|>
define(["doh/main", "require"], function(doh, require){
	doh.register("_BidiSupport.layout.TabContainer", require.toUrl("./TabContainer.html"), 999999);
	doh.register("_BidiSupport.layout.StackContainer", require.toUrl("./StackContainer.html"), 999999);
	doh.register("_BidiSupport.layout.AccordionContainer", require.toUrl("./AccordionContainer.html"), 999999);
});


<|start_filename|>tests/delay.js<|end_filename|>
// module:
//		dijit/tests/delay.js
// summary:
//		AMD plugin that waits a specified number of ms before "loading".
//		Used to delay execution of callbacks registered by dojo.ready().
//		(Used by _testCommon.html)
//
//		Usage: ready(1, function(){ require(["dijit/tests/delay!300"]); });

// TODO: remove for 2.0, it's only used by _testCommon.js which will also be removed.

define({
	load: function(delay, req, loaded){
		setTimeout(function(){
			loaded(1);
		}, delay);
	},
	dynamic: 1,
	normalize: function(id){
		return id;
	}
});

<|start_filename|>tests/loremIpsum.html<|end_filename|>
<div>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
	<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
		semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
		porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
		Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
		Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
		risus. </p>
</div>



<|start_filename|>tests/editor/test_FullScreen.html<|end_filename|>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Editor Test: FullScreen Plugin</title>

	<script type="text/javascript" src="../boilerplate.js"></script>

	<script type="text/javascript">
		require([
			"dojo/parser",
			"dijit/Editor",
			"dijit/_editor/plugins/FullScreen",
			"dijit/_editor/plugins/ViewSource",
			"dijit/layout/BorderContainer",
			"dijit/layout/AccordionContainer",
			"dijit/layout/StackContainer",
			"dijit/layout/TabContainer",
			"dijit/layout/ContentPane",
			"dojo/domReady!"
		], function(parser){
			parser.parse();
		});
	</script>
</head>
<body class="claro" role="main">
	<br>
	<br>
	<div>Content before the editor.</div>
	<br>
	<br>
	<div id="editor0" data-dojo-type="dijit/Editor"
		data-dojo-props='"aria-label":"editor0", extraPlugins:["fullscreen"], style:"background-color: white; width: 800px; height: 400px;" '>
		<h1>Full Screen Plugin details</h1>
		<ol>
			<li>The Fullscreen plugin provides an extra button on the toolbar to allow switching the
				editor into 'full screen' mode, meaning the editor takes over the viewport of the
				browser.   This plugin is particularly useful when editing large documents.</li>
			<li>The mode can also be toggled by entering the key command: CTRL-SHIFT-F11
				in the editor pane.</li>
			<li>When it toggled to full screen, it makes
				the editor text pane opaque white so that the contents behind it are not visible.</li>
			<li>When in full screen mode, the plugin attempts to capture the TAB key and allow navigation only between
				the editor toolbar and the editing area, as when in full screen mode, the rest of the page is hidden
				behind the editor.</li>
		</ol>

		<h2>Things to test:</h2>
		<ol>
			<li>Verify that clicking the full screen icon highlights the button appropriately and toggles the full screen mode on.</li>
			<li>Verify that clicking the full screen icon again dehighlites the button and toggles the full screen mode off.</li>
			<li>Click in the editing pane and verify that CTRL-SHIFT-F11 toggles the full screen mode on and off.</li>
			<li>Verify while in full screen mode that TAB seems to behave appropriately.  Please note that FireFox and Internet
				Explorer work the best here.  There are still a few tab control issues in Safari and Chrome.</li>
		</ol>
	</div>
	<br>
	<br>
	<div>Content after the editor.</div>
	<br>
	<h1>BorderContainer with center region containing editor.</h1>
	<div id="bc" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props='style:"width: 600px; height: 500px;"'>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"left", style:"width: 50px;"'>left</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"top", style:"height: 50px;"'>top</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"right", style:"width: 50px;"'>right</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"bottom", style:"height: 50px;"'>bottom</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='region:"center"'>
			<div id="editor1" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor1", extraPlugins:["fullscreen","viewsource"], height:"100%"'>
				<h1>Full Screen Plugin details</h1>
				<ol>
					<li>The Fullscreen plugin provides an extra button on the toolbar to allow switching the
						editor into 'full screen' mode, meaning the editor takes over the viewport of the
						browser.   This plugin is particularly useful when editing large documents.</li>
					<li>The mode can also be toggled by entering the key command: CTRL-SHIFT-F11
						in the editor pane.</li>
					<li>When it toggled to full screen, it makes
						the editor text pane opaque white so that the contents behind it are not visible.</li>
					<li>When in full screen mode, the plugin attempts to capture the TAB key and allow navigation only between
						the editor toolbar and the editing area, as when in full screen mode, the rest of the page is hidden
						behind the editor.</li>
				</ol>
		
				<h2>Things to test:</h2>
				<ol>
					<li>Verify that clicking the full screen icon highlights the button appropriately and toggles the full screen mode on.</li>
					<li>Verify that clicking the full screen icon again dehighlites the button and toggles the full screen mode off.</li>
					<li>Click in the editing pane and verify that CTRL-SHIFT-F11 toggles the full screen mode on and off.</li>
					<li>Verify while in full screen mode that TAB seems to behave appropriately.  Please note that FireFox and Internet
						Explorer work the best here.  There are still a few tab control issues in Safari and Chrome.</li>
				</ol>
			</div>
		</div>
	</div>
	<br>
	<h1>TabContainer with tab containing editor.</h1>
	<div id="tc" data-dojo-type="dijit/layout/TabContainer" data-dojo-props='style:"width: 600px; height: 500px; border-style: solid; border-width: 1px; padding: 0px; margin: 0px;"'>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Editor Tab"'>
			<div id="editor2" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor2", extraPlugins:["fullscreen","viewsource"], height:"100%"'>
				<h1>Full Screen Plugin details</h1>
				<ol>
					<li>The Fullscreen plugin provides an extra button on the toolbar to allow switching the
						editor into 'full screen' mode, meaning the editor takes over the viewport of the
						browser.   This plugin is particularly useful when editing large documents.</li>
					<li>The mode can also be toggled by entering the key command: CTRL-SHIFT-F11
						in the editor pane.</li>
					<li>When it toggled to full screen, it makes
						the editor text pane opaque white so that the contents behind it are not visible.</li>
					<li>When in full screen mode, the plugin attempts to capture the TAB key and allow navigation only between
						the editor toolbar and the editing area, as when in full screen mode, the rest of the page is hidden
						behind the editor.</li>
				</ol>
		
				<h2>Things to test:</h2>
				<ol>
					<li>Verify that clicking the full screen icon highlights the button appropriately and toggles the full screen mode on.</li>
					<li>Verify that clicking the full screen icon again dehighlites the button and toggles the full screen mode off.</li>
					<li>Click in the editing pane and verify that CTRL-SHIFT-F11 toggles the full screen mode on and off.</li>
					<li>Verify while in full screen mode that TAB seems to behave appropriately.  Please note that FireFox and Internet
						Explorer work the best here.  There are still a few tab control issues in Safari and Chrome.</li>
				</ol>
			</div>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Tab 1"'>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Tab 2"'>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Tab 3"'>
		</div>
	</div>
	<br>
	<h1>AccordionContainer with pane containing editor.</h1>
	<div id="ac" data-dojo-type="dijit/layout/AccordionContainer" data-dojo-props='style:"width: 600px; height: 500px; border-style: solid; border-width: 1px; padding: 0px; margin: 0px;"'>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Editor Pane"'>
			<div id="editor3" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor3", extraPlugins:["fullscreen","viewsource"], height:"100%"'>
				<h1>Full Screen Plugin details</h1>
				<ol>
					<li>The Fullscreen plugin provides an extra button on the toolbar to allow switching the
						editor into 'full screen' mode, meaning the editor takes over the viewport of the
						browser.   This plugin is particularly useful when editing large documents.</li>
					<li>The mode can also be toggled by entering the key command: CTRL-SHIFT-F11
						in the editor pane.</li>
					<li>When it toggled to full screen, it makes
						the editor text pane opaque white so that the contents behind it are not visible.</li>
					<li>When in full screen mode, the plugin attempts to capture the TAB key and allow navigation only between
						the editor toolbar and the editing area, as when in full screen mode, the rest of the page is hidden
						behind the editor.</li>
				</ol>
		
				<h2>Things to test:</h2>
				<ol>
					<li>Verify that clicking the full screen icon highlights the button appropriately and toggles the full screen mode on.</li>
					<li>Verify that clicking the full screen icon again dehighlites the button and toggles the full screen mode off.</li>
					<li>Click in the editing pane and verify that CTRL-SHIFT-F11 toggles the full screen mode on and off.</li>
					<li>Verify while in full screen mode that TAB seems to behave appropriately.  Please note that FireFox and Internet
						Explorer work the best here.  There are still a few tab control issues in Safari and Chrome.</li>
				</ol>
			</div>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Pane 1"'>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Pane 2"'>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Pane 3"'>
		</div>
	</div>
	<br>
	<h1>StackContainer with pane containing editor.</h1>
	<div id="sc" data-dojo-type="dijit/layout/StackContainer" data-dojo-props='style:"width: 600px; height: 500px; border-style: solid; border-width: 1px; padding: 0px; margin: 0px;"'>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Editor Pane"'>
			<div id="editor4" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor4", extraPlugins:["fullscreen","viewsource"], height:"100%"'>
				<h1>Full Screen Plugin details</h1>
				<ol>
					<li>The Fullscreen plugin provides an extra button on the toolbar to allow switching the
						editor into 'full screen' mode, meaning the editor takes over the viewport of the
						browser.   This plugin is particularly useful when editing large documents.</li>
					<li>The mode can also be toggled by entering the key command: CTRL-SHIFT-F11
						in the editor pane.</li>
					<li>When it toggled to full screen, it makes
						the editor text pane opaque white so that the contents behind it are not visible.</li>
					<li>When in full screen mode, the plugin attempts to capture the TAB key and allow navigation only between
						the editor toolbar and the editing area, as when in full screen mode, the rest of the page is hidden
						behind the editor.</li>
				</ol>
		
				<h2>Things to test:</h2>
				<ol>
					<li>Verify that clicking the full screen icon highlights the button appropriately and toggles the full screen mode on.</li>
					<li>Verify that clicking the full screen icon again dehighlites the button and toggles the full screen mode off.</li>
					<li>Click in the editing pane and verify that CTRL-SHIFT-F11 toggles the full screen mode on and off.</li>
					<li>Verify while in full screen mode that TAB seems to behave appropriately.  Please note that FireFox and Internet
						Explorer work the best here.  There are still a few tab control issues in Safari and Chrome.</li>
				</ol>
			</div>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Pane 1"'>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Pane 2"'>
		</div>
		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Blank Pane 3"'>
		</div>
	</div>
</body>
</html>


<|start_filename|>tests/editor/EnterKeyHandling.html<|end_filename|>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Editor Test</title>

	<script type="text/javascript" src="../boilerplate.js"></script>


	<script type="text/javascript">
		require([
			"dojo/parser",
			"dijit/_editor/RichText",
			"dijit/Editor",
			"dijit/_editor/plugins/ViewSource",
			"dojo/domReady!"
		], function(parser, RichText){
			// Make editor indent work for paragraphs in addition to lists
			var oldQCE = RichText.prototype.queryCommandEnabled;
			RichText.prototype.queryCommandEnabled = function(command){
				return command == 'indent' || command == 'outdent' || oldQCE.call(this, command);
			};

			parser.parse();
		});
	</script>
</head>

<body class="claro" role="main">
	<h1>Test file for Editor EnterKeyHandling plugin</h1>

	<h2>blockNodeforEnter='BR'</h2>
	<div id="br" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor_br", plugins:[{name:"dijit/_editor/plugins/EnterKeyHandling", blockNodeForEnter:"BR"}, "viewsource"]
		'><p>para 1<br>line 2</p>
		<p>para 2<br>line 2</p>
 	</div>

 	<h2>blockNodeforEnter='DIV'</h2>
	<div id="div" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor_div", plugins:[{name:"dijit/_editor/plugins/EnterKeyHandling", blockNodeForEnter:"DIV"}, "viewsource"]
		'><p>para 1<br>line 2</p>
		<p>para 2<br>line 2</p>
 	</div>

 	<h2>blockNodeforEnter='DIV' split test</h2>
	<div id="div2" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor_div2", plugins:[{name:"dijit/_editor/plugins/EnterKeyHandling", blockNodeForEnter:"DIV"}, "viewsource"]'>
		<div>&nbsp;</div>
		<div id="lineOne">this is a line of text.  It <b id="boldLine0">IS</b> intended to be split up by pressing enter.</div>
		<div>&nbsp;</div>
 	</div>

 	<h2>blockNodeforEnter='DIV' split test style clone</h2>
	<div id="div3" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor_div3", plugins:[{name:"dijit/_editor/plugins/EnterKeyHandling", blockNodeForEnter:"DIV"}, "viewsource"]'>
		<div>&nbsp;</div>
		<div id="lineOne">this is a line of text.  It <b id="boldLine1" style="font-size: 4em">IS</b> intended to be split up by pressing enter.</div>
		<div>&nbsp;</div>
 	</div>

 	<h2>blockNodeforEnter='DIV' split test font clone</h2>
	<div id="div4" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor_div4", plugins:[{name:"dijit/_editor/plugins/EnterKeyHandling", blockNodeForEnter:"DIV"}, "viewsource"]'>
		<div>&nbsp;</div>
		<div id="lineOne">this is a line of text.  It <font id="fontLine1" size="5">IS</font> intended to be split up by pressing enter.</div>
		<div>&nbsp;</div>
 	</div>

 	<h2>blockNodeforEnter='P'</h2>
	<div id="p" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor_p", plugins:[{name:"dijit/_editor/plugins/EnterKeyHandling", blockNodeForEnter:"P"}, "viewsource"]
		'><p>para 1<br>line 2</p>
		<p>para 2<br>line 2</p>
 	</div>
 	
	<h2>blockNodeforEnter='P' split test</h2>
	<div id="p2" data-dojo-type="dijit/Editor" data-dojo-props='"aria-label":"editor_p2", plugins:[{name:"dijit/_editor/plugins/EnterKeyHandling", blockNodeForEnter:"P"}, "viewsource"]'>
		<p>&nbsp;</p>
		<p id="lineOne">this is a line of text.  It <b id="boldLine2">IS</b> intended to be split up by pressing enter.</p>
		<p>&nbsp;</p>
 	</div>
</body>
</html>


<|start_filename|>tests/_Widget-ondijitclick.html<|end_filename|>
<!DOCTYPE html>
<html>
<head>

	<meta http-equiv="Content-type" content="text/html; charset=utf-8">

	<title>Test Dijit Internal Event: "ondijitclick"</title>

	<style>
		div {
			border: 1px solid blue;
			margin: 1em;
		}
	</style>

	<script type="text/javascript" src="../../dojo/dojo.js" data-dojo-config="isDebug: true"></script>
	<script type="text/javascript">
		dojo.require("dijit._WidgetBase");
		dojo.require("dijit._OnDijitClickMixin");
		dojo.require("dojo.parser");

		dojo.ready(function(){
			dojo.declare("WidgetWithOndijitclick", [dijit._WidgetBase, dijit._OnDijitClickMixin], {
				clickCount: 0,
				onClick: function(){
				},
				_onClick: function(evt){
					this.clickCount++;
					this.onClick(evt);
				},
				postCreate: function(){
					this.connect(this.domNode, "ondijitclick", "_onClick");
				}
			});

			dojo.parser.parse();
		});
	</script>
</head>
<body class="claro">
	<h1>_Widget.ondijitclick test</h1>
	<p>
		This tests dijit's infrastructure for catching SPACE and ENTER key clicks on nodes
		that aren't &lt;button&gt; or &lt;a&gt;, and therefore don't normally respond to keyboard
		"click events".
	</p>
	<p>
		Clicking the first widget moves focus to the plain button,
		but that button itself shouldn't get a click event.   (There are some subtleties about
		whether catch clicks on key-down or key-up so this tests to make sure we are doing
		the right one.)
	</p>
	<div id="first" tabIndex="0" data-dojo-type="WidgetWithOndijitclick" data-dojo-props='
			onClick:function(){ dojo.byId("plainbutton").focus(); }'>
		click me using space or enter, to focus button below
	</div>
	<button id="plainbutton" onclick="console.log('plain button clicked'); window.clicked = true;" type="button" >plain button</button>

	<div id="second" tabIndex="0" data-dojo-type="WidgetWithOndijitclick" data-dojo-props='
			onClick:function(){ dojo.byId("textarea").focus(); }'>
		click me using space or enter, to focus textarea below
	</div>
	<textarea id="textarea">hello world</textarea>

	<br>
	<button id="plainbutton2" style="margin-top: 2em;" type="button"
			onClick="dojo.byId('third').focus();">
		click me using space or enter, to focus ondijitclick widget below
	</button>
	<div id="third" tabIndex="0" data-dojo-type="WidgetWithOndijitclick" data-dojo-props='style:"margin-top: 0px;",
			onFocus:function(){ console.log("onfocus on third"); window.onDijitClickFocus = true; },
			onClick:function(){ console.log("onclick on third"); window.spuriousOnDijitClick = true; }'>
		clicking the button above shouldn't cause my ondijitclick handler to fire
	</div>
	<br>
	<div id="fourth" tabIndex="0" data-dojo-type="WidgetWithOndijitclick" data-dojo-props='style:"margin-top: 0px;",
			onClick:function(){ alert("make sure can close this alert via keyboard"); }'>
		Manual Test: Click me using space or enter to launch a JavaScript alert() from element using ondijitclick
	</div>
	<br>
	Clicking this button should produce exactly one click event to console:
	<button id="widgetbutton" tabIndex="0" data-dojo-type="WidgetWithOndijitclick">
		button w/ondijitclick
	</button>

	<div id="outer">
		Test for bubble of click
		<div id="inner">
			<span data-dojo-type="WidgetWithOndijitclick" id="bubbleTestWidget" tabindex="0">click me</span>
			<span data-dojo-type="WidgetWithOndijitclick" id="bubbleTestWidget2" tabindex="0">click me too</span>
		</div>
	</div>
</body>
</html>


<|start_filename|>tests/resources/TestWidget.js<|end_filename|>
define([
	"dojo/_base/declare",
	"dijit/_WidgetBase",
	"dijit/_TemplatedMixin"
], function(declare, _WidgetBase, _TemplatedMixin){
	return declare([_WidgetBase, _TemplatedMixin], {
		templateString: '<div data-dojo-attach-point="fooNode">TestWidget</div>',
		foo: "bar"
	});
});

<|start_filename|>tests/layout/TabContainerTitlePane.html<|end_filename|>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>TabContainer Nested TitlePane Test</title>

	<script src="../boilerplate.js"></script>

	<script type="text/javascript">
		require([
			"doh/runner",
			"dojo/aspect",
			"dojo/parser",
			"dijit/registry",
			"dijit/layout/TabContainer",
			"dijit/layout/ContentPane",
			"dijit/TitlePane",
			"dojo/domReady!"
		], function(doh, aspect, parser,
					registry, TabContainer, ContentPane, TitlePane, helpers){


			var resized = {};


			aspect.after(TabContainer.prototype, "resize", function(){
				resized[this.id] = true;
			});

			parser.parse();

			// Tests that TabContainer.resize() (for the TabContainers nested in TitlePanes)
			// is called at the right time.
			doh.register("resize timing", [
				{
					name: "subtabs1",
					runTest: function(t){
						// Since tab 1 is selected and TitlePane 1 is open, subtabs1 should have resized on parse
						doh.t(resized["subtabs1"], "subtabs1");
						doh.f(resized["subtabs2"], "subtabs2");
						doh.f(resized["subtabs3"], "subtabs3");
					}
				},
				{
					name: "subtabs2",
					runTest: function(t){
						// Since TitlePane 2 is open, subtabs2 should get a resize when tab2 is selected
						registry.byId("mainTabContainer").selectChild(registry.byId("tab2"));
						doh.t(resized["subtabs2"], "subtabs2");
						doh.f(resized["subtabs3"], "subtabs3");
					}
				},
				{
					name: "subtabs3",
					runTest: function(t){
						// Since TitlePane 3 is closed, subtabs3 shouldn't get a resize until tab3 is selected
						// and TitlePane is open
						registry.byId("mainTabContainer").selectChild(registry.byId("tab3"));
						doh.f(resized["subtabs3"], "subtabs3 not sized yet");
						registry.byId("tp3").set("open", true);
						doh.t(resized["subtabs3"], "subtabs3 sized");
					}
				}
			]);

			doh.run();
		});

	</script>

</head>
<body class="claro" role="main">

	<h1 class="testTitle">Dijit layout.TabContainer nested TitlePane tests</h1>

	<div id="mainTabContainer" data-dojo-type="dijit/layout/TabContainer" data-dojo-props='style:"width: 100%; height: 150px;"'>

		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='id: "tab1", title:"Tab 1"'>
			<h1>I am tab 1</h1>
			<div data-dojo-type="dijit/TitlePane" data-dojo-props='id: "tp1", title:"Title pane 1", style:{width:"300px"}'>
				<p>This is a title pane, containing another tab container ...</p>
				<p>
					Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
				</p>
				<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props='id: "subtabs1", style:"width: 100%; height: 150px;"'>
					<div id="tab1_1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab1.html", title:"Tab 1"'></div>
					<div id="tab1_2" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab2.html", refreshOnShow:true, title:"Tab 2", selected:true'></div>
				</div>
			</div>
		</div>

		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='id: "tab2", title:"Tab 2"'>
			<h1>I am tab 2</h1>
			<div data-dojo-type="dijit/TitlePane" data-dojo-props='id: "tp2", title:"Title pane 2", style:{width:"300px"}'>
				<p>This is a title pane, containing another tab container ...</p>
				<p>
					Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
				</p>
				<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props='id: "subtabs2", style:"width: 100%; height: 150px;"'>
					<div id="tab2_1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab1.html", title:"Tab 1"'></div>
					<div id="tab2_2" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab2.html", refreshOnShow:true, title:"Tab 2", selected:true'></div>
				</div>
			</div>
		</div>

		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='id: "tab3", title:"Tab 3"'>
			<h1>I am tab 3</h1>
			<div data-dojo-type="dijit/TitlePane" data-dojo-props='id: "tp3", title:"Title pane 3", style:{width:"300px"}, open: false'>
				<p>This is a title pane, containing another tab container ...</p>
				<p>
					Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque iaculis, nulla id semper faucibus, pede tellus nonummy magna, vitae adipiscing orci arcu ut augue. Nunc condimentum, magna a vestibulum convallis, libero purus pulvinar orci, sed vestibulum urna sem ut pede. More Ipsum...
				</p>
				<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props='id: "subtabs3", style:"width: 100%; height: 150px;"'>
					<div id="tab3_1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab1.html", title:"Tab 1"'></div>
					<div id="tab3_2" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab2.html", refreshOnShow:true, title:"Tab 2", selected:true'></div>
				</div>
			</div>
		</div>

		<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props='id: "hrefTab", href:"tab2.html", title:"Href Tab"'></div>
	</div>

	<h3>Rendering time</h3>

</body>
</html>


<|start_filename|>tests/layout/doc0.html<|end_filename|>
<h1>Document 0</h1>
This document has <a href="http://www.dojotoolkit.org/">a link</a>.<br />
(to check we're copying children around properly).<br />
Plus some widgets and native fields:<br />
<input value="native input" aria-label="native input" />
<select data-dojo-type="dijit/form/ComboBox" aria-label="select box doc 0">
	<option value="1">dijit</option>
	<option value="2">form</option>
	<option value="3">ComboBox</option>
</select>
<button>native button</button>
<button data-dojo-type="dijit/form/Button">dijit/form/Button</button><br>

Here's some text that comes AFTER the button.


<|start_filename|>tests/editor/BackForwardState.html<|end_filename|>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Editor Back/Forward Button Test</title>

	<script type="text/javascript" src="../boilerplate.js"></script>

	<script type="text/javascript">
		require([
			"dojo/parser",
			"dijit/Editor",
			"dojo/domReady!"
		], function(parser){
			parser.parse();
		});
	</script>
</head>

<body class="claro" role="main">
	<h1>Editor back/forward button value restore tests</h1>
	<p>
		Try typing something into the editors below, and then click the page refrsh link or the back then forward buttons.
		The editor should not lose the value.
	</p>
	<p>Notes:</p>
	<ol>
		<li>Editor must have a "name" attribute for this to work (not sure why)
		<li>If in XD mode must set dojo.config.allowXdRichTextSave or manually create the hidden
			&lt;textarea&gt; node used to preserve the data.
	</ol>
	<p><a href="BackForwardStateHelper.html" id="away">Navigate to another page</a></p>

	<div id="editor0" data-dojo-type="dijit/Editor" aria-label="editor0" data-dojo-props='name:"editor0", height:"100", plugins:[]'>editor0 original contents</div>
	<div id="editor1" data-dojo-type="dijit/Editor" aria-label="editor1" data-dojo-props='name:"editor1", height:"100", plugins:[]'>editor1 original contents</div>
	<textarea id="dijit._editor.RichText.value" style="display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;"></textarea>
</body>
</html>


<|start_filename|>tests/AsyncMemoryStore.js<|end_filename|>
define([
	"dojo/_base/declare",
	"dojo/Deferred",
	"dojo/store/Memory",
	"dojo/store/util/QueryResults",
	"dojo/store/util/SimpleQueryEngine"
], function(declare, Deferred, Memory, QueryResults, SimpleQueryEngine){

	// module:
	//		dijit/tests/AsyncMemoryStore

	return declare(null, {
		// summary:
		//		Wrapper on dojo/store/Memory that makes functions async (for testing)

		queryEngine: SimpleQueryEngine,

		constructor: function(hash){
			this.store = new Memory(hash);
		},

		get: function(id){
			var d = new Deferred(), store = this.store;
			try{
				d.resolve(store.get(id));
			}catch(e){
				d.reject(e);
			}
			return d;
		},

		getIdentity: function(object){
			return this.store.getIdentity(object);
		},

		put: function(object, directives){
			return this.store.put(object, directives);
		},

		add: function(object, directives){
			return this.store.add(object, directives);
		},

		remove: function(id){
			return this.store.remove(id);

		},

		query: function(query, options){
			var d = new Deferred(), store = this.store;
			setTimeout(function(){
				try{
					d.resolve(store.query(query, options));
				}catch(e){
					d.reject(e);
				}
			}, 10);
			return QueryResults(d);
		}
	});
});


<|start_filename|>tests/_BidiSupport/BidiSupportModule/module.js<|end_filename|>
define([
	"./BidiSupportTest"
], 1);

<|start_filename|>tests/_testCommon.js<|end_filename|>
// module:
//		dijit/tests/_testCommon.js
// description:
//		Deprecated, remove in 2.0.   New test files should use boilerplate.html rather than this file,
//		and non-test files shouldn't be using either.

require([
	"require",
	"dojo/_base/array",
	"dojo/_base/config",
	"dojo/dom",
	"dojo/dom-attr",
	"dojo/dom-class",
	"dojo/dom-construct",
	"dojo/_base/kernel",
	"dojo/_base/lang",
	"dojo/query",
	"dojo/ready",
	"dojo/_base/window"
], function(require, array, config, dom, domAttr, domClass, domConstruct, kernel, lang, query, ready, win){

	var dir = "",
		theme = false,
		themeModule = "dijit",
		testMode = null,
		defTheme = "claro",
		vars={};

	if(window.location.href.indexOf("?") > -1){
		var str = window.location.href.substr(window.location.href.indexOf("?")+1).split(/#/);
		var ary  = str[0].split(/&/);
		for(var i=0; i<ary.length; i++){
			var split = ary[i].split("="),
				key = split[0],
				value = (split[1]||'').replace(/[^\w]/g, "");	// replace() to prevent XSS attack
			switch(key){
				case "locale":
					// locale string | null
					kernel.locale = config.locale = locale = value;
					break;
				case "dir":
					// rtl | null
					document.getElementsByTagName("html")[0].dir = value;
					dir = value;
					break;
				case "theme":
					// tundra | soria | nihilo | claro | null
					theme = value;
					break;
				case "a11y":
					if(value){ testMode = "dj_a11y"; }
					break;
				case "themeModule":
					// moduleName | null
					if(value){ themeModule = value; }
			}
			vars[key] = value;
		}
	}
	kernel._getVar = function(k, def){	// TODO: not sure what this is
		return vars[k] || def;
	};

	// BIDI
	if(dir == "rtl"){
		ready(0, function(){
			// pretend all the labels are in an RTL language, because
			// that affects how they lay out relative to inline form widgets
			query("label").attr("dir", "rtl");
		});
	}

	// a11y
	if(testMode){
		ready(0, function(){
			var b = win.body();
			if(testMode){
				domClass.add(b, testMode);
			}
		});
	}

	// If URL specifies a non-claro theme then pull in those theme CSS files and modify
	// <body> to point to that new theme instead of claro.
	//
	// Also defer parsing and any dojo.ready() calls that the test file makes
	// until the CSS has finished loading.
	if(theme){
		// Wait until JS modules have finished loading so this doesn't confuse
		// AMD loader.
		ready(1, function(){
			// Reset <body> to point to the specified theme
			var b = win.body();
			domClass.replace(b, theme, defTheme);

			// Remove claro CSS
			query('link[href$="claro.css"]').orphan();
			query('link[href$="claro/document.css"]').orphan();

			// Load theme CSS.
			// Eventually would like to use [something like]
			// https://github.com/unscriptable/curl/blob/master/src/curl/plugin/css.js
			// to load the CSS and then know exactly when it finishes loading.
			var modules = [
				require.toUrl(themeModule+"/themes/"+theme+"/"+theme+".css"),
				require.toUrl(themeModule+"/themes/"+theme+"/"+theme+"_rtl.css"),
				require.toUrl("dojo/resources/dojo.css")
			];
			var head = query("head")[0];
			array.forEach(modules, function(css){
				if(document.createStyleSheet){
					// For IE
					document.createStyleSheet(css);
				}else{
					// For other browsers
					domConstruct.place('<link rel="stylesheet" type="text/css" href="'+css+'"/>',
						head);
				}
			});
		});
		ready(2, function(){
			// Delay parsing and other dojo.ready() callbacks (except ones in this file)
			// until the injected <link>'s above have finished loading.
			require(["dijit/tests/delay!320"]);
		});
	}
});


<|start_filename|>tests/boilerplateOnload.js<|end_filename|>
// Part of boilerplate.js but need to put it in a separate file for IE9, so it doesn't run until dojo has finished
// loading and require is defined
require(["dojo/domReady!"], boilerplateOnLoad);


<|start_filename|>tests/_data/geography.js<|end_filename|>
// Array of countries and cities, with children having references to their parents rather than vice-versa.
// Used with dijit/tree/ObjectStoreModel.

define([
	{ id: "earth", name:"The earth", type:"planet", population: "6 billion"},
	{ id: "AF", name:"Africa", type:"continent", population:"900 million", area: "30,221,532 sq km",
		timezone: "-1 UTC to +4 UTC", parent: "earth"},
	{ id: "EG", name:"Egypt", type:"country", parent: "AF" },
	{ id: "KE", name:"Kenya", type:"country", parent: "AF" },
	{ id: "Nairobi", name:"Nairobi", type:"city", parent: "KE" },
	{ id: "Mombasa", name:"Mombasa", type:"city", parent: "KE" },
	{ id: "SD", name:"Sudan", type:"country", parent: "AF" },
	{ id: "Khartoum", name:"Khartoum", type:"city", parent: "SD" },
	{ id: "AS", name:"Asia", type:"continent", parent: "earth" },
	{ id: "CN", name:"China", type:"country", parent: "AS" },
	{ id: "IN", name:"India", type:"country", parent: "AS" },
	{ id: "RU", name:"Russia", type:"country", parent: "AS" },
	{ id: "MN", name:"Mongolia", type:"country", parent: "AS" },
	{ id: "OC", name:"Oceania", type:"continent", population:"21 million", parent: "earth"},
	{ id: "AU", name:"Australia", type:"country", population:"21 million", parent: "OC"},
	{ id: "EU", name:"Europe", type:"continent", parent: "earth" },
	{ id: "DE", name:"Germany", type:"country", parent: "EU" },
	{ id: "FR", name:"France", type:"country", parent: "EU" },
	{ id: "ES", name:"Spain", type:"country", parent: "EU" },
	{ id: "IT", name:"Italy", type:"country", parent: "EU" },
	{ id: "NA", name:"North America", type:"continent", parent: "earth" },
	{ id: "MX", name:"Mexico", type:"country",  population:"108 million", area:"1,972,550 sq km", parent: "NA" },
	{ id: "Mexico City", name:"Mexico City", type:"city", population:"19 million", timezone:"-6 UTC", parent: "MX"},
	{ id: "Guadalajara", name:"Guadalajara", type:"city", population:"4 million", timezone:"-6 UTC", parent: "MX" },
	{ id: "CA", name:"Canada", type:"country",  population:"33 million", area:"9,984,670 sq km", parent: "NA" },
	{ id: "Ottawa", name:"Ottawa", type:"city", population:"0.9 million", timezone:"-5 UTC", parent: "CA"},
	{ id: "Toronto", name:"Toronto", type:"city", population:"2.5 million", timezone:"-5 UTC", parent: "CA" },
	{ id: "US", name:"United States of America", type:"country", parent: "NA" },
	{ id: "SA", name:"South America", type:"continent", parent: "earth" },
	{ id: "BR", name:"Brazil", type:"country", population:"186 million", parent: "SA" },
	{ id: "AR", name:"Argentina", type:"country", population:"40 million", parent: "SA" }
]);

<|start_filename|>tests/resources/TestContextRequireWidget.js<|end_filename|>
define([
	"require",
	"dojo/_base/declare",
	"dijit/_WidgetBase",
	"dijit/_TemplatedMixin",
	"dijit/_WidgetsInTemplateMixin",
	"./TestWidget"
], function(require, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin){

	// This module requires utilises a relative MID in the template.  Because of the synchronous nature of the widget
	// lifecycle, you need to require in any modules in the template into the parent module (as auto-require will not
	// work) as well as require in the context require and pass it as part of the declare.
	return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
		templateString: '<div><div data-dojo-type="./TestWidget" data-dojo-attach-point="fooNode"></div></div>',
		contextRequire: require
	});
});

<|start_filename|>tests/_BidiSupport/tree/module.js<|end_filename|>
define(["doh/main", "require"], function(doh, require){

	doh.register("_BidiSupport.tree.ProgrammaticTree.html", require.toUrl("./ProgrammaticTree.html"), 999999);

});


<|start_filename|>tests/_BidiSupport/inheritance/module.js<|end_filename|>
define(["doh/main", "require"], function(doh, require){

	doh.register("_BidiSupport.inheritance.Inher-Simple", require.toUrl("./Inher-Simple.html"), 999999);

	doh.register("_BidiSupport.inheritance.Inher-MarkupContainers", require.toUrl("./Inher-MarkupContainers.html"), 999999);

	doh.register("_BidiSupport.inheritance.Inher-ComplexMarkupContainers", require.toUrl("./Inher-ComplexMarkupContainers.html"), 999999);

});


<|start_filename|>tests/_base/module.js<|end_filename|>
define(["doh/main", "require", "dojo/sniff"], function(doh, require, has){

	var test_robot = !has("ios") && !has("android");

	doh.register("_base.manager", require.toUrl("./manager.html"), 999999);
	doh.register("_base.wai", require.toUrl("./wai.html"), 999999);
	doh.register("_base.place", require.toUrl("./place.html"), 999999);
	doh.register("_base.popup", require.toUrl("./popup.html"), 999999);
	if(test_robot){
		doh.register("_base.robot.CrossWindow", require.toUrl("./robot/CrossWindow.html"), 999999);
		doh.register("_base.robot.FocusManager", require.toUrl("./robot/FocusManager.html"), 999999);
		doh.register("_base.robot.focus_mouse", require.toUrl("./robot/focus_mouse.html"), 999999);
	}

});


<|start_filename|>tests/editor/test_TabIndent.html<|end_filename|>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Editor TabIndent Plugin Test</title>

	<script type="text/javascript" src="../boilerplate.js"></script>

	<script type="text/javascript">
		require([
			"dojo/parser",
			"dijit/Editor",
			"dijit/_editor/plugins/TabIndent",
			"dojo/domReady!"
		], function(parser){
			parser.parse();
		});
	</script>
</head>
<body class="claro" role="main">
	<p>Paragraph with focusable <span tabindex="0" style="color:blue">item </span>before editor. </p>
	<label>Test TabIndent Plugin</label>
	<div style="border: 1px dotted black;">
	
		<div id="tiTest" data-dojo-type="dijit/Editor"
			data-dojo-props='"aria-label":"tiTest",extraPlugins:["tabIndent"]'>
			<div>
				<ol>
				<li>the tabIndent plugin allows the use of the tab and shift-tab keys to
indent list items.</li>
				<li>another list element</li>
				<li>and another</li>
				<li>still one more</li>
				</ol>
			</div>
			<p>
				Ctrl-M also turns tab indent on/off.
				(The buttons should change checked status when the user types
				Ctrl-M, to indicate whether tab and shift-tab is enabled.)
			</p>
		</div>
	</div>
	<p>Paragraph with focusable <span tabindex="0" style="color:blue">item </span>after editor. </p>
</body>
</html>


<|start_filename|>tests/editor/test_ToggleDir.html<|end_filename|>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Editor Test: ToggleDir Plugin</title>

	<script type="text/javascript" src="../boilerplate.js"></script>

	<script type="text/javascript">
		require([
			"dojo/parser",
			"dijit/Editor",
			"dijit/_editor/plugins/ToggleDir",
			"dojo/domReady!"
		], function(parser){
			parser.parse();
		});
	</script>
</head>
<body class="claro" role="main">
	<h3 id="ltr_label">LTR Editor</h3>
	<div id="ltr_ed" data-dojo-type="dijit/Editor"  aria-labelledby="ltr_label"
		 data-dojo-props='extraPlugins:["dijit/_editor/plugins/ToggleDir"], height: 100'>
		<ol><li>the toggleDir plugin provides an extra button to switch text direction (BiDi). Useful when right-to-left
				languages are used with left-to-right languages.</li></ol>
	</div>

	<h3 id="rtl_label">RTL Editor</h3>
	<div id="rtl_ed" data-dojo-type="dijit/Editor" aria-labelledby="rtl_label" dir="rtl"
		 data-dojo-props='extraPlugins:["dijit/_editor/plugins/ToggleDir"], height: 100'>
		<ol><li>the toggleDir plugin provides an extra button to switch text direction (BiDi). Useful when right-to-left
			languages are used with left-to-right languages.</li></ol>
	</div>
</body>
</html>


<|start_filename|>tests/focus-framedojo.html<|end_filename|>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Focus Issue</title>
	<style type="text/css">
		@import "../themes/claro/claro.css";
	</style>
</head>
<body class="claro">
	<p>
		Test case for focus code when dojo is loaded into an iframe.
		Not supported officially but checking in test case anyway.
	</p>

	<p>Automated test will focus this input, causing a console message:</p>
	<input id="input">

	<p>Dojo is loaded into this iframe:</p>
	<iframe style="width:100%;height:2em;" src="./focus-framedojo-child.html"></iframe>
</body>
</html>


<|start_filename|>tests/i18n/test_i18n.js<|end_filename|>
var validateValues = [];
var formatWidgetCount = 0;
var validateWidgetCount = 0;

function getElementsById(id){
	var result = [];

	if(!id || typeof(id) != "string"){
		return result;
	}

	var ae = document.getElementsByTagName(dojo.byId(id).tagName);
	for(var i = 0; i < ae.length; i++){
		if(ae[i].id == id){
			result.push(ae[i]);
		}
	}
	return result;
}

function getString(n){
	return n && n.toString();
}

function startTest(t){
	startTestFormat(t);
	startTestValidate(t);
}

function getAllTestCases(){
	var allTestCases = [];
	for(var i = 0; i < formatWidgetCount; i++){
		allTestCases.push({
			name: "format-" + i,
			runTest: new Function("t", "startTestFormat(" + i + ", t)")
		});
	}
	for(i = 0; i < validateWidgetCount; i++){
		allTestCases.push({
			name: "validate-" + i,
			runTest: new Function("t", "startTestValidate(" + i + ", t)")
		});
	}
	return allTestCases;
}

function startTestFormat(i, t){
	var test_node = dojo.doc.getElementById("test_display_" + i);
	var exp = dojo.doc.getElementById("test_display_expected_" + i).value;
	var res_node = dojo.doc.getElementById("test_display_result_" + i);
	res_node.innerHTML = test_node.value;
	res_node.style.backgroundColor = (test_node.value == exp) ? "#AFA" : "#FAA";
	res_node.innerHTML += " <a style='font-size:0.8em' href='javascript:alert(\"Expected: " + encodeURIComponent(exp) + "\\n Result: " + encodeURIComponent(test_node.value) + "\")'>Compare (Escaped)</a>";
	t.is(exp, test_node.value);
}

function startTestValidate(i, t){
	var test_node = dojo.doc.getElementById("test_validate_" + i);
	var inp_node = dojo.doc.getElementById("test_validate_input_" + i);
	var exp = dojo.doc.getElementById("test_validate_expected_" + i).innerHTML;
	var res_node = dojo.doc.getElementById("test_validate_result_" + i);
	var val_node = dojo.doc.getElementById("test_display_value_" + i);

	test_node.value = inp_node.value;

	var widget = widget = dijit.getEnclosingWidget(test_node);

	if(widget){
		widget.focus();

		var expected = validateValues[i];
		var result = widget.getValue();
		if(validateValues[i].processValue){
			expected = validateValues[i].processValue(expected);
			result = validateValues[i].processValue(result);
		}
		var parseCorrect = getString(expected) == getString(result);
		val_node.style.backgroundColor = parseCorrect ?  "#AFA" : "#FAA";
		val_node.innerHTML = getString(result) + (parseCorrect ? "" : "<br>Expected: " + getString(expected));

		res_node.innerHTML = widget.isValid && !widget.isValid() ? "Wrong" : "Correct";
		res_node.style.backgroundColor = res_node.innerHTML == exp ? "#AFA" : "#FAA";

		t.is(getString(expected), getString(result));
	}
}

function genFormatTestCase(desc, dojoType, dojoAttrs, value, expValue, comment){
	var res = "";
	res += "<tr>";
	res += "<td>" + desc + "</td>";
	res += "<td>";
	res += "<input id='test_display_" + formatWidgetCount + "' type='text' value='" + value + "' ";
	res += "dojoType='" + dojoType + "' ";
	for(var attr in dojoAttrs){
		res += attr + "=\"" + dojoAttrs[attr] + "\" ";
	}
	res += "/>";
	res += "</td>";
	res += "<td><input id='test_display_expected_" + formatWidgetCount + "' value='" + expValue + "'></td>";
	res += "<td id='test_display_result_" + formatWidgetCount + "'></td>";
	res += "<td style='white-space:normal'>" + comment + "</td>";
	res += "</tr>";
	formatWidgetCount++;
	
	return res;
}
/*
[
	{attrs: {currency: "CNY", lang: "zh-cn"}, desc: "", value:"-123456789.46", expValue: "", comment: ""},
	...
]
*/
function genFormatTestCases(title, dojoType, testCases){
	var res = "";
	res += "<h2 class=testTitle>" + title + "</h2>";
	res += "<table border=1>";
	res += "<tr>";
	res += "<td class=title><b>Test Description</b></td>";
	res += "<td class=title><b>Test</b></td>";
	res += "<td class=title><b>Expected</b></td>";
	res += "<td class=title><b>Result</b></td>";
	res += "<td class=title><b>Comment</b></td>";
	res += "</tr>";

	for(var i = 0; i < testCases.length; i++){
		var testCase = testCases[i];
		res += genFormatTestCase(testCase.desc, dojoType, testCase.attrs, testCase.value, testCase.expValue, testCase.comment);
	}

	res += "</table>";
	
	dojo.place(res, dojo.body());
}

function genValidateTestCase(desc, dojoType, dojoAttrs, input, value, comment, isWrong){
	var res = "";
	res += "<tr>";
	res += "<td>" + desc + "</td>";
	res += "<td>";
	res += "<input id='test_validate_" + validateWidgetCount + "' type='text' ";
	res += "dojoType='" + dojoType + "' ";
	for(var attr in dojoAttrs){
		res += attr + "=\"" + dojoAttrs[attr] + "\" ";
	}
	res += "/>";
	res += "</td>";
	res += "<td><input id='test_validate_input_" + validateWidgetCount + "' value='" + input + "'></td>";
	res += "<td id='test_display_value_" + validateWidgetCount + "'></td>";
	res += "<td id='test_validate_expected_" + validateWidgetCount + "'>" + (isWrong ? "Wrong" : "Correct") + "</td>";
	res += "<td id='test_validate_result_" + validateWidgetCount + "'></td>";
	res += "<td style='white-space:normal'>" + comment + "</td>";
	res += "</tr>";
	validateValues.push(value);
	validateWidgetCount++;
	
	return res;
}
/*
[
	{attrs: {currency: "CNY", lang: "zh-cn"}, desc: "", value:false, expValue: "-123456789.46", comment: ""},
	...
]
*/
function genValidateTestCases(title, dojoType, testCases){
	var res = "";
	res += "<h2 class=testTitle>" + title + "</h2>";
	res += "<table border=1>";
	res += "<tr>";
	res += "<td class=title><b>Test Description</b></td>";
	res += "<td class=title><b>Test</b></td>";
	res += "<td class=title><b>Input</b></td>";
	res += "<td class=title><b>Parsed Value</b></td>";
	res += "<td class=title><b>Expected</b></td>";
	res += "<td class=title><b>Result</b></td>";
	res += "<td class=title><b>Comment</b></td>";
	res += "</tr>";

	for(var i = 0; i < testCases.length; i++){
		var testCase = testCases[i];
		res += genValidateTestCase(testCase.desc, dojoType, testCase.attrs, testCase.expValue, testCase.value, testCase.comment, testCase.isWrong);
	}

	res += "</table>";
	dojo.place(res, dojo.body());
}


<|start_filename|>tests/infrastructure-module.js<|end_filename|>
define(["doh/main", "require", "dojo/sniff"], function(doh, require, has){

	var test_robot = !has("ios") && !has("android");

	// Utility methods (previously in dijit/_base)
	doh.register("registry", require.toUrl("./registry.html"), 999999);
	doh.register("focus", require.toUrl("./focus.html"), 999999);
	doh.register("place", require.toUrl("./place.html"), 999999);
	doh.register("place-margin", require.toUrl("./place-margin.html"), 999999);
	doh.register("place-clip", require.toUrl("./place-clip.html"), 999999);
	doh.register("popup", require.toUrl("./popup.html"), 999999);
	doh.register("a11y", require.toUrl("./a11y.html"), 999999);
	if(test_robot){
		doh.register("robot.typematic", require.toUrl("./robot/typematic.html"), 999999);
	}

	// _Widget
	doh.register("_Widget-lifecycle", require.toUrl("./_Widget-lifecycle.html"), 999999);
	doh.register("_Widget-attr", require.toUrl("./_Widget-attr.html"), 999999);
	doh.register("_Widget-subscribe", require.toUrl("./_Widget-subscribe.html"), 999999);
	doh.register("_Widget-placeAt", require.toUrl("./_Widget-placeAt.html"), 999999);
	doh.register("_Widget-on", require.toUrl("./_Widget-on.html"), 999999);
	if(test_robot){
		doh.register("robot._Widget-deferredConnect", require.toUrl("./robot/_Widget-deferredConnect.html"), 999999);
		doh.register("robot._Widget-ondijitclick_mouse", require.toUrl("./robot/_Widget-ondijitclick_mouse.html"), 999999);
		doh.register("robot._Widget-ondijitclick_a11y", require.toUrl("./robot/_Widget-ondijitclick_a11y.html"), 999999);
	}

	// _Templated and other mixins
	doh.register("_AttachMixin", require.toUrl("./_AttachMixin.html"), 999999);
	doh.register("_TemplatedMixin", require.toUrl("./_TemplatedMixin.html"), 999999);
	doh.register("_WidgetsInTemplateMixin", require.toUrl("./_WidgetsInTemplateMixin.html"), 999999);
	doh.register("_Templated-widgetsInTemplate1.x", require.toUrl("./_Templated-widgetsInTemplate1.x.html"), 999999);
	doh.register("_Container", require.toUrl("./_Container.html"), 999999);
	doh.register("_KeyNavContainer", require.toUrl("./_KeyNavContainer.html"), 999999);
	if(test_robot){
		doh.register("robot._KeyNavContainer", require.toUrl("./robot/_KeyNavContainer.html"), 999999);
	}
	doh.register("_HasDropDown", require.toUrl("./_HasDropDown.html"), 999999);

	doh.register("Declaration", require.toUrl("./test_Declaration.html"), 999999);
	doh.register("Declaration_1.x", require.toUrl("./test_Declaration_1.x.html"), 999999);

	// Miscellaneous
	doh.register("NodeList-instantiate", require.toUrl("./NodeList-instantiate.html"), 999999);
	doh.register("Destroyable", require.toUrl("./Destroyable.html"), 999999);
	if(test_robot){
		doh.register("robot.BgIframe", require.toUrl("./robot/BgIframe.html"), 999999);
	}

});


<|start_filename|>tests/_BidiSupport/module.js<|end_filename|>
define([
	"./layout/module",
	"./misc/module",
	"./form/module",
	"./BidiSupportModule/module",
	"./inheritance/module",
	"./dynamicallyChangeTextDir/module",
	"./tree/module"
], 1);


<|start_filename|>tests/_BidiSupport/misc/module.js<|end_filename|>
define(["doh/main", "require"], function(doh, require){

	doh.register("_BidiSupport.misc.Tooltip.html", require.toUrl("./Tooltip.html"), 999999);
	doh.register("_BidiSupport.misc.Dialog.html", require.toUrl("./Dialog.html"), 999999);
	doh.register("_BidiSupport.misc.TooltipDialog.html", require.toUrl("./TooltipDialog.html"), 999999);
	doh.register("_BidiSupport.misc.MenuItem.html", require.toUrl("./MenuItem.html"), 999999);
	doh.register("_BidiSupport.layout.TitlePane", require.toUrl("./TitlePane.html"), 999999);

});


<|start_filename|>tests/layout/test_TabContainer_noLayout.html<|end_filename|>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>TabContainer doLayout=false Demo</title>

	<script src="../boilerplate.js"></script>

	<script type="text/javascript">
		function testClose(pane,tab){
			return confirm("Please confirm that you want tab "+tab.title+" closed");
		}

		require([
			"dojo/parser",
			"dijit/registry",
			"dijit/layout/ContentPane",
			"dijit/layout/TabContainer",
			"dijit/Tooltip",
			"dojo/domReady!"
		], function(parser, registry, ContentPane){

			var tab = 6;

			addTab = function(){
				cp = new ContentPane({id: 'newTab' + tab, title: 'Tab' + tab, closable: true});
				cp.domNode.innerHTML = "Contents of Tab " + tab++;
				registry.byId("plainTabContainer").addChild(cp);
			};

			parser.parse();
		});
	</script>
</head>
<body class="claro" role="main">

	<script type="dojo/require">
		registry: "dijit/registry"
	</script>

	<h1 class="testTitle">Dijit layout.TabContainer doLayout=false tests</h1>

	<p>
		This tests tabs in doLayout=false mode, in which case the tab container's height ==
		the height of the currently selected tab.
	</p>
	<p>
		With doLayout=false mode tabs only (the default) tabPosition=top is supported.
	</p>

	<button id="addTabButton" onclick="addTab();">add tab</button>
	<button id="destroyTabContainer" onclick="registry.byId('plainTabContainer').destroyRecursive();">destroy tab container</button>

	<div id="plainTabContainer" data-dojo-type="dijit/layout/TabContainer" data-dojo-props='doLayout:false, style:"width: 700px;"'>

		<div id="tab1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab1.html", title:"Tab 1"'></div>

		<div id="tab2" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab2.html", refreshOnShow:true, title:"Tab 2", selected:true'></div>

		<div id="tab3" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Tab 3"'>
			<h1 id="h3">I am tab 3</h1>
			<p id="p3">And I was already part of the page! That's cool, no?</p>
			<span id="foo">tooltip on this span</span>
			<div data-dojo-type="dijit/Tooltip" data-dojo-props='connectId:["foo"]'>I'm a tooltip!</div>
			<button id="b3" data-dojo-type="dijit/form/Button">I'm a button </button>
			<br>
			<button id="b4" data-dojo-type="dijit/form/Button">So am I!</button>
			<p id="p4">
			Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
			semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
			porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
			Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
			Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
			risus.
			</p>
			<p id="p5">Aliquam vitae enim. Duis scelerisque metus auctor est venenatis
			imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem
			nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in
			massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In
			pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra
			quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia,
			felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut
			quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla
			rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut
			semper velit ante id metus. Praesent massa dolor, porttitor sed,
			pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit
			tortor pharetra congue. Suspendisse pulvinar.
			</p>
		</div>

		<div id="tab4" data-dojo-type="dijit/layout/TabContainer" data-dojo-props='title:"Tab 4", doLayout:false, nested:true'>
			<div id="tab4a" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab1.html"' title="SubTab 1"></div>
			<div id="tab4b" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab2.html", selected:true' title="SubTab 2"></div>
		</div>

		<div id="tab5" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab3_noLayout.html", doLayout:false' title="Tab 5"></div>
	</div>

	<p id="textAfterTabContainer1">
		Some text here.  This should appear directly below the TabContainer,
		and the position will change based on the current height of the TabContainer.
	</p>

	<p>No width specified but inside a table w/width=400px:</p>
	<table>
		<tr>
			<td style="width:400px; max-width:400px; border:1px solid red">
				<div id="tableTabContainer" data-dojo-type="dijit/layout/TabContainer" data-dojo-props='doLayout:false'>
			
					<div id="atab1" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab1.html", title:"Tab 1"'></div>
			
					<div id="atab2" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab2.html", refreshOnShow:true, title:"Tab 2", selected:true'></div>
			
					<div id="atab3" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='title:"Tab 3"'>
						<h1 id="h4">I am tab 3</h1>
						<p id="p6">And I was already part of the page! That's cool, no?</p>
						<span id="foo2">tooltip on this span</span>
						<div data-dojo-type="dijit/Tooltip" data-dojo-props='connectId:["foo2"]'>I'm a tooltip!</div>
						<button id="b5" data-dojo-type="dijit/form/Button">I'm a button </button>
						<br>
						<button id="b6" data-dojo-type="dijit/form/Button">So am I!</button>
						<p id="p7">
						Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
						semper sagittis velit. Cras in mi. Duis porta mauris ut ligula. Proin
						porta rutrum lacus. Etiam consequat scelerisque quam. Nulla facilisi.
						Maecenas luctus venenatis nulla. In sit amet dui non mi semper iaculis.
						Sed molestie tortor at ipsum. Morbi dictum rutrum magna. Sed vitae
						risus.
						</p>
						<p id="p8">Aliquam vitae enim. Duis scelerisque metus auctor est venenatis
						imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem
						nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in
						massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In
						pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra
						quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia,
						felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut
						quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla
						rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut
						semper velit ante id metus. Praesent massa dolor, porttitor sed,
						pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit
						tortor pharetra congue. Suspendisse pulvinar.
						</p>
					</div>
			
					<div id="atab4" data-dojo-type="dijit/layout/TabContainer" data-dojo-props='title:"Tab 4", nested:true, doLayout:false'>
						<div id="atab4a" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab1.html"' title="SubTab 1"></div>
						<div id="atab4b" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab2.html", selected:true' title="SubTab 2"></div>
					</div>
			
					<div id="atab5" data-dojo-type="dijit/layout/ContentPane" data-dojo-props='href:"tab3_noLayout.html", doLayout:false' title="Tab 5"></div>
				</div>
			</td>
			</tr>
	</table>
	
	<p id="textAfterTabContainer2">
		Some text here.  This should appear directly below the TabContainer,
		and the position will change based on the current height of the TabContainer.
	</p>

</body>
</html>


<|start_filename|>tests/tree/robot/Tree_dnd.js<|end_filename|>
/*
 * Helper functions for Tree_dnd.html and Tree_dnd_multiParent.html tests
 */

define([
	"doh/runner", "dojo/robotx",
	"dojo/_base/array", "dojo/dnd/autoscroll", "dojo/dom", "dojo/dom-geometry", "dojo/query", "dojo/_base/window",
	"dijit/tests/helpers"
], function(doh, robot, array, autoscroll, dom, domGeom, query, win, helpers){

	var exports = {
		setup: function setup(){
			doh.register("setup screen", function(){
				// Hide boilerplate text so it's easier to drag on small screen
				query("h1,h2,p", robot.doc).style("display", "none");

				// Disable auto-scrolling because otherwise the viewport scrolls as robot.mouseMoveAt()
				// moves the mouse, literally making the the drop target a moving target
				// (and mouseMoveAt() doesn't take this possibility into account).
				autoscroll.autoScrollNodes = function(){};

				// Scroll viewport to (try to) make sure that both tree and drag-source
				// are simultaneously in view.
				var scroll = domGeom.position(dom.byId("1001", robot.doc)).y;
				win.body(robot.doc).parentNode.scrollTop = scroll;	// works on FF
				win.body(robot.doc).scrollTop = scroll;	// works on safari
			});

			// Wait for trees to load
			doh.register("wait for load",  {
					name: "wait for load",
					timeout: 10000,
					runTest: helpers.waitForLoad
			});
			doh.register("setup vars", function(){
				registry = robot.window.require("dijit/registry");
			});
		},

		findTreeNode: function findTreeNode(/*String*/ treeId, /*String*/ label){
			// summary:
			//		Find the TreeNode with the specified label in the given tree.
			//		Assumes that there's only one TreeNode w/that label (i.e. it
			//		breaks if certain items have multiple parents and appear in the
			//		tree multiple times)
			var nodes = query(".dijitTreeLabel", dom.byId(treeId, robot.doc));
			for(var i=0; i<nodes.length; i++){
				if(helpers.innerText(nodes[i]) == label){
					return registry.getEnclosingWidget(nodes[i]);	// TreeNode
				}
			}
			return null;
		},

		findTreeNodeByPath: function findTreeNodeByPath(/*String*/ treeId, /*String[] */ path){
			// summary:
			//		Find the TreeNode with the specified path (like ["Fruits", "Apple"] in a tree like:
			//	|	* Foods
			//	|		* Vegetables
			//	|		* Fruits
			//	|			* Orange
			//	|			* Apple
			//		Path shouldn't include the root node.

			var tree = registry.byId(treeId);
			for(var i=0, node=tree.rootNode; i<path.length; i++){
				var pathElem = path[i], matchingChildNode;
				for(var j=0, children=node.getChildren(); j < children.length; j++){
					if(children[j].label == pathElem){
						matchingChildNode = children[j];
						break;
					}
				}
				if(!matchingChildNode){
					return null;
				}
				node = matchingChildNode;
			}
			return node;
		},

		getChildrenOfItem: function getChildrenOfItem(/*String*/ name){
			// summary:
			//		Return the children of the data store item w/the specified name
			//		Note that test_Tree_Dnd.html splits the children up into the "children"
			//		and "items" attributes.

			// Get the parent item
			// Note that the ItemFileWriteStore's callback will happen immediately.
			var myStore = robot.window.myStore,
				parentItem;
			myStore.fetch({
				query: {name: name},
				onItem: function(item){ parentItem = item; }
			});

			// Get the children, which are stored in two separate attributes,
			// categories (like 'Fruits') and items (ie, leaf nodes)  (like 'Apple')
			return {
				categories: myStore.getValues(parentItem, 'children'),
				items: myStore.getValues(parentItem, 'items')
			};
		},

		mapItemsToNames: function mapItemsToNames(ary){
			// summary:
			//		Convert an array of items into an array of names
			var myStore = robot.window.myStore;
			return array.map(ary, function(item){
				return myStore.getValue(item, "name");
			});
		},

		getNamesOfChildrenOfItem: function getNamesOfChildrenOfItem(/*String*/ name){
			// summary:
			//		Return the names of the (items that are) children of the item w/the specified name

			// Get the parent item (according to
			var obj = exports.getChildrenOfItem(name);
			return {
				categories: exports.mapItemsToNames(obj.categories),
				items: exports.mapItemsToNames(obj.items)
			};
		}
	};

	return exports;
});




<|start_filename|>tests/i18n/module.js<|end_filename|>
define(["doh/main", "require"], function(doh, require){

	doh.register("i18n.currency", require.toUrl("./currency.html"), 999999);
	doh.register("i18n.date", require.toUrl("./date.html"), 999999);
	doh.register("i18n.number", require.toUrl("./number.html"), 999999);
	doh.register("i18n.textbox", require.toUrl("./textbox.html"), 999999);
	doh.register("i18n.time", require.toUrl("./time.html"), 999999);
	doh.register("i18n.digit", require.toUrl("./digit.html"), 999999);

});
