Index: chrome/browser/extensions/api/tabs/tabs_test.cc |
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc |
index e8e64fab3e5847b655fc39b38f5d82c4957192f9..77edc9141e5f55cbc70c0acdf791f30346c8ac9f 100644 |
--- a/chrome/browser/extensions/api/tabs/tabs_test.cc |
+++ b/chrome/browser/extensions/api/tabs/tabs_test.cc |
@@ -2164,10 +2164,11 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowsCreateVsSiteInstance) { |
{ |
content::WebContentsAddedObserver observer; |
ASSERT_TRUE(content::ExecuteScript(old_contents, |
- "window.name = 'test-name';\n" |
+ "window.name = 'old-contents';\n" |
"chrome.windows.create({url: '" + |
extension_url.spec() + "'})")); |
new_contents = observer.GetWebContents(); |
+ ASSERT_TRUE(content::WaitForLoadStop(new_contents)); |
} |
// Verify that the old and new tab are in the same process and SiteInstance. |
@@ -2184,6 +2185,16 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WindowsCreateVsSiteInstance) { |
new_contents, "window.domAutomationController.send(!!window.opener)", |
&window_opener_cast_to_bool)); |
EXPECT_FALSE(window_opener_cast_to_bool); |
+ |
+ // Verify that |new_contents| can find |old_contents| using window.open/name. |
+ std::string location_of_other_window; |
+ EXPECT_TRUE(ExecuteScriptAndExtractString( |
+ new_contents, |
+ "var w = window.open('', 'old-contents');\n" |
+ "window.domAutomationController.send(w.location.href);", |
+ &location_of_other_window)); |
+ EXPECT_EQ(old_contents->GetMainFrame()->GetLastCommittedURL().spec(), |
+ location_of_other_window); |
} |
} // namespace extensions |