1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This test checks the page running inside an <adview> has the ability to load
6 // and display an image inside an <iframe>.
8 function runTests(guestURL) {
11 var adview = document.getElementsByTagName("adview")[0];
13 adview.addEventListener("loadcommit", function() {
14 adview.contentWindow.postMessage({
15 message: "display-first-ad",
20 window.addEventListener("message", function(event) {
21 if (event.data.message == "ad-displayed") {
22 console.log("ad-displayed: " + event.data.data.adSize.height);
23 chrome.test.succeed();
27 adview.setAttribute("src", guestURL);
32 window.onload = function() {
33 chrome.test.getConfig(function(config) {
34 var guestURL = 'http://localhost:' + config.testServer.port +
35 '/extensions/platform_apps/ad_view/ad_network_site/testsdk.html';