OLD | NEW |
---|---|
(Empty) | |
1 // Tests that the 'body' element has had CSS injected, and that the CSS code | |
2 // has had the __MSG_@@extension_id__ message replaced ('extension_id' must | |
3 // not be present in any CSS code). | |
4 // | |
5 // Communicates the result back through the page title. | |
6 | |
7 var gotReplaced = true; | |
8 | |
9 var rules = getMatchedCSSRules(document.getElementById('bodyId')); | |
10 if (rules == null) { | |
11 document.title = 'no CSS rules injected'; | |
Mihai Parparita -not on Chrome
2011/08/16 17:42:41
This title will never be displayed, since you stil
adriansc
2011/08/16 22:13:51
Done.
| |
12 } else { | |
13 for (var i = 0; i < rules.length; ++i) { | |
14 if (rules.item(i).cssText.indexOf('extension_id') != -1) { | |
15 gotReplaced = false; | |
16 } | |
17 } | |
18 } | |
19 | |
20 if (gotReplaced == true) { | |
21 document.title = 'passed'; | |
Nebojša Ćirić
2011/08/16 17:40:24
Why not send request to the background page from h
adriansc
2011/08/16 22:13:51
Done.
| |
22 } else { | |
23 document.title = 'failed'; | |
24 } | |
25 | |
OLD | NEW |