In case of a contest of election between candidates, at the first general election under this constitution, for judges of the supreme, district or county courts, or district attorneys, the evidence shall be taken in the manner prescribed by territorial law; and the testimony so taken shall be certified to the secretary of state, and said officer, together with the governor and attorney general, shall review the testimony and determine who is entitled to the certificate of election.