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

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

Issue 2252763002: [OriginTrialEnabled] Add layout tests for static attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 4 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/Source/bindings/tests/idls/modules/TestInterfacePartial4.idl » ('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/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');
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/tests/idls/modules/TestInterfacePartial4.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698