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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/event_router.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 6 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/extensions/extension_test_message_listener.h" 10 #include "chrome/browser/extensions/extension_test_message_listener.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, PostData2) { 265 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, PostData2) {
266 // Test HTML form POST data access with the multipart and plaintext encoding. 266 // Test HTML form POST data access with the multipart and plaintext encoding.
267 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_post2.html")) << 267 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_post2.html")) <<
268 message_; 268 message_;
269 } 269 }
270 270
271 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, 271 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
272 DeclarativeSendMessage) { 272 DeclarativeSendMessage) {
273 ASSERT_TRUE(RunExtensionTest("webrequest_sendmessage")) << message_; 273 ASSERT_TRUE(RunExtensionTest("webrequest_sendmessage")) << message_;
274 } 274 }
275
276 // Check that reloading an extension that runs in incognito split mode and
277 // has two active background pages with registered events does not crash the
278 // browser. Regression test for http://crbug.com/224094
279 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, IncognitoSplitModeReload) {
280 // Wait for rules to be set up.
281 ExtensionTestMessageListener listener("done", true);
282 ExtensionTestMessageListener listener_incognito("done_incognito", true);
283
284 const extensions::Extension* extension = LoadExtensionWithFlags(
285 test_data_dir_.AppendASCII("webrequest_reload"),
286 kFlagEnableIncognito);
287 ASSERT_TRUE(extension);
288 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), GURL("about:blank"));
289
290 EXPECT_TRUE(listener.WaitUntilSatisfied());
291 EXPECT_TRUE(listener_incognito.WaitUntilSatisfied());
292
293 // Reload extension and wait for rules to be set up again. This should not
294 // crash the browser.
295 ExtensionTestMessageListener listener2("done", true);
296 ExtensionTestMessageListener listener_incognito2("done_incognito", true);
297
298 ReloadExtension(extension->id());
299
300 EXPECT_TRUE(listener2.WaitUntilSatisfied());
301 EXPECT_TRUE(listener_incognito2.WaitUntilSatisfied());
302 }
OLDNEW
« 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