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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/cross-frame-mouse-source-capabilities.html

Issue 2675793005: Track constant InputDeviceCapabilities objects per-window. (Closed)
Patch Set: test tidying Created 3 years, 10 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 | third_party/WebKit/LayoutTests/http/tests/security/resources/cross-frame-mouse-source-capabilities.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/cross-frame-mouse-source-capabilities.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-mouse-source-capabilities.html b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-mouse-source-capabilities.html
new file mode 100644
index 0000000000000000000000000000000000000000..2ec26f850d0c49f4bd7d2b0b442c665f0145bec0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/cross-frame-mouse-source-capabilities.html
@@ -0,0 +1,46 @@
+<!doctype html>
+<html>
+<head>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var button = null;
+
+function clickButton() {
+ if (!button)
+ button = document.querySelector("button");
+ button.click();
+}
+
+function handler(event) {
+ assert_not_equals(event.sourceCapabilities, null);
+ event.sourceCapabilities.customProperty = 42;
+}
+
+async_test(function(t) {
+ window.addEventListener('message', function(evt) {
+ if (evt.data === "start") {
+ setTimeout(clickButton);
+ return;
+ }
+
+ assert_equals(evt.data, undefined);
+ // Check that |sourceCapabilities| is same within the context
+ // of the same window. We may want to weaken this further and
+ // not insist on sameness across dispatched events.
+ button.onclick = function (event) {
+ assert_not_equals(event.sourceCapabilities, null);
+ assert_equals(event.sourceCapabilities.customProperty, 42);
+ t.done();
+ };
+ button.click();
+ });
+
+}, 'Test that event sourceCapabilities object is not shared cross-origin');
+</script>
+</head>
+<body>
+<button onclick="handler(event)"></button>
+<iframe src="http://localhost:8000/security/resources/cross-frame-mouse-source-capabilities.html"></iframe>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/resources/cross-frame-mouse-source-capabilities.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698