summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/extensions/api_test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/data/extensions/api_test')
-rw-r--r--chrome/test/data/extensions/api_test/accessibility/get_alerts_for_tab/manifest.json1
-rw-r--r--chrome/test/data/extensions/api_test/canvas_2d/background.html20
-rw-r--r--chrome/test/data/extensions/api_test/canvas_2d/background.js21
-rw-r--r--chrome/test/data/extensions/api_test/canvas_2d/manifest.json3
-rw-r--r--chrome/test/data/extensions/api_test/extension_resource_request_policy/extension2/can_load_icons_from_hosted_apps.html2
-rw-r--r--chrome/test/data/extensions/api_test/icons/extension_no_permission/index.html25
-rw-r--r--chrome/test/data/extensions/api_test/icons/extension_no_permission/index.js13
-rw-r--r--chrome/test/data/extensions/api_test/icons/extension_no_permission/manifest.json1
-rw-r--r--chrome/test/data/extensions/api_test/icons/extension_with_permission/index.html66
-rw-r--r--chrome/test/data/extensions/api_test/icons/extension_with_permission/index.js55
-rw-r--r--chrome/test/data/extensions/api_test/icons/extension_with_permission/manifest.json1
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/a.html9
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/a.js8
-rw-r--r--chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json1
-rw-r--r--chrome/test/data/extensions/api_test/permissions/optional_gesture/manifest.json1
-rw-r--r--chrome/test/data/extensions/api_test/stubs/background.js (renamed from chrome/test/data/extensions/api_test/stubs/background.html)2
-rw-r--r--chrome/test/data/extensions/api_test/stubs/content_script.js6
-rw-r--r--chrome/test/data/extensions/api_test/stubs/manifest.json5
-rw-r--r--chrome/test/data/extensions/api_test/terminal/component_extension/manifest.json1
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.html10
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.js12
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.html14
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.js16
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.html15
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.js17
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.html12
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.js14
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.html14
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.js16
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.html15
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.js14
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.html13
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.js12
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.html12
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.js14
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/failures/b.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/failures/b.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/failures/e.html6
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/failures/e.js5
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/filtered/a.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/filtered/a.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html15
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.js11
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/history/a.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/history/a.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/b.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/b.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/d.html15
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/d.js12
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/f.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/f.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/i.html13
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/iframe/i.js8
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/manifest.json1
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/openTab/a.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/openTab/a.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html2
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.js7
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_api.html16
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_api.js17
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_failures.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_failures.js60
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_filtered.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_filtered.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_getFrame.html54
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_getFrame.js55
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_history.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_history.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_iframe.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_iframe.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_openTab.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_openTab.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_prerender.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_prerender.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js5
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js4
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.js5
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_userAction.html3
-rw-r--r--chrome/test/data/extensions/api_test/webnavigation/test_userAction.js4
96 files changed, 501 insertions, 432 deletions
diff --git a/chrome/test/data/extensions/api_test/accessibility/get_alerts_for_tab/manifest.json b/chrome/test/data/extensions/api_test/accessibility/get_alerts_for_tab/manifest.json
index 942f28e..4f86865 100644
--- a/chrome/test/data/extensions/api_test/accessibility/get_alerts_for_tab/manifest.json
+++ b/chrome/test/data/extensions/api_test/accessibility/get_alerts_for_tab/manifest.json
@@ -1,6 +1,7 @@
{
"name": "chrome.experimental.accessibility",
"version": "0.1",
+ "manifest_version": 2,
"description": "browser test for chrome.experimental.accessibility.getAlertsForTab API",
"background": {
"scripts": ["background.js"]
diff --git a/chrome/test/data/extensions/api_test/canvas_2d/background.html b/chrome/test/data/extensions/api_test/canvas_2d/background.html
index be073ba..73fdb18 100644
--- a/chrome/test/data/extensions/api_test/canvas_2d/background.html
+++ b/chrome/test/data/extensions/api_test/canvas_2d/background.html
@@ -10,24 +10,6 @@
<body>
<div>Below should be a canvas rendered with canvas2D</div>
<canvas id="my-canvas" width="100" height="100"></canvas>
- <script type="application/javascript">
- canvas = document.getElementById("my-canvas");
- if (canvas) {
- if (canvas.getContext) {
- context = canvas.getContext("2d");
- if (context) {
- context.fillStyle = 'red';
- context.fillRect(20, 20, 40, 40);
- chrome.test.notifyPass();
- } else {
- chrome.test.notifyFail("unable to getContext('2d')");
- }
- } else {
- chrome.test.notifyFail("canvas.getContext null");
- }
- } else {
- chrome.test.notifyFail("couldn't find element my-canvas");
- }
- </script>
+ <script src="background.js"></script>
</body>
</html>
diff --git a/chrome/test/data/extensions/api_test/canvas_2d/background.js b/chrome/test/data/extensions/api_test/canvas_2d/background.js
new file mode 100644
index 0000000..19bbbe6
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/canvas_2d/background.js
@@ -0,0 +1,21 @@
+// 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.
+
+canvas = document.getElementById("my-canvas");
+if (canvas) {
+ if (canvas.getContext) {
+ context = canvas.getContext("2d");
+ if (context) {
+ context.fillStyle = 'red';
+ context.fillRect(20, 20, 40, 40);
+ chrome.test.notifyPass();
+ } else {
+ chrome.test.notifyFail("unable to getContext('2d')");
+ }
+ } else {
+ chrome.test.notifyFail("canvas.getContext null");
+ }
+} else {
+ chrome.test.notifyFail("couldn't find element my-canvas");
+}
diff --git a/chrome/test/data/extensions/api_test/canvas_2d/manifest.json b/chrome/test/data/extensions/api_test/canvas_2d/manifest.json
index 5001c21..d2a8282 100644
--- a/chrome/test/data/extensions/api_test/canvas_2d/manifest.json
+++ b/chrome/test/data/extensions/api_test/canvas_2d/manifest.json
@@ -4,5 +4,6 @@
"background": {
"page": "background.html"
},
- "version": "0.1"
+ "version": "0.1",
+ "manifest_version": 2
}
diff --git a/chrome/test/data/extensions/api_test/extension_resource_request_policy/extension2/can_load_icons_from_hosted_apps.html b/chrome/test/data/extensions/api_test/extension_resource_request_policy/extension2/can_load_icons_from_hosted_apps.html
index 096d66f..5504375 100644
--- a/chrome/test/data/extensions/api_test/extension_resource_request_policy/extension2/can_load_icons_from_hosted_apps.html
+++ b/chrome/test/data/extensions/api_test/extension_resource_request_policy/extension2/can_load_icons_from_hosted_apps.html
@@ -1,3 +1,3 @@
<img src="chrome-extension://fnbdbepgnidhjejikpionpfohdjjogpm/test.png"
onload="chrome.test.notifyPass()"
- onerror="chrome.test.notifyFail()">
+ onerror="chrome.test.notifyFail('Should not have loaded')">
diff --git a/chrome/test/data/extensions/api_test/icons/extension_no_permission/index.html b/chrome/test/data/extensions/api_test/icons/extension_no_permission/index.html
index 47d3506..b0340da 100644
--- a/chrome/test/data/extensions/api_test/icons/extension_no_permission/index.html
+++ b/chrome/test/data/extensions/api_test/icons/extension_no_permission/index.html
@@ -1,25 +1,6 @@
<html>
-<head>
-<title>Not Loaded</title>
-<script type="text/javascript">
-
-function load(e) {
- document.title = "Loaded";
-}
-
-function error(e) {
- document.title = "Not Loaded";
-}
-
-</script>
-
-</head>
+<head><title>Not Loaded</title></head>
<body>
-
-<img src="chrome://extension-icon/apocjbpjpkghdepdngjlknfpmabcmlao/24/0"
- testsize="24px"
- onload="load(event);"
- onerror="error(event);"/>
-
+<script src="index.js"></script>
</body>
-</head>
+</html>
diff --git a/chrome/test/data/extensions/api_test/icons/extension_no_permission/index.js b/chrome/test/data/extensions/api_test/icons/extension_no_permission/index.js
new file mode 100644
index 0000000..5447286
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/icons/extension_no_permission/index.js
@@ -0,0 +1,13 @@
+// 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 img = document.createElement('img');
+img.onload = function() {
+ document.title = 'Loaded';
+};
+img.onerror = function() {
+ document.title = 'Not Loaded';
+};
+img.src = 'chrome://extension-icon/apocjbpjpkghdepdngjlknfpmabcmlao/24/0';
+document.body.appendChild(img);
diff --git a/chrome/test/data/extensions/api_test/icons/extension_no_permission/manifest.json b/chrome/test/data/extensions/api_test/icons/extension_no_permission/manifest.json
index 2833a1c..fa96782 100644
--- a/chrome/test/data/extensions/api_test/icons/extension_no_permission/manifest.json
+++ b/chrome/test/data/extensions/api_test/icons/extension_no_permission/manifest.json
@@ -3,6 +3,7 @@
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCk/WWuKvmfJx/Q0ldDrtXsP7JbFOPtP7rfasiAlmQoJpW4ECHpqTqj/i/E68MVLzAagp790vUeSgyJF4U0P3eHf8e6pskyrEz0+UYt6PElEIjyOnMu5JY3c6l7NdeJK5DVI0SIsspeA1HmxUQ+7CCv7A4fTCwwp1UNjQsG56feeQIDAQAB",
"name": "test",
"version": "0.1",
+ "manifest_version": 2,
"permissions": [],
"incognito": "split",
"icons": {
diff --git a/chrome/test/data/extensions/api_test/icons/extension_with_permission/index.html b/chrome/test/data/extensions/api_test/icons/extension_with_permission/index.html
index 9642617..f9e9efd 100644
--- a/chrome/test/data/extensions/api_test/icons/extension_with_permission/index.html
+++ b/chrome/test/data/extensions/api_test/icons/extension_with_permission/index.html
@@ -1,63 +1,3 @@
-<script type="text/javascript">
-
-var TOTAL = 4;
-var count = 0;
-
-function load(e) {
- if (++count < TOTAL)
- return;
-
- // Good. All the images have loaded. Now make sure they're the correct size.
- var imgs = document.getElementsByTagName('img');
- for (var x = 0; x < imgs.length; x++) {
- var style = getComputedStyle(imgs[x]);
- var size = imgs[x].getAttribute('testsize');
- if (style.height != size || style.width != size) {
- document.title = "Incorrect size on " + imgs[x].src;
- return;
- }
- }
-
- // Success!
- document.title = "Loaded";
-}
-
-function error(e) {
- // We failed to load an image that should have loaded.
- document.title = "Not loaded: " + e.target.src;
-}
-
-</script>
-
-<!-- Tests loading a standard 128px icon. -->
-<img src="chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/128/0"
- testsize="128px"
- onload="load(event);"
- onerror="error(event);"/>
-
-<!--
- Tests loading a standard 48px icon with a MATCH_SMALLER.
- This should not be resized to 48px.
--->
-<img src="chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/48/2"
- testsize="32px"
- onload="load(event);"
- onerror="error(event);"/>
-
-<!--
- Tests loading a standard 32px icon, grayscale. We assume that we
- actually got a grayscale image back here.
--->
-<img src="chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/32/1?grayscale=true"
- testsize="32px"
- onload="load(event);"
- onerror="error(event);"/>
-
-<!--
- Tests loading a 16px by resizing the 32px version (MATCH_BIGGER).
- This should be resized to 16px.
--->
-<img src="chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/16/1"
- testsize="16px"
- onload="load(event);"
- onerror="error(event);"/>
+<body>
+<script src="index.js"></script>
+</body>
diff --git a/chrome/test/data/extensions/api_test/icons/extension_with_permission/index.js b/chrome/test/data/extensions/api_test/icons/extension_with_permission/index.js
new file mode 100644
index 0000000..7600c48
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/icons/extension_with_permission/index.js
@@ -0,0 +1,55 @@
+// 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 TEST_CASES = [
+ // Tests loading a standard 128px icon.
+ {
+ url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/128/0',
+ expectedSize: 128
+ },
+ // Tests loading a standard 48px icon with a MATCH_SMALLER.
+ // This should not be resized to 48px.
+ {
+ url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/48/2',
+ expectedSize: 32
+ },
+ // Tests loading a standard 32px icon, grayscale. We assume that we actually
+ // got a grayscale image back here.
+ {
+ url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/' +
+ '32/1?grayscale=true',
+ expectedSize: 32
+ },
+ // Tests loading a 16px by resizing the 32px version (MATCH_BIGGER).
+ // This should be resized to 16px.
+ {
+ url: 'chrome://extension-icon/gbmgkahjioeacddebbnengilkgbkhodg/16/1',
+ expectedSize: 16
+ }
+];
+
+var loadedImageCount = 0;
+
+TEST_CASES.forEach(function(testCase) {
+ var img = document.createElement('img');
+ img.onload = function() {
+ if (img.naturalWidth != testCase.expectedSize ||
+ img.naturalHeight != testCase.expectedSize) {
+ document.title = 'Incorrect size on ' + testCase.url +
+ ' Expected: ' + testCase.expectedSize + 'x' + testCase.expectedSize +
+ ' Actual: ' + img.naturalWidth + 'x' + img.naturalHeight;
+ return;
+ }
+
+ if (++loadedImageCount == TEST_CASES.length) {
+ document.title = 'Loaded';
+ }
+ };
+ img.onerror = function() {
+ // We failed to load an image that should have loaded.
+ document.title = 'Couldn\'t load ' + testCase.url;
+ };
+ img.src = testCase.url;
+ document.body.appendChild(img);
+});
diff --git a/chrome/test/data/extensions/api_test/icons/extension_with_permission/manifest.json b/chrome/test/data/extensions/api_test/icons/extension_with_permission/manifest.json
index ea4d279..dea2b91 100644
--- a/chrome/test/data/extensions/api_test/icons/extension_with_permission/manifest.json
+++ b/chrome/test/data/extensions/api_test/icons/extension_with_permission/manifest.json
@@ -3,6 +3,7 @@
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuBACa7q+sBalhnUT3lsGuuZ9PEzfoJCBoPJdCS0cfQGqAlgbBsKKqnLLgrUuK9g23PYcGTOryxnJ0eLr3Wl+gkV+CcZ4i64qfBSPt+WCTO4F9XHnqJVWRDjNY+7q0ytf8X6wdgA6ebTx4OE1t52nudNhGgYcFkRYwNAjwV5PKzQIDAQAB",
"name": "test",
"version": "0.1",
+ "manifest_version": 2,
"permissions": [ "management" ],
"incognito": "split",
"icons": {
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/a.html b/chrome/test/data/extensions/api_test/offscreen_tabs/a.html
index 872d7fc..747ae5a 100644
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/a.html
+++ b/chrome/test/data/extensions/api_test/offscreen_tabs/a.html
@@ -1,14 +1,9 @@
<html>
<head>
<script src="tab_util.js"></script>
- <script>
- function keyboard(e) {
- if (e.charCode == Q_KEY)
- window.location = 'c.html';
- }
- </script>
+ <script src="a.js"></script>
</head>
- <body onkeypress="keyboard(event)">
+ <body>
<a href="b.html" style="position:absolute; left:10px; top:10px;">b.html</a>
</body>
</head>
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/a.js b/chrome/test/data/extensions/api_test/offscreen_tabs/a.js
new file mode 100644
index 0000000..39cf26d
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/offscreen_tabs/a.js
@@ -0,0 +1,8 @@
+// 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.
+
+onkeypress = function(e) {
+ if (e.charCode == Q_KEY)
+ window.location = 'c.html';
+};
diff --git a/chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json b/chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json
index b7684dc..faf7ba3 100644
--- a/chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json
+++ b/chrome/test/data/extensions/api_test/offscreen_tabs/manifest.json
@@ -2,5 +2,6 @@
"name": "chrome.experimental.offscreenTabs API test",
"description": "tests offscrene tabs API",
"version": "1",
+ "manifest_version": 2,
"permissions": [ "experimental", "*://*/*" ]
}
diff --git a/chrome/test/data/extensions/api_test/permissions/optional_gesture/manifest.json b/chrome/test/data/extensions/api_test/permissions/optional_gesture/manifest.json
index 2da308d..9282102 100644
--- a/chrome/test/data/extensions/api_test/permissions/optional_gesture/manifest.json
+++ b/chrome/test/data/extensions/api_test/permissions/optional_gesture/manifest.json
@@ -6,6 +6,5 @@
"background": {
"scripts": ["background.js"]
},
- "permissions": ["permissions"],
"optional_permissions": ["tabs"]
}
diff --git a/chrome/test/data/extensions/api_test/stubs/background.html b/chrome/test/data/extensions/api_test/stubs/background.js
index f1d207d..1e10767 100644
--- a/chrome/test/data/extensions/api_test/stubs/background.html
+++ b/chrome/test/data/extensions/api_test/stubs/background.js
@@ -1,4 +1,3 @@
-<script>
// 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.
@@ -17,4 +16,3 @@ chrome.extension.onRequest.addListener(function(msg, sender, responseFunc) {
// On first install, send a success message so the test can continue.
chrome.test.notifyPass();
-</script>
diff --git a/chrome/test/data/extensions/api_test/stubs/content_script.js b/chrome/test/data/extensions/api_test/stubs/content_script.js
index dfdb0e7..1b3f2eb 100644
--- a/chrome/test/data/extensions/api_test/stubs/content_script.js
+++ b/chrome/test/data/extensions/api_test/stubs/content_script.js
@@ -24,6 +24,12 @@ chrome.extension.sendRequest("getApi", function(apis) {
if (typeof(module[section]) == "undefined")
return;
module[section].forEach(function(entry) {
+ // Ignore entries that are not applicable to the manifest that we're
+ // running under.
+ if (entry.maximumManifestVersion && entry.maximumManifestVersion < 2) {
+ return;
+ }
+
var path = namespace + "." + entry.name;
if (module.unprivileged || entry.unprivileged) {
unprivilegedPaths.push(path);
diff --git a/chrome/test/data/extensions/api_test/stubs/manifest.json b/chrome/test/data/extensions/api_test/stubs/manifest.json
index 6909f1e..af8bbbb 100644
--- a/chrome/test/data/extensions/api_test/stubs/manifest.json
+++ b/chrome/test/data/extensions/api_test/stubs/manifest.json
@@ -1,7 +1,10 @@
{
"name": "Content Script Extension API Stubs Test",
"version": "1.0",
- "background_page": "background.html",
+ "manifest_version": 2,
+ "background": {
+ "scripts": ["background.js"]
+ },
"content_scripts": [
{
"matches": ["http://*/*"],
diff --git a/chrome/test/data/extensions/api_test/terminal/component_extension/manifest.json b/chrome/test/data/extensions/api_test/terminal/component_extension/manifest.json
index 629c551..b21761f 100644
--- a/chrome/test/data/extensions/api_test/terminal/component_extension/manifest.json
+++ b/chrome/test/data/extensions/api_test/terminal/component_extension/manifest.json
@@ -2,6 +2,7 @@
"key": "MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQChptAQ0n4R56N03nWQ1ogR7DVRBjGo80Vw6G9KLjzZv44D8rq5Q5IkeQrtKgWyZfXevlsCe3LaLo18rcz8iZx6lK2xhLdUR+ORjsjuBfdEL5a5cWeRTSxf75AcqndQsmpwMBdrMTCZ8jQNusUI+XlrihLNNJuI5TM4vNINI5bYFQIBIw==",
"name": "chrome.terminalPrivate.apitest",
"version": "0.1",
+ "manifest_version": 2,
"description": "end-to-end test for terminalPrivate api. Test opens two crosh processes, starts infinite loop that echos 'aaaa' in both of them and observes output.",
"permissions": ["terminalPrivate"]
}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html b/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html
index 9c8afe8..ed52c3d 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.html
@@ -1 +1 @@
-<body onload="document.location='b.html'"></body>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.js b/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.js
new file mode 100644
index 0000000..b54c36e
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/clientRedirect/a.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ document.location='b.html';
+}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.html
index e206db4..f4b9cd5 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.html
@@ -1,10 +1,2 @@
<!-- Navigates from an extension URL to a HTTP URL causing a process switch. -->
-<script>
-function navigate() {
- location.href =
- "http://127.0.0.1:" +
- location.search.substr(1) +
- "/files/extensions/api_test/webnavigation/crossProcess/empty.html";
-}
-</script>
-<body onload="setTimeout(navigate, 0)"></body>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.js
new file mode 100644
index 0000000..5df72cb
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/a.js
@@ -0,0 +1,12 @@
+// 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.
+
+onload = function() {
+ setTimeout(function() {
+ location.href =
+ "http://127.0.0.1:" +
+ location.search.substr(1) +
+ "/files/extensions/api_test/webnavigation/crossProcess/empty.html";
+ }, 0);
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.html
index 60892dc..5da3404 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.html
@@ -1,15 +1,3 @@
<!-- Starting on an extension URL, redirects through an app extent to an HTTP
URL, causing two process switches. -->
-<script>
-function navigate() {
- var target =
- "http://127.0.0.1:" +
- location.search.substr(1) +
- "/files/extensions/api_test/webnavigation/crossProcess/empty.html";
- location.href =
- "http://www.a.com:" +
- location.search.substr(1) +
- "/server-redirect?" + target;
-}
-</script>
-<body onload="setTimeout(navigate, 0)"></body>
+<script src="c.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.js
new file mode 100644
index 0000000..58de17a
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/c.js
@@ -0,0 +1,16 @@
+// 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.
+
+onload = function() {
+ setTimeout(function() {
+ var target =
+ "http://127.0.0.1:" +
+ location.search.substr(1) +
+ "/files/extensions/api_test/webnavigation/crossProcess/empty.html";
+ location.href =
+ "http://www.a.com:" +
+ location.search.substr(1) +
+ "/server-redirect?" + target;
+ }, 0);
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.html
index bdce6b4..3c4bb96 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.html
@@ -1,16 +1,3 @@
<!-- Redirects to a slowly loading page and starts a new navigation before it
commits. -->
-<script>
-var target =
- location.origin + location.pathname.replace("d.html", "empty.html");
-
-function navigate() {
- location.href =
- "http://127.0.0.1:" + location.search.substr(1) + "/test1";
-}
-
-function navigate2() {
- location.href = target;
-}
-</script>
-<body onload="setTimeout(navigate, 0)"></body>
+<script src="d.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.js
new file mode 100644
index 0000000..ff8bf32
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/d.js
@@ -0,0 +1,17 @@
+// 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 target =
+ location.origin + location.pathname.replace("d.html", "empty.html");
+
+onload = function() {
+ setTimeout(function() {
+ location.href =
+ "http://127.0.0.1:" + location.search.substr(1) + "/test1";
+ }, 0);
+};
+
+function navigate2() {
+ location.href = target;
+}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.html
index a583a44..5b8bf64 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.html
@@ -1,13 +1,3 @@
<!-- Redirects to a slowly loading page, and then updates its history state
before the new load commits. -->
-<script>
-function updateHistory() {
- history.pushState({}, "", "empty.html");
-}
-
-function navigate() {
- location.href =
- "http://127.0.0.1:" + location.search.substr(1) + "/test2";
-}
-</script>
-<body onload="setTimeout(navigate, 0)"></body>
+<script src="e.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.js
new file mode 100644
index 0000000..ed136b8
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/e.js
@@ -0,0 +1,14 @@
+// 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.
+
+function updateHistory() {
+ history.pushState({}, "", "empty.html");
+}
+
+onload = function() {
+ setTimeout(function() {
+ location.href =
+ "http://127.0.0.1:" + location.search.substr(1) + "/test2";
+ }, 0);
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.html
index 2995adf..fdaf6010 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.html
@@ -1,15 +1,3 @@
<!-- Redirects to a slowly loading page and then updates its reference
fragment before the new page commits. -->
-<script>
-var target = location.href + "#foo";
-
-function updateFragment() {
- location.href = target;
-}
-
-function navigate() {
- location.href =
- "http://127.0.0.1:" + location.search.substr(1) + "/test3";
-}
-</script>
-<body onload="setTimeout(navigate, 0)"></body>
+<script src="f.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.js
new file mode 100644
index 0000000..acbf559
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/f.js
@@ -0,0 +1,16 @@
+// 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 target = location.href + "#foo";
+
+function updateFragment() {
+ location.href = target;
+}
+
+onload = function() {
+ setTimeout(function() {
+ location.href =
+ "http://127.0.0.1:" + location.search.substr(1) + "/test3";
+ }, 0);
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.html
index ee95424..3d69b31 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.html
@@ -1,17 +1,6 @@
<!-- Page with a slowly loading iframe that updates its reference fragment
before the iframe commits. -->
-<script>
-var target = location.href + "#foo";
-
-function updateFragment() {
- location.href = target;
-}
-
-function loadframe() {
- var frame = document.getElementById("frame");
- frame.src = "http://127.0.0.1:" + location.search.substr(1) + "/test4";
-}
-</script>
-<body onload="loadframe()">
+<script src="g.js"></script>
+<body>
<iframe id="frame"></frame>
</body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.js
new file mode 100644
index 0000000..fbda70f
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/g.js
@@ -0,0 +1,14 @@
+// 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 target = location.href + "#foo";
+
+function updateFragment() {
+ location.href = target;
+}
+
+onload = function() {
+ var frame = document.getElementById("frame");
+ frame.src = "http://127.0.0.1:" + location.search.substr(1) + "/test4";
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.html
index c0fa1c5..abc0c7a 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.html
@@ -1,15 +1,6 @@
<!-- Page with a slowly loading iframe that updates its history state before
the iframe commits. -->
-<script>
-function updateHistory() {
- history.pushState({}, "", "empty.html");
-}
-
-function loadframe() {
- var frame = document.getElementById("frame");
- frame.src = "http://127.0.0.1:" + location.search.substr(1) + "/test5";
-}
-</script>
-<body onload="loadframe()">
+<script src="h.js"></script>
+<body>
<iframe id="frame"></frame>
</body>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.js
new file mode 100644
index 0000000..7870865
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/h.js
@@ -0,0 +1,12 @@
+// 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.
+
+function updateHistory() {
+ history.pushState({}, "", "empty.html");
+}
+
+onload = function() {
+ var frame = document.getElementById("frame");
+ frame.src = "http://127.0.0.1:" + location.search.substr(1) + "/test5";
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.html b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.html
index 41b3982..cea29d8 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.html
@@ -1,13 +1,3 @@
<!-- Redirects to a slowly loading page but then replaces its history state
before the page commits. -->
-<script>
-function updateHistory() {
- history.replaceState({}, "", "empty.html");
-}
-
-function navigate() {
- location.href =
- "http://127.0.0.1:" + location.search.substr(1) + "/test6";
-}
-</script>
-<body onload="setTimeout(navigate, 0)"></body>
+<script src="i.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.js b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.js
new file mode 100644
index 0000000..e9d909f
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/crossProcess/i.js
@@ -0,0 +1,14 @@
+// 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.
+
+function updateHistory() {
+ history.replaceState({}, "", "empty.html");
+}
+
+onload = function() {
+ setTimeout(function() {
+ location.href =
+ "http://127.0.0.1:" + location.search.substr(1) + "/test6";
+ }, 0);
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/failures/b.html b/chrome/test/data/extensions/api_test/webnavigation/failures/b.html
index 33413d3..f5c7be2 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/failures/b.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/failures/b.html
@@ -1 +1 @@
-<body onload="document.location = 'c.html'"></body>
+<script src="b.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/failures/b.js b/chrome/test/data/extensions/api_test/webnavigation/failures/b.js
new file mode 100644
index 0000000..4956417
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/failures/b.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ document.location = 'c.html';
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/failures/e.html b/chrome/test/data/extensions/api_test/webnavigation/failures/e.html
index 7d554d6..db0ac58 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/failures/e.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/failures/e.html
@@ -1,4 +1,2 @@
-<script>
-stop();
-</script>
-<img src="nonexistant/img.gif">
+<script src="e.js"></script>
+<img src="nonexistent/img.gif">
diff --git a/chrome/test/data/extensions/api_test/webnavigation/failures/e.js b/chrome/test/data/extensions/api_test/webnavigation/failures/e.js
new file mode 100644
index 0000000..e88ddae
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/failures/e.js
@@ -0,0 +1,5 @@
+// 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.
+
+stop();
diff --git a/chrome/test/data/extensions/api_test/webnavigation/filtered/a.html b/chrome/test/data/extensions/api_test/webnavigation/filtered/a.html
index 9c8afe8..ed52c3d 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/filtered/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/filtered/a.html
@@ -1 +1 @@
-<body onload="document.location='b.html'"></body>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/filtered/a.js b/chrome/test/data/extensions/api_test/webnavigation/filtered/a.js
new file mode 100644
index 0000000..b54c36e
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/filtered/a.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ document.location='b.html';
+}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html
index b0b6c8b..ed52c3d 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.html
@@ -1,14 +1 @@
-<html>
-<head>
-<script>
-function navigate() {
- if (window.sessionStorage['redirected'] != 1) {
- window.sessionStorage['redirected'] = 1;
- // Required so this results in a history entry being created.
- window.setTimeout('document.location = "b.html"', 0);
- }
-}
-</script>
-</head>
-<body onload="navigate()"></body>
-</html>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.js b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.js
new file mode 100644
index 0000000..56714f2
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/a.js
@@ -0,0 +1,11 @@
+// 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.
+
+onload = function() {
+ if (window.sessionStorage['redirected'] != 1) {
+ window.sessionStorage['redirected'] = 1;
+ // Required so this results in a history entry being created.
+ window.setTimeout(function() {document.location = 'b.html'}, 0);
+ }
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html
index 8fb41fd..f5c7be2 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.html
@@ -1 +1 @@
-<body onload="history.back();"></body>
+<script src="b.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.js b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.js
new file mode 100644
index 0000000..de05323
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/forwardBack/b.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ history.back();
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/history/a.html b/chrome/test/data/extensions/api_test/webnavigation/history/a.html
index d66558a..ed52c3d 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/history/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/history/a.html
@@ -1 +1 @@
-<body onload="history.pushState({}, 'foo', 'b.html');"></body>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/history/a.js b/chrome/test/data/extensions/api_test/webnavigation/history/a.js
new file mode 100644
index 0000000..e5ff4ff
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/history/a.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ history.pushState({}, 'foo', 'b.html');
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html b/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html
index c5741ef..f5c7be2 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/b.html
@@ -1 +1 @@
-<body onload='document.location = "c.html"'></body>
+<script src="b.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/b.js b/chrome/test/data/extensions/api_test/webnavigation/iframe/b.js
new file mode 100644
index 0000000..4956417
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/b.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ document.location = 'c.html';
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/d.html b/chrome/test/data/extensions/api_test/webnavigation/iframe/d.html
index d34a39b..395ea67 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/iframe/d.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/d.html
@@ -1,10 +1,5 @@
-<html><body>
-<script>
- function loadF() {
- var iframe = document.createElement('iframe');
- iframe.src = "f.html";
- var div = document.getElementById('f');
- div.appendChild(iframe);
- }
-</script>
-<iframe src="e.html" onload="loadF()"></iframe><div id="f"></div></body></html>
+<body>
+<script src="d.js"></script>
+</body>
+
+
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/d.js b/chrome/test/data/extensions/api_test/webnavigation/iframe/d.js
new file mode 100644
index 0000000..24baf43
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/d.js
@@ -0,0 +1,12 @@
+// 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 eFrame = document.createElement('iframe');
+eFrame.onload = function() {
+ var fFrame = document.createElement('iframe');
+ fFrame.src = 'f.html';
+ document.body.appendChild(fFrame);
+};
+eFrame.src = 'e.html';
+document.body.appendChild(eFrame);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html b/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html
index 993b37a..8b95e59 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/f.html
@@ -1 +1 @@
-<body onload='document.location = "g.html"'></body>
+<script src="f.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/f.js b/chrome/test/data/extensions/api_test/webnavigation/iframe/f.js
new file mode 100644
index 0000000..44e51e6
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/f.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ document.location = 'g.html';
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html b/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html
index 89f750c..bcf89c2 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/i.html
@@ -1,12 +1 @@
-<html>
-<head>
-<script>
-function navigate() {
- parent.location.href='c.html';
- location.replace('about:blank');
-}
-</script>
-</head>
-<body onload="navigate()"></body>
-</body>
-</html>
+<script src="i.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/iframe/i.js b/chrome/test/data/extensions/api_test/webnavigation/iframe/i.js
new file mode 100644
index 0000000..5ee0366
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/iframe/i.js
@@ -0,0 +1,8 @@
+// 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.
+
+onload = function() {
+ parent.location.href = 'c.html';
+ location.replace('about:blank');
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/manifest.json b/chrome/test/data/extensions/api_test/webnavigation/manifest.json
index 0b64814..b179c54 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/manifest.json
+++ b/chrome/test/data/extensions/api_test/webnavigation/manifest.json
@@ -1,6 +1,7 @@
{
"name": "webNavigation",
"version": "1.0",
+ "manifest_version": 2,
"description": "Tests the webNavigation API events.",
"permissions": ["webNavigation", "tabs"]
}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html b/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html
index f318e9c..ed52c3d 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/openTab/a.html
@@ -1 +1 @@
-<body onload='window.open("b.html")'></body>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/openTab/a.js b/chrome/test/data/extensions/api_test/webnavigation/openTab/a.js
new file mode 100644
index 0000000..1682ad4
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/openTab/a.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ window.open('b.html');
+}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html b/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html
index 6a43763..ed52c3d 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.html
@@ -1 +1 @@
-<body onload='document.location = "a.html#anchor";'></body>
+<script src="a.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.js b/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.js
new file mode 100644
index 0000000..dabcfa5
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/referenceFragment/a.js
@@ -0,0 +1,7 @@
+// 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.
+
+onload = function() {
+ document.location = 'a.html#anchor';
+}
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_api.html b/chrome/test/data/extensions/api_test/webnavigation/test_api.html
index 3e0f4ca..6890c6f 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_api.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_api.html
@@ -1,15 +1 @@
-<script>
-chrome.webNavigation.onBeforeNavigate.addListener(
- function(details) {});
-chrome.webNavigation.onCommitted.addListener(
- function(details) {});
-chrome.webNavigation.onDOMContentLoaded.addListener(
- function(details) {});
-chrome.webNavigation.onCompleted.addListener(
- function(details) {});
-chrome.webNavigation.onErrorOccurred.addListener(
- function(details) {});
-chrome.webNavigation.onCreatedNavigationTarget.addListener(
- function(details) {});
-chrome.test.notifyPass();
-</script>
+<script src="test_api.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_api.js b/chrome/test/data/extensions/api_test/webnavigation/test_api.js
new file mode 100644
index 0000000..146ada9
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_api.js
@@ -0,0 +1,17 @@
+// 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.
+
+chrome.webNavigation.onBeforeNavigate.addListener(
+ function(details) {});
+chrome.webNavigation.onCommitted.addListener(
+ function(details) {});
+chrome.webNavigation.onDOMContentLoaded.addListener(
+ function(details) {});
+chrome.webNavigation.onCompleted.addListener(
+ function(details) {});
+chrome.webNavigation.onErrorOccurred.addListener(
+ function(details) {});
+chrome.webNavigation.onCreatedNavigationTarget.addListener(
+ function(details) {});
+chrome.test.notifyPass();
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.html b/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.html
index e256495..ebd903f 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.html
@@ -1,5 +1,2 @@
<script src="test_clientRedirect.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js b/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js
index 72534c4..cfdea4f 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_clientRedirect.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -77,4 +77,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.html b/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.html
index e44bf8e..c6241acb 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.html
@@ -1,5 +1,2 @@
<script src="test_crossProcess.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.js b/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.js
index ed77310..7dc3098 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_crossProcess.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
var URL_REGULAR =
"http://127.0.0.1:PORT/files/extensions/api_test/webnavigation/crossProcess/empty.html";
@@ -635,4 +635,4 @@ function runTests() {
]);
});
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_failures.html b/chrome/test/data/extensions/api_test/webnavigation/test_failures.html
index 7fc4139..f7d31a7 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_failures.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_failures.html
@@ -1,5 +1,2 @@
<script src="test_failures.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_failures.js b/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
index 357b149..4b33bd8 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
@@ -2,36 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
chrome.test.runTests([
- // Navigates to a non-existant page.
- function nonExistant() {
- expect([
- { label: "onBeforeNavigate",
- event: "onBeforeNavigate",
- details: { frameId: 0,
- processId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/nonexistant.html') }},
- { label: "onErrorOccurred",
- event: "onErrorOccurred",
- details: { error: "net::ERR_FILE_NOT_FOUND",
- frameId: 0,
- processId: 0,
- tabId: 0,
- timeStamp: 0,
- url: getURL('failures/nonexistant.html') }}],
- [["onBeforeNavigate", "onErrorOccurred"]]);
- chrome.tabs.update(tabId, { url: getURL('failures/nonexistant.html') });
- },
-
- // An page that tries to load an non-existant iframe.
- function nonExistantIframe() {
+ // An page that tries to load an non-existent iframe.
+ function nonExistentIframe() {
expect([
{ label: "a-onBeforeNavigate",
event: "onBeforeNavigate",
@@ -84,8 +62,8 @@ function runTests() {
chrome.tabs.update(tabId, { url: getURL('failures/d.html') });
},
- // An iframe navigates to a non-existant page.
- function nonExistantIframeNavigation() {
+ // An iframe navigates to a non-existent page.
+ function nonExistentIframeNavigation() {
expect([
{ label: "a-onBeforeNavigate",
event: "onBeforeNavigate",
@@ -208,6 +186,32 @@ function runTests() {
"onErrorOccurred"]]);
chrome.tabs.update(tabId, { url: getURL('failures/e.html') });
},
+
+ // Navigates to a non-existent page (this test case must be last,
+ // otherwise the non-existant URL breaks tests that follow, since loading
+ // those test pages is seen as a non-extension -> extension URL
+ // transition, which is forbidden by web_accessible_resources enforcement
+ // in manifest version 2.)
+ function nonExistent() {
+ expect([
+ { label: "onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ processId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/nonexistent.html') }},
+ { label: "onErrorOccurred",
+ event: "onErrorOccurred",
+ details: { error: "net::ERR_FILE_NOT_FOUND",
+ frameId: 0,
+ processId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/nonexistent.html') }}],
+ [["onBeforeNavigate", "onErrorOccurred"]]);
+ chrome.tabs.update(tabId, { url: getURL('failures/nonexistent.html') });
+ },
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_filtered.html b/chrome/test/data/extensions/api_test/webnavigation/test_filtered.html
index dbf62b6..9661f3b 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_filtered.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_filtered.html
@@ -1,5 +1,2 @@
<script src="test_filtered.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_filtered.js b/chrome/test/data/extensions/api_test/webnavigation/test_filtered.js
index b262b92..66293ea 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_filtered.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_filtered.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -25,4 +25,4 @@ function runTests() {
}
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.html b/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.html
index 984b60e..7359408 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.html
@@ -1,5 +1,2 @@
<script src="test_forwardBack.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js b/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js
index 2b2c524..7364f21 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_forwardBack.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -108,4 +108,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_getFrame.html b/chrome/test/data/extensions/api_test/webnavigation/test_getFrame.html
index 70f35d8..d4ad155 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_getFrame.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_getFrame.html
@@ -1,53 +1 @@
-<script>
-var URL = chrome.extension.getURL("getFrame/a.html");
-var tabId = -1;
-var processId = -1;
-
-chrome.test.runTests([
- function testGetFrame() {
- chrome.tabs.create({"url": "about:blank"}, function(tab) {
- tabId = tab.id;
- var done = chrome.test.listenForever(
- chrome.webNavigation.onCommitted,
- function (details) {
- if (details.tabId != tabId)
- return;
- if (details.url != URL)
- return;
- processId = details.processId;
- chrome.webNavigation.getFrame(
- {tabId: tabId, frameId: 0, processId: processId},
- function(details) {
- chrome.test.assertEq({errorOccurred: false, url: URL},
- details);
- done();
- });
- });
- chrome.tabs.update(tabId, {url: URL});
- });
- },
-
- function testGetInvalidFrame() {
- chrome.webNavigation.getFrame(
- {tabId: tabId, frameId: 1, processId: processId},
- function (details) {
- chrome.test.assertEq(null, details);
- chrome.test.succeed();
- });
- },
-
- function testGetAllFrames() {
- chrome.webNavigation.getAllFrames(
- {tabId: tabId},
- function (details) {
- chrome.test.assertEq(
- [{errorOccurred: false,
- frameId: 0,
- processId: processId,
- url: URL}],
- details);
- chrome.test.succeed();
- });
- }
-]);
-</script>
+<script src="test_getFrame.js"></script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_getFrame.js b/chrome/test/data/extensions/api_test/webnavigation/test_getFrame.js
new file mode 100644
index 0000000..f9f3f22
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_getFrame.js
@@ -0,0 +1,55 @@
+// 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 URL = chrome.extension.getURL("getFrame/a.html");
+var tabId = -1;
+var processId = -1;
+
+chrome.test.runTests([
+ function testGetFrame() {
+ chrome.tabs.create({"url": "about:blank"}, function(tab) {
+ tabId = tab.id;
+ var done = chrome.test.listenForever(
+ chrome.webNavigation.onCommitted,
+ function (details) {
+ if (details.tabId != tabId)
+ return;
+ if (details.url != URL)
+ return;
+ processId = details.processId;
+ chrome.webNavigation.getFrame(
+ {tabId: tabId, frameId: 0, processId: processId},
+ function(details) {
+ chrome.test.assertEq({errorOccurred: false, url: URL},
+ details);
+ done();
+ });
+ });
+ chrome.tabs.update(tabId, {url: URL});
+ });
+ },
+
+ function testGetInvalidFrame() {
+ chrome.webNavigation.getFrame(
+ {tabId: tabId, frameId: 1, processId: processId},
+ function (details) {
+ chrome.test.assertEq(null, details);
+ chrome.test.succeed();
+ });
+ },
+
+ function testGetAllFrames() {
+ chrome.webNavigation.getAllFrames(
+ {tabId: tabId},
+ function (details) {
+ chrome.test.assertEq(
+ [{errorOccurred: false,
+ frameId: 0,
+ processId: processId,
+ url: URL}],
+ details);
+ chrome.test.succeed();
+ });
+ }
+]);
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_history.html b/chrome/test/data/extensions/api_test/webnavigation/test_history.html
index 9a11ed1..605cf9e 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_history.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_history.html
@@ -1,5 +1,2 @@
<script src="test_history.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_history.js b/chrome/test/data/extensions/api_test/webnavigation/test_history.js
index 2d4b2001..db1b8f5 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_history.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_history.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -55,4 +55,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_iframe.html b/chrome/test/data/extensions/api_test/webnavigation/test_iframe.html
index 6f076a5..6ab718c2 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_iframe.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_iframe.html
@@ -1,5 +1,2 @@
<script src="test_iframe.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js b/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js
index af72305..b500beb 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_iframe.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -349,4 +349,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_openTab.html b/chrome/test/data/extensions/api_test/webnavigation/test_openTab.html
index 1475312..4f06a0e 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_openTab.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_openTab.html
@@ -1,5 +1,2 @@
<script src="test_openTab.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js b/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js
index 707b086..43c5b4c 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_openTab.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -197,4 +197,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_prerender.html b/chrome/test/data/extensions/api_test/webnavigation/test_prerender.html
index 8b63601..42ff210 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_prerender.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_prerender.html
@@ -1,5 +1,2 @@
<script src="test_prerender.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_prerender.js b/chrome/test/data/extensions/api_test/webnavigation/test_prerender.js
index a68c730..dfed276 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_prerender.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_prerender.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
var URL_LOAD =
"http://127.0.0.1:PORT/files/prerender/prerender_loader.html";
@@ -96,4 +96,4 @@ function runTests() {
]);
});
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.html b/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.html
index b705107..82926cb 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.html
@@ -1,5 +1,2 @@
<script src="test_referenceFragment.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js b/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js
index 7366788..b5dab82 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_referenceFragment.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -55,4 +55,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.html b/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.html
index fadbdba..5619e37 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.html
@@ -1,5 +1,2 @@
<script src="test_requestOpenTab.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.js b/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.js
index cdc868e..9a297c3 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_requestOpenTab.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -90,4 +90,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.html b/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.html
index 769dc4b..e01ee2e 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.html
@@ -1,5 +1,2 @@
<script src="test_serverRedirect.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js b/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js
index 8cb7091..e05d016 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_serverRedirect.js
@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
- var getURL = chrome.extension.getURL;
+onload = function() {
var URL_LOAD =
"http://www.a.com:PORT/files/extensions/api_test/webnavigation/serverRedirect/a.html";
var URL_LOAD_REDIRECT = "http://www.a.com:PORT/server-redirect";
@@ -56,4 +55,4 @@ function runTests() {
]);
});
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.html b/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.html
index ba2236a..c7b61e8 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.html
@@ -1,5 +1,2 @@
<script src="test_simpleLoad.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js b/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js
index 094f05e..37a6eb2 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_simpleLoad.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -46,4 +46,4 @@ function runTests() {
},
]);
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.html b/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.html
index 0547ef8..3b5f1e5 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.html
@@ -1,5 +1,2 @@
<script src="test_targetBlank.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.js b/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.js
index e356087..d48cbb7 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_targetBlank.js
@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
- var getURL = chrome.extension.getURL;
+onload = function() {
var URL_LOAD =
"http://127.0.0.1:PORT/files/extensions/api_test/webnavigation/targetBlank/a.html";
var URL_TARGET =
@@ -102,4 +101,4 @@ function runTests() {
]);
});
});
-}
+};
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_userAction.html b/chrome/test/data/extensions/api_test/webnavigation/test_userAction.html
index 5520137..b78d498 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_userAction.html
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_userAction.html
@@ -1,5 +1,2 @@
<script src="test_userAction.js"></script>
<script src="framework.js"></script>
-<script>
- runTests();
-</script>
diff --git a/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js b/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js
index 7c44d43..0d51379 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_userAction.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-function runTests() {
+onload = function() {
var getURL = chrome.extension.getURL;
chrome.tabs.create({"url": "about:blank"}, function(tab) {
var tabId = tab.id;
@@ -90,4 +90,4 @@ function runTests() {
},
]);
});
-}
+};