blob: e3fb10cd1ce773d0b8f6aff50509eda93c95284f [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
interface OriginTrialsTest {
[OriginTrialEnabled=OriginTrialsSampleAPI] readonly attribute boolean normalAttribute;
[OriginTrialEnabled=OriginTrialsSampleAPI] static readonly attribute boolean staticAttribute;
[OriginTrialEnabled=OriginTrialsSampleAPI] boolean normalMethod();
[OriginTrialEnabled=OriginTrialsSampleAPI] static boolean staticMethod();
[OriginTrialEnabled=OriginTrialsSampleAPI] const unsigned short CONSTANT = 1;
// This attribute uses native code to test whether the trial is enabled,
// and throws an exception in JavaScript if it is not.
[CallWith=ScriptState, RaisesException] readonly attribute boolean throwingAttribute;
// This method returns a dictionary, to allow inspection of trial-controlled
// members
OriginTrialsTestDictionary getDictionaryMethod();
// This method takes a dictionary as input, to test if trial-controlled
// members are accessed
void checkDictionaryMethod(OriginTrialsTestDictionary dict);
// These are available whether or not the trial is enabled.
readonly attribute boolean unconditionalAttribute;
static readonly attribute boolean staticUnconditionalAttribute;
boolean unconditionalMethod();
void unconditionalDictionaryMethod(OriginTrialsTestDictionary dict);
static boolean staticUnconditionalMethod();
const unsigned short UNCONDITIONAL_CONSTANT = 99;
// These are available whether or not the trial is enabled, but only in a
// secure context
[SecureContext] readonly attribute boolean secureUnconditionalAttribute;
// TODO(chasej): Add [SecureContext] when that attribute is fixed to work on
// static attributes. That problem is not related to [OriginTrialEnabled].
static readonly attribute boolean secureStaticUnconditionalAttribute;
[SecureContext] boolean secureUnconditionalMethod();
[SecureContext] static boolean secureStaticUnconditionalMethod();
// These are only available if the trial is enabled, as well as in secure
// context.
[SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] readonly attribute boolean secureAttribute;
[SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] static readonly attribute boolean secureStaticAttribute;
[SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] boolean secureMethod();
[SecureContext, OriginTrialEnabled=OriginTrialsSampleAPI] static boolean secureStaticMethod();