WARREN, Michigan — In her 11th year as CEO of General Motors Co., Mary Barra’s latest test is to ensure that the Detroit automaker’s coming electric vehicles reach profitability by getting mainstream consumers to buy them in competitive global markets. But in the time since GM first declared it would become all-electric, industry regulations have changed and the pace in the demand for EVs has slowed.