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

Side by Side 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: switch to testharness 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <script>
7 var button = null;
8
9 function clickButton() {
10 if (!button)
11 button = document.querySelector("button");
12 button.click();
13 }
14
15 function handler(event) {
16 assert_true(event.sourceCapabilities !== null);
17 event.sourceCapabilities.customProperty = 42;
18 }
19
20 async_test(function(t) {
21 window.addEventListener('message', function(evt) {
22 if (evt.data === "start") {
23 setTimeout(clickButton);
24 return;
25 }
26
27 assert_true(evt.data === undefined);
dcheng 2017/02/07 09:14:40 FWIW, I think assert_equals already uses strict eq
sof 2017/02/07 09:29:57 Switched to that idiom.
28 // Check that |sourceCapabilities| is same within the context
29 // of the same window. We may want to weaken this further and
30 // not insist on sameness across dispatched events.
31 button.onclick = function (event) {
32 assert_true(event.sourceCapabilities !== null);
33 assert_true(event.sourceCapabilities.customProperty === 42);
34 t.done();
35 };
36 button.click();
37 });
38
39 }, 'Test that event sourceCapabilities object is not shared cross-origin');
40 </script>
41 </head>
42 <body>
43 <button onclick="handler(event)"></button>
44 <iframe src="http://localhost:8000/security/resources/cross-frame-mouse-source-c apabilities.html"></iframe>
45 </body>
46 </html>
OLDNEW
« 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