Texas girl with cancer sworn in as police officer