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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: polymer_1.2.3/bower_components/iron-page-url/test/initialization-iframe.html
diff --git a/polymer_1.2.3/bower_components/iron-page-url/test/initialization-iframe.html b/polymer_1.2.3/bower_components/iron-page-url/test/initialization-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..9bb3a51b41a73ec2531a2cc0495c78c1740cc25c
--- /dev/null
+++ b/polymer_1.2.3/bower_components/iron-page-url/test/initialization-iframe.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Base source for injecting into an iframe for tests</title>
+ <script src="../../webcomponentsjs/webcomponents.js"></script>
+ <link rel='import' href='./initialization-cases.html'>
+ </head>
+ <body>
+ <script>
+ window.addEventListener("message", messageReceived, false);
+
+ window.addEventListener('WebComponentsReady', function() {
+ window.parent.postMessage({
+ 'type': 'ready'
+ }, '*');
+ });
+
+ var appendBodyReceived = false;
+ function messageReceived(msg) {
+ if (!msg.data) {
+ console.error('got invalid msg?');
+ }
+ // the parent can (at any time) ask for our URL.
+ if (msg.data.type === 'urlQuery') {
+ msg.source.postMessage({
+ 'type': 'urlQueryResponse',
+ 'href': window.location.href,
+ 'pathname': window.location.pathname,
+ 'hash': window.location.hash,
+ 'search': window.location.search
+ }, '*');
+ } else if (msg.data.type === 'appendBody') {
+ if (appendBodyReceived) {
+ throw new Error('should only receive at most one appendBody call');
+ }
+ var element = document.createElement(msg.data.tagName);
+ document.body.appendChild(element);
+ appendBodyReceived = true;
+ }
+ }
+
+ window.addEventListener('error', function(e) {
+ window.parent.postMessage({
+ 'type': 'error',
+ 'error': e.message
+ }, '*');
+ });
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698