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

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

Issue 2057273002: [OriginTrials] Support OriginTrialEnabled IDL attribute on constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move signature creation out of for loop Created 4 years, 6 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/resources/origin_trials.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origin_trials.js b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origin_trials.js
index a16f1f2376ca077588589d9ca94deae17efff5c3..a5105dd6bf9de1a2a17772a61cc9e5bbfd997bb3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origin_trials.js
+++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/resources/origin_trials.js
@@ -19,9 +19,17 @@ expect_failure = (t) => {
}, {
desc: 'Attribute should not exist, with trial disabled',
code: () => {
+ assert_false('frobulateBindings' in window.internals);
assert_not_exists(window.internals, 'frobulateBindings');
assert_equals(window.internals['frobulateBindings'], undefined);
}
+ }, {
+ desc: 'Constant should not exist, with trial disabled',
+ code: () => {
+ assert_false('FROBULATE_CONST' in window.internals);
+ assert_not_exists(window.internals, 'FROBULATE_CONST');
+ assert_equals(window.internals['FROBULATE_CONST'], undefined);
+ }
}];
fetch_tests_from_worker(new Worker('resources/disabled-worker.js'));
@@ -47,5 +55,16 @@ test(() => {
assert_true(window.internals.frobulateBindings, 'Attribute should return boolean value');
}, 'Attribute should exist and return value');
+test(() => {
+ assert_idl_attribute(window.internals, 'FROBULATE_CONST');
+ assert_equals(window.internals.FROBULATE_CONST, 1, 'Constant should return integer value');
+ }, 'Constant should exist and return value');
+
+test(() => {
+ assert_idl_attribute(window.internals, 'FROBULATE_CONST');
+ window.internals.FROBULATE_CONST = 10;
+ assert_equals(window.internals.FROBULATE_CONST, 1, 'Constant should not be modifiable');
+ }, 'Constant should exist and not be modifiable');
+
fetch_tests_from_worker(new Worker('resources/enabled-worker.js'));
};

Powered by Google App Engine
This is Rietveld 408576698