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

Unified Diff: bower_components/polymer-test-tools/mocha-htmltest.js

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 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: bower_components/polymer-test-tools/mocha-htmltest.js
diff --git a/bower_components/polymer-test-tools/mocha-htmltest.js b/bower_components/polymer-test-tools/mocha-htmltest.js
deleted file mode 100644
index ffae2a884dbb70e35a57085e9ebfe923d3445feb..0000000000000000000000000000000000000000
--- a/bower_components/polymer-test-tools/mocha-htmltest.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2013 The Polymer Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style
- * license that can be found in the LICENSE file.
- */
-
-(function() {
- var thisFile = 'lib/mocha-htmltest.js';
- var base = '';
-
- mocha.htmlbase = function(htmlbase) {
- base = htmlbase;
- };
-
- (function() {
- var s$ = document.querySelectorAll('script[src]');
- Array.prototype.forEach.call(s$, function(s) {
- var src = s.getAttribute('src');
- var re = new RegExp(thisFile + '[^\\\\]*');
- var match = src.match(re);
- if (match) {
- base = src.slice(0, -match[0].length);
- }
- });
- })();
-
- var next, iframe;
-
- var listener = function(event) {
- if (event.data === 'ok') {
- next();
- } else if (event.data && event.data.error) {
- // errors cannot be cloned via postMessage according to spec, so we re-errorify them
- throw new Error(event.data.error);
- }
- };
-
- function htmlSetup() {
- window.addEventListener("message", listener);
- iframe = document.createElement('iframe');
- iframe.style.cssText = 'position: absolute; left: -9000em; width:768px; height: 1024px';
- document.body.appendChild(iframe);
- }
-
- function htmlTeardown() {
- window.removeEventListener('message', listener);
- document.body.removeChild(iframe);
- }
-
- function htmlTest(src) {
- test(src, function(done) {
- next = done;
- var url = base + src;
- var delimiter = url.indexOf('?') < 0 ? '?' : '&';
- var docSearch = location.search.slice(1);
- iframe.src = url + delimiter + Math.random() + '&' + docSearch;
- });
- };
-
- function htmlSuite(inName, inFn) {
- suite(inName, function() {
- setup(htmlSetup);
- teardown(htmlTeardown);
- inFn();
- });
- };
-
- window.htmlTest = htmlTest;
- window.htmlSuite = htmlSuite;
-})();
« no previous file with comments | « bower_components/polymer-test-tools/karma-common.conf.js ('k') | bower_components/polymer-test-tools/mocha/.bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698