Accept array of HTML messages in tooltip JavaScript

I wonder if error.messages ever was not an array.

However, I kept the original behavior to maximize compatibility
and added tests for all cases.

Bug: 66043
Change-Id: Ieed56bba0015a1895c7f4164527b82ab73796eed