<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<base>
<a></a>
<script>
description('Tests how setting href attributes affects setting a new base for the URL.');
var base = document.querySelector('base');
var a = document.querySelector('a');
base.href = 'http://old_base/';
a.href = 'foo?query';
shouldBeEqualToString('a.href', 'http://old_base/foo?query');
base.href = 'http://new_base/';
shouldBeEqualToString("document.querySelector('a').href", 'http://new_base/foo?query');
// Remove @href to allow js-test-post to load.
base.href = null;
</script>