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

Unified Diff: chrome/test/data/extensions/api_test/executescript/test.html

Issue 421005: Make executeScript and insertCSS inject code into all frames.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/executescript/test.html
===================================================================
--- chrome/test/data/extensions/api_test/executescript/test.html (revision 32611)
+++ chrome/test/data/extensions/api_test/executescript/test.html (working copy)
@@ -8,14 +8,15 @@
'/files/extensions/api_test/executescript/test_executescript.html';
var testUrl = 'http://a.com:1337' + relativePath;
var testFailureUrl = 'http://b.com:1337' + relativePath;
-var testingFailure = false;
+var firstEnter = true;
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
- if (changeInfo.status == 'complete')
+ if (changeInfo.status != 'complete')
return;
- if (testingFailure) {
+ if (!firstEnter) {
return;
}
+ firstEnter = false;
chrome.test.runTests([
@@ -68,7 +69,6 @@
},
function executeJavaScriptCodeShouldFail() {
- testingFailure = true;
chrome.tabs.update(tabId, { url: testFailureUrl }, function() {
var script_file = {};
script_file.code = "document.title = 'executeScript';";
@@ -77,6 +77,21 @@
'". Extension manifest must request permission to access this ' +
'host.'));
});
+ },
+
+ function executeJavaScriptWithNoneValueShouldFail() {
+ var script_file = {};
+ chrome.tabs.executeScript(tabId, script_file, fail(
+ 'No source code or file specified.'));
+ },
+
+ function executeJavaScriptWithTwoValuesShouldFail() {
+ var script_file = {};
+ script_file.file = 'script1.js';
+ script_file.code = 'var test = 1;';
+ chrome.tabs.executeScript(tabId, script_file, fail(
+ 'Code and file should not be specified ' +
+ 'at the same time in the second argument.'));
}
]);
});
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/test/data/extensions/api_test/executescript_in_frame/frame0.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698