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 e1573e5236d8834e1f676cfc9ae12db39fecd336..5f51a937be1fba12535fb1c176509a00b049aa34 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 |
@@ -1,4 +1,7 @@ |
// The sample API integrates origin trial checks at various entry points. |
+// References to "partial interface" mean that the [OriginTrialEnabled] |
+// IDL attribute is applied to an entire partial interface, instead of |
+// applied to individual IDL members. |
// These tests verify that any gated parts of the API are not available. |
expect_failure = (t) => { |
@@ -37,6 +40,14 @@ expect_failure = (t) => { |
assert_equals(window.internals['frobulatePartial'], undefined); |
} |
}, { |
+ desc: 'Static attribute should not exist on partial interface, with trial disabled', |
+ code: () => { |
+ var internalsInterface = window.internals.constructor; |
+ assert_false('frobulateStaticPartial' in internalsInterface); |
+ assert_not_exists(internalsInterface, 'frobulateStaticPartial'); |
+ assert_equals(internalsInterface['frobulateStaticPartial'], undefined); |
+ } |
+ }, { |
desc: 'Constant should not exist on partial interface, with trial disabled', |
code: () => { |
assert_false('FROBULATE_CONST_PARTIAL' in window.internals); |
@@ -100,6 +111,12 @@ test(() => { |
}, 'Attribute should exist on partial interface and return value'); |
test(() => { |
+ var internalsInterface = window.internals.constructor; |
+ assert_exists(internalsInterface, 'frobulateStaticPartial'); |
+ assert_true(internalsInterface.frobulateStaticPartial, 'Static attribute should return boolean value'); |
+ }, 'Static attribute should exist on partial interface and return value'); |
+ |
+test(() => { |
assert_idl_attribute(window.internals, 'FROBULATE_CONST_PARTIAL'); |
assert_equals(window.internals.FROBULATE_CONST_PARTIAL, 2, 'Constant should return integer value'); |
}, 'Constant should exist on partial interface and return value'); |
@@ -111,12 +128,6 @@ test(() => { |
test(() => { |
var internalsInterface = window.internals.constructor; |
- assert_exists(internalsInterface, 'frobulateStatic'); |
- assert_true(internalsInterface.frobulateStatic, 'Static attribute should return boolean value'); |
- }, 'Static attribute should exist on partial interface and return value'); |
- |
-test(() => { |
- var internalsInterface = window.internals.constructor; |
assert_exists(internalsInterface, 'frobulateStaticMethodPartial'); |
assert_true(internalsInterface.frobulateStaticMethodPartial(), 'Static method should return boolean value'); |
}, 'Static method should exist on partial interface and return value'); |