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

Unified Diff: chrome/test/data/extensions/api_test/css_l10n/background.html

Issue 7552028: Injected CSS localization fix (see bug no.) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changed browser_tests for scalability and added insertCSS browser test. 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/css_l10n/background.html
diff --git a/chrome/test/data/extensions/api_test/css_l10n/background.html b/chrome/test/data/extensions/api_test/css_l10n/background.html
new file mode 100644
index 0000000000000000000000000000000000000000..644a77563258948ec58605f03a210c1a2b0cce8f
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/css_l10n/background.html
@@ -0,0 +1,50 @@
+<script>
+
+var firstEnter = true;
+
+chrome.test.getConfig(function(config) {
+ chrome.test.log('Creating tab...');
+
+ var URL = 'http://localhost:PORT/files/extensions/test_file_with_body.html';
+ var TEST_FILE_URL = URL.replace(/PORT/, config.testServer.port);
+
+ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
+ if (changeInfo.status != 'complete')
+ return;
+ if ((!firstEnter))
+ return;
+ firstEnter = false;
+
+ chrome.test.runTests([
+
+ function extensionIDMessageGetsReplacedInContentScriptCSS() {
Nebojša Ćirić 2011/08/16 15:04:54 Comment about 2 paths you have to cover would be n
adriansc 2011/08/16 17:07:04 Done.
+ var script_file = {};
+ script_file.file = 'test_extension_id.js';
+ chrome.tabs.executeScript(tabId, script_file, function() {
+ chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) {
+ chrome.test.assertEq('passed', tab.title);
+ }));
+ });
+ },
+
+ function textDirectionMessageGetsReplacedInInsertCSSCall() {
+ var css_file = {};
+ css_file.code = 'p {direction: __MSG_@@bidi_dir__;}';
+ chrome.tabs.insertCSS(tabId, css_file, function() {
+ var script_file = {};
+ script_file.file = 'test_paragraph_dir_style.js';
+ chrome.tabs.executeScript(tabId,script_file, function() {
+ chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) {
+ chrome.test.assertEq('passed', tab.title);
+ }));
+ });
+ });
+ }
+
+ ]);
+ });
+
+ chrome.tabs.create({ url: TEST_FILE_URL });
+});
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698