This question already has an answer here:
I am citizen of India (Indian passport holder) with a valid F-1 visa and work permit (EAD card) with me. I have an Air Canada flight from Delhi to LA via Toronto so I have a 5 hr transit at the airport. I am not planning to go out of the airport. Do I still need a transit visa or eTA to board my flight to LA? If yes, which one do I need? I have already checked this link and doesn't specify what type of visa do I need (eTA or transit). Also, it doesn't take into account that I am a valid US Visa holder.