Chromium Code Reviews| Index: chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc |
| diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc |
| index d2101d8366a1c62b04bde1fedd6356b9b6204faa..3303b01d669ff91b2362b792fea8a743d7156c91 100644 |
| --- a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc |
| +++ b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc |
| @@ -419,7 +419,7 @@ IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, OpenLinkInProfileEntryPresent) { |
| } |
| // Create one additional profile, but do not yet open windows in it. |
| - CreateSecondaryProfile(1); |
| + Profile* profile1 = CreateSecondaryProfile(1); |
|
Peter Kasting
2016/06/22 22:53:21
Nit: There's no |profile2|, so just call this |pro
|
| { |
| std::unique_ptr<TestRenderViewContextMenu> menu( |
| @@ -429,8 +429,24 @@ IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, OpenLinkInProfileEntryPresent) { |
| ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB)); |
| ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW)); |
| ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_COPYLINKLOCATION)); |
| - // With two profiles (the current and another profile), no submenu is |
| - // created. Instead, a single item is added to the main context menu. |
| + // With the second profile not open, no entry is created. |
| + ASSERT_FALSE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKINPROFILE)); |
| + ASSERT_FALSE(menu->IsItemPresent(IDC_OPEN_LINK_IN_PROFILE_FIRST)); |
| + } |
| + |
| + profiles::FindOrCreateNewWindowForProfile( |
| + profile1, chrome::startup::IS_NOT_PROCESS_STARTUP, |
| + chrome::startup::IS_NOT_FIRST_RUN, false); |
| + |
| + { |
| + std::unique_ptr<TestRenderViewContextMenu> menu( |
| + CreateContextMenuMediaTypeNone(GURL("http://www.google.com/"), |
| + GURL("http://www.google.com/"))); |
| + |
| + ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB)); |
| + ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW)); |
| + ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_COPYLINKLOCATION)); |
| + // With the second profile open, an inline menu entry is created. |
| ASSERT_FALSE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKINPROFILE)); |
| ASSERT_TRUE(menu->IsItemPresent(IDC_OPEN_LINK_IN_PROFILE_FIRST)); |
| } |