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

Unified Diff: chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc

Issue 275783002: Fix an ExtensionPopup crash on browser window close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build. Created 6 years, 7 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/browser_action_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
diff --git a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
index 5fd505d8ed660d5e19a7b891c898041c02608c7d..e8415b807a55333b7a25c716b5101f91f924a700 100644
--- a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
+++ b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
@@ -263,5 +263,30 @@ IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, TabSwitchClosesPopup) {
EXPECT_FALSE(BrowserActionTestUtil(browser()).HasPopup());
}
+#if defined(TOOLKIT_VIEWS)
+// Test closing the browser while inspecting an extension popup with dev tools.
+IN_PROC_BROWSER_TEST_F(BrowserActionInteractiveTest, CloseBrowserWithDevTools) {
+ if (!ShouldRunPopupTest())
+ return;
+
+ // Load a first extension that can open a popup.
+ ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
+ "browser_action/popup")));
+ const Extension* extension = GetSingleLoadedExtension();
+ ASSERT_TRUE(extension) << message_;
+
+ // Open an extension popup by clicking the browser action button.
+ content::WindowedNotificationObserver frame_observer(
+ content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
+ content::NotificationService::AllSources());
+ BrowserActionTestUtil(browser()).InspectPopup(0);
+ frame_observer.Wait();
+ EXPECT_TRUE(BrowserActionTestUtil(browser()).HasPopup());
+
+ // Close the browser window, this should not cause a crash.
+ chrome::CloseWindow(browser());
+}
+#endif // TOOLKIT_VIEWS
+
} // namespace
} // namespace extensions
« no previous file with comments | « no previous file | chrome/browser/extensions/browser_action_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698