| Index: chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
|
| diff --git a/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js b/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
|
| index 61d5a6b42e17d866564c1e93659ebab7c7558897..65c79d6a7165f155ec5c9fa30f0c4d39cc400673 100644
|
| --- a/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
|
| +++ b/chrome/test/data/extensions/api_test/automation/tests/desktop/common.js
|
| @@ -25,9 +25,31 @@ function findAutomationNode(root, condition) {
|
| return null;
|
| }
|
|
|
| -function setupAndRunTests(allTests) {
|
| - chrome.automation.getDesktop(function(rootNodeArg) {
|
| - rootNode = rootNodeArg;
|
| - chrome.test.runTests(allTests);
|
| +function runWithDocument(docString, callback) {
|
| + var url = 'data:text/html,<!doctype html>' + docString;
|
| + var createParams = {
|
| + active: true,
|
| + url: url
|
| + };
|
| + chrome.tabs.create(createParams, function(tab) {
|
| + chrome.tabs.onUpdated.addListener(function(tabId, changeInfo) {
|
| + if (tabId == tab.id && changeInfo.status == 'complete') {
|
| + callback();
|
| + }
|
| + });
|
| });
|
| }
|
| +
|
| +function setupAndRunTests(allTests, opt_docString) {
|
| + function runTestInternal() {
|
| + chrome.automation.getDesktop(function(rootNodeArg) {
|
| + rootNode = rootNodeArg;
|
| + chrome.test.runTests(allTests);
|
| + });
|
| + }
|
| +
|
| + if (opt_docString)
|
| + runWithDocument(opt_docString, runTestInternal);
|
| + else
|
| + runTestInternal();
|
| +}
|
|
|