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.
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).
9 var rules = getMatchedCSSRules(document.getElementById('bodyId'));
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});
18 chrome.extension.sendRequest({tag: 'extension_id', message: 'passed'});
20 chrome.extension.sendRequest({tag: 'extension_id', message:
21 'No CSS rules found.'});