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

Unified Diff: LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js

Issue 940423004: Add layout tests that test connecting to a system supplied navigator.connect service. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@n-c-expose-v8-context-from-port
Patch Set: actually test with transfer from an iframe Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/navigatorconnect/system-service.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js
diff --git a/LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js b/LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js
index 277c9fa565205790e64a57b8646fca151579104f..fe4a83276406e2e60b59e5f4029fcc0074f956c2 100644
--- a/LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js
+++ b/LayoutTests/http/tests/navigatorconnect/resources/test-helpers.js
@@ -20,15 +20,15 @@ function reply_as_promise(t, port) {
// Method that behaves similarly to navigator.connect, but the actual connect
// call is made from a cross origin iframe.
function cross_origin_connect(t, service) {
- // |service| is a relative URL, but for this to work from the iframe it needs
- // an absolute URL.
- var target_url = location.origin + base_path() + service;
+ // |service| could be a relative URL, but for this to work from the iframe it
+ // needs an absolute URL.
+ var target_url = new URL(service, location.origin + base_path());
return with_iframe(
cross_origin + base_path() + 'resources/connect-helper.html')
.then(function(iframe) {
var channel = new MessageChannel();
iframe.contentWindow.postMessage(
- {connect: target_url, port: channel.port2}, '*', [channel.port2]);
+ {connect: target_url.href, port: channel.port2}, '*', [channel.port2]);
return reply_as_promise(t, channel.port1);
});
}
« no previous file with comments | « no previous file | LayoutTests/http/tests/navigatorconnect/system-service.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698