| Index: chrome/test/data/extensions/api_test/webnavigation/test_failures.js
|
| 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 357b1490d26a9edd883f75d26b4253128e0b2347..4b33bd8a41dd896ed6cb2a77381b2444cccf8960 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') });
|
| + },
|
| ]);
|
| });
|
| -}
|
| +};
|
|
|