Almost all 26 million residents in Shanghai, China’s largest city and financial center, are on lockdown in a major test of the country’s zero-tolerance pandemic strategy, which seeks to minimize cases through border closures, mass testing, contact tracing and quarantine.