Chocolate has been around for centuries before animals testing. The chocolate itself is already known to be safe for humans, but they do test how much can do good or harm, and they test other additives to the chocolate. And you bet they did testing to find that the theobromide is what kills dogs.
Tylenol has a similar history.

Sure, we can use mechanical tests to see if something is innately safe, but what about long term studies? What if something was safe to eat, but gave you cancer 40 years later because the mechanical tests couldn't predict that reaction within the body over those years?