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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/resources/foreignfetch-origin-trial-interfaces-worker.php

Issue 2640823004: Allow origin trials to be enabled by script (Closed)
Patch Set: Address nit Created 3 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: third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/resources/foreignfetch-origin-trial-interfaces-worker.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/resources/foreignfetch-origin-trial-interfaces-worker.php b/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/resources/foreignfetch-origin-trial-interfaces-worker.php
new file mode 100644
index 0000000000000000000000000000000000000000..8031fc665cffd4930592bc4af228a93052ed5f6a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/resources/foreignfetch-origin-trial-interfaces-worker.php
@@ -0,0 +1,21 @@
+<?php
+if (isset($_GET["origintrial"])) {
+ // Generate token with the command:
+ // generate_token.py http://127.0.0.1:8000 ForeignFetch -expire-timestamp=2000000000
+ header("Origin-Trial: AinuK1QNcHGJANXfN0Pzkvpxm8rocd4kcqQqhp7rBN8PEX/1JicCoDXX3fIhk7iwBOCCOQYR0cvZ8XHTLJJfVw0AAABUeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiRm9yZWlnbkZldGNoIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9");
+}
+header('Content-Type: application/javascript');
+?>
+importScripts('../../../resources/origin-trials-helper.js');
+
+self.addEventListener('message', event => {
+ event.source.postMessage(
+ OriginTrialsHelper.get_interface_names(
+ this,
+ ['ForeignFetchEvent',
+ 'InstallEvent',
+ 'global'
+ ],
+ {'InstallEvent':['registerForeignFetch'],
+ 'global':['onforeignfetch']}));
+ });

Powered by Google App Engine
This is Rietveld 408576698