Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: LayoutTests/fast/dom/Window/get-set-properties.html

Issue 22687002: Treat non-callable input as null for EventHandler attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/get-set-properties-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Window/get-set-properties.html
diff --git a/LayoutTests/fast/dom/Window/get-set-properties.html b/LayoutTests/fast/dom/Window/get-set-properties.html
index 065ebf350715526aab177fd550c6584e92983055..63e2cf119e2f9715fd18d7c638fb19a478380f0a 100644
--- a/LayoutTests/fast/dom/Window/get-set-properties.html
+++ b/LayoutTests/fast/dom/Window/get-set-properties.html
@@ -43,6 +43,7 @@ function canGet(keyPath)
}
window.marker = { "foo": "bar", toString: function(){ return "window.marker.toString()"; } };
+window.callableMarker = function() { return "window.callableMarker.toString()"; };
function canSet(keyPath)
{
@@ -68,6 +69,18 @@ function canSetWithTypeConversion(keyPath)
}
}
+function canSetWithCallable(keyPath)
+{
+ var valuePath = "window.callableMarker";
+
+ try {
+ eval("window." + keyPath + " = " + valuePath);
+ return eval("window." + keyPath) === eval("window." + valuePath);
+ } catch(e) {
+ return false;
+ }
+}
+
var windowReadWriteProperties = [
"Attr",
"CDATASection",
@@ -225,6 +238,22 @@ var windowFunctions = [
"getSelection",
"moveBy",
"moveTo",
+ "open",
+ "print",
+ "prompt",
+ "releaseEvents",
+ "removeEventListener",
+ "resizeBy",
+ "resizeTo",
+ "scroll",
+ "scrollBy",
+ "scrollTo",
+ "setInterval",
+ "setTimeout",
+ "stop"
+];
+
+var windowEventHandlers = [
"onabort",
"onbeforeunload",
"onblur",
@@ -249,20 +278,7 @@ var windowFunctions = [
"onsearch",
"onselect",
"onsubmit",
- "onunload",
- "open",
- "print",
- "prompt",
- "releaseEvents",
- "removeEventListener",
- "resizeBy",
- "resizeTo",
- "scroll",
- "scrollBy",
- "scrollTo",
- "setInterval",
- "setTimeout",
- "stop"
+ "onunload"
];
window.onload = function()
@@ -272,7 +288,7 @@ window.onload = function()
log("\n----- tests for getting/setting read-write properties -----\n");
- for (var i = 0; i < windowReadWriteProperties.length; i++) { //>
+ for (var i = 0; i < windowReadWriteProperties.length; i++) {
var property = windowReadWriteProperties[i];
shouldBeTrue("canGet('" + property + "')");
shouldBeTrue("canSet('" + property + "')");
@@ -280,14 +296,14 @@ window.onload = function()
log("\n----- tests for getting/setting readonly properties -----\n");
- for (var i = 0; i < windowReadOnlyProperties.length; i++) { //>
+ for (var i = 0; i < windowReadOnlyProperties.length; i++) {
var property = windowReadOnlyProperties[i];
shouldBeTrue("canGet('" + property + "')");
shouldBeFalse("canSet('" + property + "')");
}
log("\n----- tests for getting/setting string properties -----\n");
- for (var i = 0; i < windowReadWriteStringProperties.length; i++) { //>
+ for (var i = 0; i < windowReadWriteStringProperties.length; i++) {
var property = windowReadWriteStringProperties[i];
shouldBeTrue("canGet('" + property + "')");
shouldBeTrue("canSetWithTypeConversion('" + property + "')");
@@ -296,10 +312,18 @@ window.onload = function()
log("\n----- tests for getting/setting functions -----\n");
- for (var i = 0; i < windowFunctions.length; i++) { //>
+ for (var i = 0; i < windowFunctions.length; i++) {
var property = windowFunctions[i];
shouldBeTrue("canGet('" + property + "')");
shouldBeTrue("canSet('" + property + "')");
}
+
+ log("\n----- tests for getting/setting event handlers -----\n");
+
+ for (var i = 0; i < windowEventHandlers.length; i++) {
+ var property = windowEventHandlers[i];
+ shouldBeTrue("canGet('" + property + "')");
+ shouldBeTrue("canSetWithCallable('" + property + "')");
+ }
}
</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/get-set-properties-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698