| Index: chrome/test/data/extensions/platform_apps/ad_view/properties_exposed/chrometest.js
|
| diff --git a/chrome/test/data/extensions/platform_apps/ad_view/properties_exposed/chrometest.js b/chrome/test/data/extensions/platform_apps/ad_view/properties_exposed/chrometest.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..463127550c4952dd52cf9c63bd769ae57677043b
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/platform_apps/ad_view/properties_exposed/chrometest.js
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2013 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.
|
| +
|
| +// This test checks that <adview> attributes are also exposed as properties
|
| +// (with the same name and value).
|
| +
|
| +function runTests(guestURL) {
|
| + chrome.test.runTests([
|
| + function test() {
|
| + var adview = document.getElementsByTagName('adview')[0];
|
| + var adnetwork = adview.getAttribute('ad-network');
|
| +
|
| + adview.setAttribute('src', guestURL);
|
| +
|
| + // Timeout is necessary to give the mutation observers a chance to fire.
|
| + // http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/1622.html
|
| + setTimeout(function() {
|
| + chrome.test.assertEq(guestURL, adview.getAttribute('src'));
|
| + chrome.test.assertEq(guestURL, adview['src']);
|
| +
|
| + chrome.test.assertEq(adnetwork, adview.getAttribute('ad-network'));
|
| + chrome.test.assertEq(adnetwork, adview['ad-network']);
|
| +
|
| + console.log("Properties verified.");
|
| + chrome.test.succeed();
|
| + }, 0);
|
| + }
|
| + ]);
|
| +}
|
| +
|
| +window.onload = function() {
|
| + chrome.test.getConfig(function(config) {
|
| + var guestURL = 'http://localhost:' + config.testServer.port +
|
| + '/files/extensions/platform_apps/ad_view/ad_network_site/testsdk.html';
|
| + runTests(guestURL);
|
| + });
|
| +}
|
|
|