Bug 1032070 - [Settings] add done feature in onBeforsShow()

Please also wrap the results of other basic function (show, hide, ....) asserts in a then function.