In this agreement , China promised that , under its " one country , two systems " formula , China 's socialist economic system would not be practiced in Macau , and that Macau would enjoy a high degree of autonomy in all matters except foreign and defense affairs for the next 50 years .