| Index: chrome/browser/ui/panels/panel_browsertest.cc
|
| diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc
|
| index 1f397bebba23989f3890a976e8ef393c9dbcbe3a..96fb50037ceafb2656c2a36d76ce04cca5d3f773 100644
|
| --- a/chrome/browser/ui/panels/panel_browsertest.cc
|
| +++ b/chrome/browser/ui/panels/panel_browsertest.cc
|
| @@ -1689,3 +1689,22 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_Accelerator) {
|
| signal.Wait();
|
| EXPECT_EQ(0, panel_manager->num_panels());
|
| }
|
| +
|
| +// Tests that icon loading might not be completed when the panel is closed.
|
| +// (crbug.com/151484)
|
| +IN_PROC_BROWSER_TEST_F(PanelBrowserTest, ClosePanelBeforeIconLoadingCompleted) {
|
| + // Create a test extension from the manifest with icons provided.
|
| + scoped_refptr<Extension> extension = LoadExtensionFromManifest(
|
| + FILE_PATH_LITERAL("test_extension/manifest.json"));
|
| + std::string extension_app_name =
|
| + web_app::GenerateApplicationNameFromExtensionId(extension->id());
|
| +
|
| + // Create a panel with the extension as host.
|
| + CreatePanelParams params(extension_app_name, gfx::Rect(), SHOW_AS_INACTIVE);
|
| + // Do not wait because we want to close the panel before the callback to
|
| + // signal the icon loading completion is executed.
|
| + params.wait_for_fully_created = false;
|
| + Panel* panel = CreatePanelWithParams(params);
|
| +
|
| + panel->Close();
|
| +}
|
|
|