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

Unified Diff: chrome/test/data/extensions/api_test/webnavigation/test_failures.js

Issue 10826157: Check for warnings when loading extensions in browser tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ExtensionTerminalPrivateApiTest.TerminalTest Created 8 years, 4 months 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/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') });
+ },
]);
});
-}
+};

Powered by Google App Engine
This is Rietveld 408576698