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

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 existing tests 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..a9cd20f1dffbb7daf0e863db45d5bbd257987416 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/test_failures.js
@@ -2,34 +2,12 @@
// 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() {
expect([
@@ -208,6 +186,32 @@ function runTests() {
"onErrorOccurred"]]);
chrome.tabs.update(tabId, { url: getURL('failures/e.html') });
},
+
+ // Navigates to a non-existant page (this test case must be last,
miket_OOO 2012/08/06 22:33:28 non-existent
Mihai Parparita -not on Chrome 2012/08/09 23:04:08 Fixed all.
+ // otherwise the non-existed URL breaks tests that follow, since loading
miket_OOO 2012/08/06 22:33:28 non-existent (or maybe non-existing?)
+ // 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 nonExistant() {
miket_OOO 2012/08/06 22:33:28 nonExistent
+ expect([
+ { label: "onBeforeNavigate",
+ event: "onBeforeNavigate",
+ details: { frameId: 0,
+ processId: 0,
+ tabId: 0,
+ timeStamp: 0,
+ url: getURL('failures/nonexistant.html') }},
miket_OOO 2012/08/06 22:33:28 nonexistent.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') }}],
miket_OOO 2012/08/06 22:33:28 etc.
+ [["onBeforeNavigate", "onErrorOccurred"]]);
+ chrome.tabs.update(tabId, { url: getURL('failures/nonexistant.html') });
+ },
]);
});
-}
+};

Powered by Google App Engine
This is Rietveld 408576698