- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / content_scripts / css_l10n / test_extension_id.js
1 // Copyright (c) 2011 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 // Tests that the 'body' element has had CSS injected, and that the CSS code
6 // has had the __MSG_@@extension_id__ message replaced ('extension_id' must
7 // not be present in any CSS code).
8
9 var rules = getMatchedCSSRules(document.getElementById('bodyId'));
10 if (rules != null) {
11   for (var i = 0; i < rules.length; ++i) {
12     if (rules.item(i).cssText.indexOf('extension_id') != -1) {
13       chrome.extension.sendRequest({tag: 'extension_id', message:
14           'Found unreplaced extension_id in: ' + rules.item(i).cssText});
15       break;
16     }
17   }
18   chrome.extension.sendRequest({tag: 'extension_id', message: 'passed'});
19 } else {
20   chrome.extension.sendRequest({tag: 'extension_id', message:
21       'No CSS rules found.'});
22 }
23