From 6fd3bfa364038a3afb48fdab5a8d3fc34c1e7a30 Mon Sep 17 00:00:00 2001 From: Dietrich Streifert Date: Mon, 29 Aug 2016 16:45:18 +0200 Subject: [PATCH] Testcase for new method getSubcontrolId in Widget --- .../source/class/qx/test/ui/core/Widget.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/framework/source/class/qx/test/ui/core/Widget.js b/framework/source/class/qx/test/ui/core/Widget.js index d50193bae03..7163c15e5a5 100644 --- a/framework/source/class/qx/test/ui/core/Widget.js +++ b/framework/source/class/qx/test/ui/core/Widget.js @@ -321,6 +321,41 @@ qx.Class.define("qx.test.ui.core.Widget", qx.Class.undefine("qx.test.ui.core.W"); }, + testChildGetSubcontrolId : function() { + qx.Class.define("qx.test.ui.core.W", { + extend : qx.ui.core.Widget, + + members : { + _createChildControlImpl : function(id, hash) + { + var control; + + switch(id) + { + case "xyz": + control = new qx.ui.core.Widget(); + break; + + } + + return control || this.base(arguments, id); + } + } + }); + + var w = new qx.test.ui.core.W(); + + var child = w.getChildControl("xyz"); + this.flush(); + this.assertEquals("xyz", child.getSubcontrolId()); + + this.assertNull(w.getSubcontrolId()); + + child.dispose(); + w.dispose(); + qx.Class.undefine("qx.test.ui.core.W"); + }, + testCreateChildControlHash: function(){ qx.Class.define("qx.test.ui.core.W", {