Fix: Using one more _assertHtmlReady to bypass timing issue. Now the test logic for  document switching is more reasonable.