summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/data/window_close.html
blob: e7f0718cf865b34bf354e6ad2c83f8f7d33fe8a0 (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
<html>
  <head><title>window.close test</title>
    <script type="text/javascript" src="chrome_frame_tester_helpers.js">
    </script>
    <script type="text/javascript">
      function OnNavigationFailed() {
        onFailure("WindowCloseTest", 1, "ChromeFrame Navigation failed");
      }

      function OnChromeFrameLoaded(url) {
        appendStatus("Loaded URL: " + url.data);
        var cf = window.document.ChromeFrame;
        if (cf.attachEvent) { // Special case for IE
          appendStatus("Attaching close event handler");
          cf.attachEvent("onclose", OnCloseWindow);
        }
      }

      function OnCloseWindow() {
        appendStatus("Received window close event.");
        return onSuccess("WindowCloseTest", 1);
      }

    </script>
  </head>
  <body>
      <div id="statusPanel" style="border: 1px solid red; width: 100%">
      Test running....
      </div>

      <object id="ChromeFrame" width="500" height="500"
          codebase="http://www.google.com"
          classid="CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">
          <param name="src" value="window_close_frame.html">
          <param name="onload" value="return OnChromeFrameLoaded(arguments[0]);">
          <param name="onloaderror" value="return OnNavigationFailed(arguments[0]);">
          <param name="onclose" value="return OnCloseWindow();">
          <embed id="ChromeFramePlugin" width="500" height="500" name="ChromeFrame"
              src="window_close_frame.html"
              type="application/chromeframe"
              onload="return OnChromeFrameLoaded(arguments[0]);"
              onloaderror="return OnNavigationFailed(arguments[0]);"
              onclose="return OnCloseWindow();">
          </embed>
      </object>
      <p>Tests window.close notification from ChromeFrame to its container</p>
  </body>
</html>