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

Side by Side Diff: third_party/WebKit/LayoutTests/nfc/nfc-block-iframe.html

Issue 2657023005: [webnfc] Allow access to WebNFC API only from main frame (Closed)
Patch Set: 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/nfc/resources/nfc-helpers.js » ('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 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/nfc-helpers.js"></script>
6 <script>
7 'use strict';
8
9 nfc_test(nfc => {
10 return new Promise((resolve,reject) => {
11 let iframeMockNFC = new nfc.MockNFC;
12 let iframe = document.createElement('iframe');
13 iframe.src = 'resources/push-from-iframe.html';
14 iframe.onload = () => {
15 iframe.contentWindow.gin.define(
16 "Mojo Service Registry",
17 [ 'content/public/renderer/frame_interfaces' ],
18 (frameInterfaces) => {
19 frameInterfaces.addInterfaceOverrideForTesting(
20 nfc.NFC.name,
21 handle => { iframeMockNFC.bindingSet.addBinding(
22 iframeMockNFC, handle); });
23 iframe.contentWindow.postMessage('Ready', '*');
24 });
25 }
26
27 document.body.appendChild(iframe);
28
29 window.onmessage = message => {
30 if (message.data == 'Success') {
31 resolve();
32 } else if (message.data == 'Failure') {
33 reject();
34 }
35 }
36 });
37 }, 'Test that WebNFC API is not accessible from iframe context.');
38
39 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/nfc/resources/nfc-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698