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

Side by Side Diff: chrome/browser/extensions/renderer_initialization_browsertest.cc

Issue 2211213002: Revert of [Extensions] Ensure ordering of extension [un]loaded, activated messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/extension_browsertest.h"
6 #include "chrome/browser/extensions/extension_service.h"
7 #include "chrome/browser/ui/tabs/tab_strip_model.h"
8 #include "chrome/test/base/ui_test_utils.h"
9 #include "content/public/test/browser_test_utils.h"
10
11 namespace extensions {
12
13 // Test that opening a window with an extension recorded as active, then
14 // unloading the extension, all before the renderer is fully initialized,
15 // doesn't crash. This addresses crbug.com/528026, where messages could be sent
16 // out of order if an extension unloaded before the activation message was sent.
17 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest,
18 TestRendererStartupWithConflictingMessages) {
19 // Load up an extension an begin opening an URL to a page within it. Since
20 // this will be an extension tab, the extension will be active within that
21 // process.
22 const Extension* extension =
23 LoadExtension(test_data_dir_.AppendASCII("simple_with_file"));
24 ASSERT_TRUE(extension);
25 GURL url = extension->GetResourceURL("file.html");
26 browser()->OpenURL(content::OpenURLParams(url, content::Referrer(),
27 NEW_FOREGROUND_TAB,
28 ui::PAGE_TRANSITION_TYPED, false));
29 // Without waiting for the tab to finish, unload the extension.
30 extension_service()->UnloadExtension(extension->id(),
31 UnloadedExtensionInfo::REASON_TERMINATE);
32 content::WebContents* web_contents =
33 browser()->tab_strip_model()->GetActiveWebContents();
34 // Wait for the web contents to stop loading.
35 content::WaitForLoadStop(web_contents);
36 EXPECT_EQ(url, web_contents->GetLastCommittedURL());
37 ASSERT_FALSE(web_contents->IsCrashed());
38 }
39
40 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698