summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/history/state-object-few-arguements-exception.html
blob: 325de2427063ff78ca9e639d16be2743de5009ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script>

if (window.testRunner) {
    testRunner.clearBackForwardList();
    testRunner.dumpAsText();
}

function runPushStateTest()
{
    shouldThrow('history.pushState()');
    shouldThrow('history.pushState(null)');
    shouldNotThrow('history.pushState(null, null)');
    shouldNotThrow('history.pushState(null, null, null)');
}

function runReplaceStateTest()
{
    shouldThrow('history.replaceState()');
    shouldThrow('history.replaceState(null)');
    shouldNotThrow('history.replaceState(null, null)');
    shouldNotThrow('history.replaceState(null, null, null)');
}

function runTest()
{
    description('This test makes sure that calls to pushState() and replaceState() with less than 2 arguments fail as expected.');
    runPushStateTest();
    runReplaceStateTest();
}

</script>
<body onload="runTest();">
<div id=console></div>
</body>
</html>