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

Unified Diff: chrome/browser/extensions/error_console/error_console_browsertest.cc

Issue 133003003: Make ErrorConsole catch errors from Extension WebContents Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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/browser/extensions/error_console/error_console_browsertest.cc
diff --git a/chrome/browser/extensions/error_console/error_console_browsertest.cc b/chrome/browser/extensions/error_console/error_console_browsertest.cc
index fbdef8093ab672824c5be5f6413ec04b96a3c648..c403cdf8ce456f24dd20fc86aecb566cf567ebbf 100644
--- a/chrome/browser/extensions/error_console/error_console_browsertest.cc
+++ b/chrome/browser/extensions/error_console/error_console_browsertest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/url_constants.h"
#include "chrome/test/base/ui_test_utils.h"
#include "extensions/browser/extension_error.h"
#include "extensions/common/constants.h"
@@ -187,10 +188,15 @@ class ErrorConsoleBrowserTest : public ExtensionBrowserTest {
// The type of action which we take after we load an extension in order to
// cause any errors.
enum Action {
- ACTION_NAVIGATE, // navigate to a page to allow a content script to run.
- ACTION_BROWSER_ACTION, // simulate a browser action click.
- ACTION_NONE // Do nothing (errors will be caused by a background script,
- // or by a manifest/loading warning).
+ // Navigate to a (non-chrome) page to allow a content script to run.
+ ACTION_NAVIGATE,
+ // Simulate a browser action click.
+ ACTION_BROWSER_ACTION,
+ // Navigate to the new tab page.
+ ACTION_NEW_TAB,
Yoyo Zhou 2014/01/22 01:38:19 I think this is ok, but in the future we might wan
Devlin 2014/01/22 01:58:10 Yeah, I was wondering the same thing. I think, fo
+ // Do nothing (errors will be caused by a background script,
+ // or by a manifest/loading warning).
+ ACTION_NONE
};
virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
@@ -246,6 +252,11 @@ class ErrorConsoleBrowserTest : public ExtensionBrowserTest {
*extension, browser(), NULL, true);
break;
}
+ case ACTION_NEW_TAB: {
+ ui_test_utils::NavigateToURL(browser(),
+ GURL(chrome::kChromeUINewTabURL));
+ break;
+ }
case ACTION_NONE:
break;
default:
@@ -520,4 +531,14 @@ IN_PROC_BROWSER_TEST_F(ErrorConsoleBrowserTest, BadAPIPermissionsRuntimeError) {
5u, 1u);
}
+IN_PROC_BROWSER_TEST_F(ErrorConsoleBrowserTest, BadExtensionPage) {
+ const Extension* extension = NULL;
+ LoadExtensionAndCheckErrors(
+ "bad_extension_page",
+ kNoFlags,
+ 1, // One error: the page will load JS which has a reference error.
+ ACTION_NEW_TAB,
+ &extension);
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698