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 that <adview> attributes are also exposed as properties
6 // (with the same name and value).
8 function runTests(guestURL) {
11 var adview = document.getElementsByTagName('adview')[0];
12 var adnetwork = adview.getAttribute('ad-network');
14 adview.setAttribute('src', guestURL);
16 // Timeout is necessary to give the mutation observers a chance to fire.
17 // http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/1622.html
18 setTimeout(function() {
19 chrome.test.assertEq(guestURL, adview.getAttribute('src'));
20 chrome.test.assertEq(guestURL, adview['src']);
22 chrome.test.assertEq(adnetwork, adview.getAttribute('ad-network'));
23 chrome.test.assertEq(adnetwork, adview['ad-network']);
25 console.log("Properties verified.");
26 chrome.test.succeed();
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';