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

Side by Side Diff: polymer_1.2.3/bower_components/iron-page-url/test/initialization-iframe.html

Issue 1581713003: [third_party] add polymer 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: 1.2.3 Created 4 years, 11 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Base source for injecting into an iframe for tests</title>
6 <script src="../../webcomponentsjs/webcomponents.js"></script>
7 <link rel='import' href='./initialization-cases.html'>
8 </head>
9 <body>
10 <script>
11 window.addEventListener("message", messageReceived, false);
12
13 window.addEventListener('WebComponentsReady', function() {
14 window.parent.postMessage({
15 'type': 'ready'
16 }, '*');
17 });
18
19 var appendBodyReceived = false;
20 function messageReceived(msg) {
21 if (!msg.data) {
22 console.error('got invalid msg?');
23 }
24 // the parent can (at any time) ask for our URL.
25 if (msg.data.type === 'urlQuery') {
26 msg.source.postMessage({
27 'type': 'urlQueryResponse',
28 'href': window.location.href,
29 'pathname': window.location.pathname,
30 'hash': window.location.hash,
31 'search': window.location.search
32 }, '*');
33 } else if (msg.data.type === 'appendBody') {
34 if (appendBodyReceived) {
35 throw new Error('should only receive at most one appendBody call');
36 }
37 var element = document.createElement(msg.data.tagName);
38 document.body.appendChild(element);
39 appendBodyReceived = true;
40 }
41 }
42
43 window.addEventListener('error', function(e) {
44 window.parent.postMessage({
45 'type': 'error',
46 'error': e.message
47 }, '*');
48 });
49 </script>
50 </body>
51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698