That's terrible methodology. For example maybe in a country with very few foreigners people aren't as worried about foreign neighbours as other things. It doesn't demonstrate anything.
Asking someone in an unrelated economic experiment something like "Would you mind if your neighbors were black?" is more accurate because it tricks people into revealing their true biases.