summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/history/the-history-interface/008.js
blob: 96a1fe5d4a6f7e6fd548abf218777dac4fc15bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
var beforehref = location.href;

test(function () {
  history.pushState('','','/testing_ignore_me_404');
  assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404'));
}, 'history.pushState URL resolving should be done relative to the document, not the script');

test(function () {
  history.replaceState('','','/testing_ignore_me_404_2');
  assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404_2'));
}, 'history.replaceState URL resolving should be done relative to the document, not the script');