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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-insecure-context.html

Issue 2861673007: Add Origin Trial layout tests for IDL bindings (Closed)
Patch Set: Fix compile errors Created 3 years, 7 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/sample-api-enabled-insecure-context.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-insecure-context.html
similarity index 65%
copy from third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html
copy to third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-insecure-context.html
index 6af7eef5d64b4533d0b632707387ecaaf1d4ecd1..7989241f736318d85ffd72ac7dd620b5afea525b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled.html
+++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/sample-api-enabled-insecure-context.html
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<meta charset="utf-8">
+<title>Test Sample API when trial is enabled, in insecure context</title>
<!-- TODO(iclelland): Generate this sample token during the build. The token
below will expire in 2033, but it would be better to always have a token which
is guaranteed to be valid when the tests are run. -->
@@ -9,10 +10,15 @@ generate_token.py http://127.0.0.1:8000 Frobulate -expire-timestamp=2000000000
<meta http-equiv="origin-trial" content="AlCoOPbezqtrGMzSzbLQC4c+oPqO6yuioemcBPjgcXajF8jtmZr4B8tJRPAARPbsX6hDeVyXCKHzEJfpBXvZgQEAAABReyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiRnJvYnVsYXRlIiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9" />
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/get-host-info.js"></script>
<script src="resources/origintrials.js"></script>
<script>
-// The trial is enabled by the token above in the meta tag.
-expect_success();
-
+if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
+ window.location = get_host_info().UNAUTHENTICATED_ORIGIN +
+ window.location.pathname;
+} else {
+ // The trial is enabled by the token above in the meta tag.
+ expect_success_bindings_insecure_context();
+}
</script>

Powered by Google App Engine
This is Rietveld 408576698