The star has been accused of copying part of the song from another artist.
In closing arguments, grime artist Sami Chokri's barrister said there was an "indisputable similarity between the works". But Mr Sheeran's lawyer said the case against him was "so strained as to be logically unintelligible".
Mr Justice Zacaroli said he would "take some time to consider my judgment".
The 11-day trial ended on Tuesday. Ian Mill QC, representing Mr Sheeran, said it had been "deeply traumatising" for the star and his co-writers, Johnny McDaid and Steve Mac.
He described the dispute as "terribly, terribly unfortunate" and argued that the case "should never have gone to trial".