Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / script-tests / event-function-toString.js
blobe94fd3ae028e42323a2a971a2c0a3c4f7842546b
1 description("Test serialization of event handlers for bug 25544.");
3 function normalizedFunctionString(string)
5 // Remove the white space before/after { } which differs between browsers
6 string = string.replace(/\{\s+/g, "{");
7 string = string.replace(/\s+\}/g, "}");
8 return string;
11 var div = document.createElement("div");
12 div.setAttribute("onclick", "test();");
13 shouldBeEqualToString("normalizedFunctionString(div.onclick.toString())", "function onclick(event) {test();}");
15 var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
16 path.setAttribute("onclick", "test();");
17 shouldBeEqualToString("normalizedFunctionString(path.onclick.toString())", "function onclick(evt) {test();}");