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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js

Issue 2340323002: Add Origin Trials Test interface, rather than attaching trials directly to internals. (Closed)
Patch Set: Updates Created 4 years, 3 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 | third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/enabled-worker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js
index 57619855df62677cd5a023f5d60cc0175026494c..0aaa1df88ccbee01a76f91342539772b23eb8990 100644
--- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js
+++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/disabled-worker.js
@@ -1,12 +1,23 @@
importScripts('/resources/testharness.js');
-// The trial should not be enabled.
+// Test whether the origin-trial-enabled attributes are *NOT* attached in a
+// worker where the trial is not enabled.
+// This is deliberately just a minimal set of tests to ensure that trials are
+// available in a worker. The full suite of tests are in origin_trials.js.
test(() => {
- assert_not_exists(self.internals, 'frobulate');
- assert_equals(self.internals.frobulate, undefined);
+ var testObject = self.internals.originTrialsTest();
+ assert_idl_attribute(testObject, 'throwingAttribute');
+ assert_throws("NotSupportedError", () => { testObject.throwingAttribute; },
+ 'Accessing attribute should throw error');
+ }, 'Accessing attribute should throw error');
+test(() => {
+ var testObject = self.internals.originTrialsTest();
+ assert_not_exists(testObject, 'normalAttribute');
+ assert_equals(testObject.normalAttribute, undefined);
}, 'Attribute should not exist in worker');
test(() => {
- assert_not_exists(self.internals, 'FROBULATE_CONST');
- assert_equals(self.internals.FROBULATE_CONST, undefined);
+ var testObject = self.internals.originTrialsTest();
+ assert_not_exists(testObject, 'CONSTANT');
+ assert_equals(testObject.CONSTANT, undefined);
}, 'Constant should not exist in worker');
done();
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/enabled-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698