summaryrefslogtreecommitdiff
path: root/chromium/third_party/webdriver/test_data/alerts.html
blob: 3ae831b6cb9ebb69b7355dc5a705787acb2875b7 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<html>
<head>
    <title>Testing Alerts</title>

    <script type="text/javascript">
        function setInnerText(id, value) {
          document.getElementById(id).innerHTML = '<p>' + value + '</p>';
        }

        function displayPrompt() {
          setInnerText('text', prompt('Enter something'));
        }

        function displayPromptWithDefault() {
          setInnerText('text', prompt('Enter something', 'This is a default value'));
        }
        
        function displayTwoPrompts() {
          setInnerText('text1', prompt('First'));
          setInnerText('text2', prompt('Second'));
        }

        function slowAlert() {
          window.setTimeout(function() {
            alert('Slow');
          }, 200);
        }
    </script>
</head>
<body>

<h1>Testing Alerts and Stuff</h1>

<p>This tests alerts: <a href="#" id="alert" onclick="alert('cheese');">click me</a></p>

<p>This tests alerts: <a href="#" id="empty-alert" onclick="alert('');">click me</a></p>

<p>Let's make the <a href="#" id="prompt" onclick="displayPrompt();">prompt happen</a></p>

<p>Let's make the <a href="#" id="prompt-with-default" onclick="displayPromptWithDefault();">prompt with default happen</a></p>

<p>Let's make TWO <a href="#" id="double-prompt" onclick="displayTwoPrompts();">prompts happen</a></p>

<p>A <a href="#" id="slow-alert" onclick="slowAlert();">SLOW</a> alert</p>

<p>This is a test of a confirm:
    <a href="simpleTest.html" id="confirm" onclick="return confirm('Are you sure?');">test confirm</a></p>

<p>This is a test of showModalDialog: <a href="#" id="dialog" onclick="showModalDialog('javascriptPage.html')">test dialog</a></p>

<p>This is a test of an alert in an iframe:
  <iframe src="iframeWithAlert.html" name="iframeWithAlert"></iframe>
</p>

<p>This is a test of an alert in a nested iframe:
  <iframe src="iframeWithIframe.html" name="iframeWithIframe"></iframe>
</p>

<p>This is a test of an alert open from onload event handler: <a id="open-page-with-onload-alert" href="pageWithOnLoad.html">open new page</a></p>

<p>This is a test of an alert open from onload event handler: <a id="open-window-with-onload-alert" href="pageWithOnLoad.html" target="onload">open new window</a></p>

<p>This is a test of an alert open from onunload event handler: <a id="open-page-with-onunload-alert" href="pageWithOnUnload.html">open new page</a></p>

<p>This is a test of an alert open from onclose event handler: <a id="open-window-with-onclose-alert" href="pageWithOnUnload.html" target="onclose">open new window</a></p>

<p>This is a test of an alert open from onclose event handler: <a id="open-new-window" href="blank.html" target="newwindow">open new window</a></p>

<div id="text"></div>
<div id="text1"></div>
<div id="text2"></div>
</body>
</html>