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

Unified Diff: chrome/test/data/extensions/api_test/executescript/run_at/test.js

Issue 9456037: Adding run_at to chrome.tabs.executeScript/insertCss. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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
« no previous file with comments | « chrome/test/data/extensions/api_test/executescript/run_at/test.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/executescript/run_at/test.js
diff --git a/chrome/test/data/extensions/api_test/executescript/run_at/test.js b/chrome/test/data/extensions/api_test/executescript/run_at/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..eed5b29e178f7a82ecf1b1e8e237c62c629ad142
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/executescript/run_at/test.js
@@ -0,0 +1,29 @@
+// Copyright (c) 2012 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.
+
+var relativePath =
+ '/files/extensions/api_test/executescript/run_at/test.html';
+var testUrl = 'http://b.com:PORT' + relativePath;
+
+chrome.test.getConfig(function(config) {
+ testUrl = testUrl.replace(/PORT/, config.testServer.port);
+ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
+ if (changeInfo.status != 'complete')
+ return;
+ chrome.tabs.onUpdated.removeListener(arguments.callee);
+ chrome.test.runTests([
+ function executeAtStartShouldSucceed() {
+ var scriptDetails = {};
+ scriptDetails.code = "document.title = 'Injected';";
+ scriptDetails.runAt = "document_start";
+ chrome.tabs.executeScript(tabId, scriptDetails, function() {
+ chrome.tabs.get(tabId, chrome.test.callbackPass(function(tab) {
+ chrome.test.assertEq('Injected', tab.title);
+ }));
+ });
+ },
+ ]);
+ });
+ chrome.tabs.create({ url: testUrl });
+});
« no previous file with comments | « chrome/test/data/extensions/api_test/executescript/run_at/test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698