For more than a decade, the Pentagon, pinned down in Afghanistan, followed China’s rise as a global power and Russia’s ambitious military modernization program with growing alarm. The consensus in Beijing, Moscow and among some in Washington was that an era of U.S. global dominance was rapidly coming to an end.