"The iconic red double-decker bus is about to become greener than ever," he told the Clean Bus Summit earlier.
In addition, the 312 route from Norwood to South Croydon, will become the city's first purely electric route later this year, the mayor added.
London Assembly Transport spokesperson Valerie Shawcross said it was "fantastic" news.
"With London's bus fleet contributing to the capital's ever growing air pollution crisis, we need a plan to make environmentally friendly vehicles the rule not the exception," the Labour member continued.
Passengers on route 16, between Cricklewood and Victoria Station, will test up to five purpose-built purely electric double-deckers in the autumn.
Double the demand
Transport for London (TfL) already has 1,300 hybrid electric and diesel buses in service.
Currently there are eight single-decker electric-only buses operating on short commuter routes - six buses designed by British firm Optare and two made by the Chinese firm BYD which is also supplying the trial double-decker version.
TfL aims to have 300 electric-only buses by 2020.
London is one of only a few cities in the world that operates double-decker buses, partly because it is a London tradition, and partly because of the large number of people who use buses in the city, a TfL spokesman said.
Twice as many people travel on buses than on the Tube in London every day, he said.
One of the things TfL will test in the trial is how the double-decker buses withstand the long hours and stop-start driving conditions of the capital. The single-decker electric buses have so far only been used on shorter commuter routes.