void setWindowLocationHash(
String hash
)

We need to override these methods during test.

Source

/// We need to override these methods during test.
void setWindowLocationHash(String hash) {
  window.location.hash = hash;
}