Caroline Cochrane was being detained for breaching the peace when she decided to retrieve the class A drugs from her pants and tried to get rid of them, a court heard.