Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / callback-function-with-handle-event.html
blob50d17c56c63f7c44c8e06c3008af9ea03b7b19be
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8" />
5 <title>Callback Function Objects Implementing handleEvent()</title>
6 </head>
7 <body>
9 <p>
10 When a JS callback is a function, it should be called. If the function has another function as
11 its <code>handleEvent</code> property, that function should <em>not</em> be called.
12 </p>
14 <p id="console"></p>
16 <script src="../../resources/js-test.js"></script>
17 <script type="text/javascript" charset="utf-8">
18 window.jsTestIsAsync = true;
20 // This function should be called.
21 var callback = function(event) {
22 testPassed("The callback function was called directly.");
23 finishJSTest();
25 // This function should not be called.
26 callback.handleEvent = function(event) {
27 testFailed("The callback function's handleEvent property was called instead of the function itself.");
28 finishJSTest();
31 // Database is one of several uses of JS Callbacks
32 var db = openDatabase("callback-function-with-handle-event-test", "", "Test for callback functions that implement a handleEvent() method.", 1);
33 db.changeVersion(db.version, "1.0", callback);
34 </script>
36 </body>
37 </html>