<commit_before><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

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

	<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
	<script type="text/javascript">
		dojo.require("dijit.dijit"); // optimize: load dijit layer
		dojo.require("dijit.robotx");

		dojo.addOnLoad(function(){
			doh.robot.initRobot('../_Widget-ondijitclick.html');

			// Event monitoring
			var widgetClicks = 0, buttonClicks = 0;
			var w;

			doh.register("setup", function(){ 
				doh.robot.sequence(function(){
					w = dijit.byId("widget1");
					dojo.connect(w, "_onClick", function(){
						widgetClicks++;
					}),
					dojo.connect(dojo.byId("plainbutton"), "onclick", function(){
						buttonClicks++;
					})
				});
			});

			dojo.forEach(["SPACE", "ENTER"], function(key){

				doh.register("ondijitclick by " + key,
					{
						name: "ondijitclick by " + key,
						runTest: function(){
							widgetClicks = buttonClicks = 0;
							var d = new doh.Deferred();
	
							// Keyboard-click the widget
							w.domNode.focus();
							doh.robot.keyPress(dojo.keys[key], 100, {});

							// Check that ondijitclick fired but no spurious event
							// on the widget that got focused in the ondijitclick handler
							doh.robot.sequence(d.getTestCallback(function(){
								doh.is(1, widgetClicks, "ondijitclick handler fired");
								doh.is(0, buttonClicks, "spurious button click event");
							}), 100);
	
							return d;
						}
					},
					{
						name: "ondijitclick by " + key + " w/modifier",
						runTest: function(){
							widgetClicks = buttonClicks = 0;
							var d = new doh.Deferred();
	
							// Keyboard-click with modifier shouldn't do anything
							w.domNode.focus();
							doh.robot.keyPress(dojo.keys[key], 100, {shift: true});
							doh.robot.keyPress(dojo.keys[key], 100, {ctrl: true});
							doh.robot.keyPress(dojo.keys[key], 100, {alt: true});
							doh.robot.keyPress(dojo.keys[key], 100, {meta: true});

							// Check that ondijitclick fired but no spurious event
							// on the widget that got focused in the ondijitclick handler
							doh.robot.sequence(d.getTestCallback(function(){
								doh.is(0, widgetClicks, "ondijitclick handler wasn't fired");
							}), 100);
	
							return d;
						}
					}
				);
			});

			doh.run();
		});

	</script>
</head>
</html><commit_msg>Increasing timeouts for IE8's benefit, and also fixing some other test problems.  Refs #7681.<commit_after><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

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

	<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
	<script type="text/javascript">
		dojo.require("dijit.dijit"); // optimize: load dijit layer
		dojo.require("dijit.robotx");

		dojo.addOnLoad(function(){
			doh.robot.initRobot('../_Widget-ondijitclick.html');

			// Event monitoring
			var widgetClicks = 0, buttonClicks = 0;
			var w;

			doh.register("setup", function(){ 
				doh.robot.sequence(function(){
					w = dijit.byId("widget1");
					dojo.connect(w, "_onClick", function(){
						widgetClicks++;
					}),
					dojo.connect(dojo.byId("plainbutton"), "onclick", function(){
						buttonClicks++;
					})
				});
			});

			dojo.forEach(["SPACE", "ENTER"], function(key){

				doh.register("ondijitclick by " + key, [
					{
						name: "ondijitclick by " + key,
						timeout: 5000,
						runTest: function(){
							widgetClicks = buttonClicks = 0;
							var d = new doh.Deferred();
	
							// Keyboard-click the widget
							doh.robot.sequence(function(){
								w.domNode.focus();
							}, 500);
							doh.robot.keyPress(dojo.keys[key], 500, {});

							// Check that ondijitclick fired but no spurious event
							// on the widget that got focused in the ondijitclick handler
							doh.robot.sequence(d.getTestCallback(function(){
								doh.is(1, widgetClicks, "ondijitclick handler fired");
								doh.is(0, buttonClicks, "spurious button click event");
							}), 100);
	
							return d;
						}
					},
					{
						name: "ondijitclick by " + key + " w/modifier",
						timeout: 5000,
						runTest: function(){
							widgetClicks = buttonClicks = 0;
							var d = new doh.Deferred();
	
							// Keyboard-click with modifier shouldn't do anything
							doh.robot.sequence(function(){
								w.domNode.focus();
							}, 500);
							doh.robot.keyPress(dojo.keys[key], 100, {shift: true});
							doh.robot.keyPress(dojo.keys[key], 100, {ctrl: true});
							//doh.robot.keyPress(dojo.keys[key], 100, {meta: true});

							// Check that ondijitclick fired but no spurious event
							// on the widget that got focused in the ondijitclick handler
							doh.robot.sequence(d.getTestCallback(function(){
								doh.is(0, widgetClicks, "ondijitclick handler wasn't fired");
								doh.is(0, buttonClicks, "button click handler wasn't fired");
							}), 100);
	
							return d;
						}
					}
				]);
			});

			doh.run();
		});

	</script>
</head>
</html>
{'fraction_non_alphanumeric': 0.16030092592592593, 'fraction_numerical': 0.01678240740740741, 'mean_word_length': 2.615760111576011, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6529566', 'n_tokens_mistral': 2471, 'n_tokens_neox': 1771, 'n_words': 379}