Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7829)

Unified Diff: chrome/test/data/extensions/api_test/content_scripts/css_l10n/test_extension_id.js

Issue 7552028: Injected CSS localization fix (see bug no.) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Cleaned up old unused function. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/content_scripts/css_l10n/test_extension_id.js
diff --git a/chrome/test/data/extensions/api_test/content_scripts/css_l10n/test_extension_id.js b/chrome/test/data/extensions/api_test/content_scripts/css_l10n/test_extension_id.js
new file mode 100644
index 0000000000000000000000000000000000000000..ec63253f14a2b66a12dde412d8d138d142ec1317
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/content_scripts/css_l10n/test_extension_id.js
@@ -0,0 +1,23 @@
+// Copyright (c) 2011 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.
+
+// Tests that the 'body' element has had CSS injected, and that the CSS code
+// has had the __MSG_@@extension_id__ message replaced ('extension_id' must
+// not be present in any CSS code).
+
+var rules = getMatchedCSSRules(document.getElementById('bodyId'));
+if (rules != null) {
+ for (var i = 0; i < rules.length; ++i) {
+ if (rules.item(i).cssText.indexOf('extension_id') != -1) {
+ chrome.extension.sendRequest({tag: 'extension_id', message:
+ 'Found unreplaced extension_id in: ' + rules.item(i).cssText});
+ break;
+ }
+ }
+ chrome.extension.sendRequest({tag: 'extension_id', message: 'passed'});
+} else {
+ chrome.extension.sendRequest({tag: 'extension_id', message:
+ 'No CSS rules found.'});
+}
+

Powered by Google App Engine
This is Rietveld 408576698