- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / platform_apps / ad_view / src_flag_required / chrometest.js
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.
4
5 // This test checks the "src" attribute is ignored when the
6 // "kEnableAdviewSrcAttribute" is missing.
7
8 function runTests(guestURL) {
9   chrome.test.runTests([
10     function test() {
11       var adview = document.getElementsByTagName("adview")[0];
12
13       adview.setAttribute("src", guestURL);
14
15       // Timeout is necessary to give the mutation observers a chance to fire.
16       // http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/1622.html
17       setTimeout(function() {
18         chrome.test.assertEq("", adview.getAttribute("src"));
19         chrome.test.assertEq(undefined, adview['src']);
20         chrome.test.assertEq(undefined, adview.src);
21         console.log("Properties and attributes are inactive.");
22         chrome.test.succeed();
23       }, 0);
24     }
25   ]);
26 }
27
28 window.onload = function() {
29   chrome.test.getConfig(function(config) {
30     var guestURL = 'http://localhost:' + config.testServer.port +
31         '/extensions/platform_apps/ad_view/ad_network_site/testsdk.html';
32     runTests(guestURL);
33   });
34 }