focusblur.html revision 37afd8be00b8e92463a3fdcaa6fc1b2809b8256e
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots<html>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots<head>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <title>YUI Event Delegate Tests</title>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots</head>
0a9c6f9f30a66e52ec4ea4ed93504580b3a5669aAdam Moore<body class="yui3-skin-sam">
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <div id="container">
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <button id="button-1">Click Me!</button>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <a id="anchor-1" href="http://www.yahoo.com">Click Me!</a>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <input type="text" id="text-1">
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots </div>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <!-- YUI3 Core //-->
cb4f4f79feb7498d1f3406b88fb62209e5f5a444Adam Moore <script type="text/javascript" src="/build/yui/yui.js"></script>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <!-- Initialization process //-->
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots <script type="text/javascript">
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots YUI({
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith filter: 'raw',
cb4f4f79feb7498d1f3406b88fb62209e5f5a444Adam Moore logExclude: { Dom: true, Selector: true, Node: true, attribute: true, base: true, event: true, widget: true}
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots }).use('console', 'test', 'event', 'event-simulate', function (Y) {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var Assert = Y.Assert;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots // creating the console...
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith new Y.Console({ useBrowserConsole: true }).render();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots // starting the testing process
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots // add the test cases and suites
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.Test.Runner.add(new Y.Test.Case({
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith _should: {
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith fail: {
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith test_purge_focus: true,
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith test_purge_blur: true
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith }
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith },
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots name: "Event Focus And Blur Test",
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith tearDown: function () {
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith Y.one('#container').purge(true);
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith },
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots test_add_focus: function(){
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var foo = false,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots target,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots boundEl,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots onFocus = function(e) {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = true;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots boundEl = this;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots target = e.target;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots };
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.on('focus', onFocus, '#container');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith Assert.areEqual(Y.one('#button-1'), target, "the target is the incorrect node, should be the actual focus target");
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith Assert.areEqual(Y.one('#container'), boundEl, "the default scope should be the bound element");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = false;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots target = null;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots boundEl = null;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#text-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith Assert.areEqual(Y.one('#button-1'), target, "the target is the incorrect node, should be the actual focus target");
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith Assert.areEqual(Y.one('#container'), boundEl, "the default scope should be the bound element");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').blur();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots },
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots test_remove_focus: function () {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var foo = false,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots onFocus = function(e) {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = true;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots };
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var handle = Y.on('focus', onFocus, '#container');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots handle.detach();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').blur();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = false;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isFalse(foo, "container should not pickup the focus event after listener is removed");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').blur();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots },
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots test_purge_focus: function () {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var foo = false,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots onFocus = function(e) {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = true;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots };
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.on('focus', onFocus, '#container');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.Event.purgeElement('#container', false, 'focus');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').blur();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = false;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isFalse(foo, "container should not pickup the focus event after listener has been purged");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots },
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith test_bubble_order: function () {
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith var from = [],
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith doc = Y.one(Y.config.doc),
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith body = Y.one('body'),
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith container = Y.one('#container');
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith function onFocus(e) {
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith from.push(this);
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith }
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith container.on('focus', onFocus);
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith doc.on('focus', onFocus);
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith body.on('focus', onFocus);
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith Y.one('#button-1').focus();
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith Y.ArrayAssert.itemsAreSame([container, body, doc], from);//,
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith //"Incorrect bubble order");
37afd8be00b8e92463a3fdcaa6fc1b2809b8256eLuke Smith },
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots test_add_blur: function () {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var foo = false,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots target,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots boundEl,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots onBlur = function(e) {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = true;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots boundEl = this;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots target = e.target;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots };
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.on('blur', onBlur, '#container');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').blur();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple blur fails, container should pickup the focus event");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.areEqual(target, Y.one('#button-1'), "the target is the incorrect node, should be the actual blur target");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.areEqual(boundEl, Y.one('#container'), "the default scope should be the bound element");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = false;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots target = null;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots boundEl = null;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#text-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple blur fails, container should pickup the focus event");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.areEqual(target, Y.one('#button-1'), "the target is the incorrect node, should be the actual blur target");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.areEqual(boundEl, Y.one('#container'), "the default scope should be the bound element");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots },
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots test_remove_blur: function () {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var foo = false,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots onBlur = function(e) {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = true;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots };
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var handle = Y.on('blur', onBlur, '#container');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').blur();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = false;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots handle.detach();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#text-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isFalse(foo, "container should not pickup the blur event after listener has been removed");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots },
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots test_purge_blur: function () {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots var foo = false,
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots onBlur = function(e) {
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = true;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots };
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.on('blur', onBlur, '#container');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').blur();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots foo = false;
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.Event.purgeElement('#container', false, 'blur');
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#button-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.one('#text-1').focus();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Assert.isFalse(foo, "container should not pickup the blur event after listener has been purged");
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots }
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots }));
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots //run all tests
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots Y.Test.Runner.run();
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots /* finishing the testing process */
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots });
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots </script>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots</body>
85e08d7420a5c71ffdd9517a3179d29b9a32b1dfTodd Kloots</html>