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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_apitest.cc

Issue 13572005: Fix crash when incognito split mode extension using the WebRequest API was reloaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_request/web_request_apitest.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_apitest.cc b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
index c64d0bdc74cf3733bf8bef9d48d6c2f547f58c28..2f53bb582c77c81054e1b1fc17fb5c24c08384f0 100644
--- a/chrome/browser/extensions/api/web_request/web_request_apitest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -272,3 +272,31 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
DeclarativeSendMessage) {
ASSERT_TRUE(RunExtensionTest("webrequest_sendmessage")) << message_;
}
+
+// Check that reloading an extension that runs in incognito split mode and
+// has two active background pages with registered events does not crash the
+// browser. Regression test for http://crbug.com/224094
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, IncognitoSplitModeReload) {
+ // Wait for rules to be set up.
+ ExtensionTestMessageListener listener("done", true);
+ ExtensionTestMessageListener listener_incognito("done_incognito", true);
+
+ const extensions::Extension* extension = LoadExtensionWithFlags(
+ test_data_dir_.AppendASCII("webrequest_reload"),
+ kFlagEnableIncognito);
+ ASSERT_TRUE(extension);
+ ui_test_utils::OpenURLOffTheRecord(browser()->profile(), GURL("about:blank"));
+
+ EXPECT_TRUE(listener.WaitUntilSatisfied());
+ EXPECT_TRUE(listener_incognito.WaitUntilSatisfied());
+
+ // Reload extension and wait for rules to be set up again. This should not
+ // crash the browser.
+ ExtensionTestMessageListener listener2("done", true);
+ ExtensionTestMessageListener listener_incognito2("done_incognito", true);
+
+ ReloadExtension(extension->id());
+
+ EXPECT_TRUE(listener2.WaitUntilSatisfied());
+ EXPECT_TRUE(listener_incognito2.WaitUntilSatisfied());
+}
« no previous file with comments | « no previous file | chrome/browser/extensions/event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698