Rewrite GadgetTest::testIsAllowed() to use a data provider

Change-Id: If0797cdfb46f5b58f03755b12976ca1b578e2a4c