In Canada’s elections, China was suspected of donating funds to friendly candidates and spreading false information online about potentially hostile ones.