Add feature to allow setting listener save directory from unit test.