"I think we made it clear to North Korea and anyone else in the region that an attack on one is an attack on both of us," Joseph Dunford, the chairman of the Joint Chiefs of Staff, said in Tokyo.
North Korea has threatened to test-fire missiles that would fly over Japan and land in waters off the US territory of Guam. The US is treaty-bound to defend Japan from outside attacks.
Dunford and his Japanese counterpart Katsutoshi Kawano agreed to work together to strengthen missile defense systems.
Sirens wailed across nine prefectures in western Japan in the test of the emergency system. Twitter users in the region said the sirens didn't work in some areas.
The flight path of the North Korean missile test would cross that part of the country.