blob: d210a3dc365e0b199f0cbb6dcdbc83e007e283ae [file] [log] [blame]
// Copyright 2018 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.
chrome.test.getConfig(function(config) {
var guestUrl = 'http://localhost:' + config.testServer.port +
'/extensions/autoplay_iframe/frame.html';
var iframe = document.querySelector('iframe');
iframe.addEventListener('load', function() {
window.addEventListener('message', (e) => {
chrome.test.assertTrue('autoplayed' == e.data
|| 'NotSupportedError' == e.data);
chrome.test.notifyPass();
}, {once: true});
iframe.contentWindow.postMessage('start', '*');
}, {once: true});
iframe.src = guestUrl;
});