* Returns whether the experiment is on or off. * @param {string} id * @return {boolean}
(id)
| 257 | * @return {boolean} |
| 258 | */ |
| 259 | function isExperimentOn_(id) { |
| 260 | const optInCookieValue = getCookie(window, '__Host-AMP_OPT_IN'); |
| 261 | switch (id) { |
| 262 | case EXPERIMENTAL_CHANNEL_ID: |
| 263 | return optInCookieValue == AMP_OPT_IN_COOKIE.EXPERIMENTAL; |
| 264 | case BETA_CHANNEL_ID: |
| 265 | return optInCookieValue == AMP_OPT_IN_COOKIE.BETA; |
| 266 | case NIGHTLY_CHANNEL_ID: |
| 267 | return optInCookieValue == AMP_OPT_IN_COOKIE.NIGHTLY; |
| 268 | case RTV_CHANNEL_ID: |
| 269 | return RTV_PATTERN.test(optInCookieValue); |
| 270 | default: |
| 271 | return isExperimentOn(window, /*OK*/ id); |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | /** |
| 276 | * Opts in to / out of the pre-release channels or a specific RTV by setting the |
no test coverage detected