| Index: chrome/test/data/extensions/api_test/executescript/test.html
|
| ===================================================================
|
| --- chrome/test/data/extensions/api_test/executescript/test.html (revision 32199)
|
| +++ 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'));
|
| }
|
| ]);
|
| });
|
|
|