| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/browser_list.h" | 6 #include "chrome/browser/browser_list.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
| 9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/renderer_host/render_view_host.h" | |
| 12 #include "chrome/browser/tab_contents/tab_contents.h" | |
| 13 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/test/ui_test_utils.h" | 13 #include "chrome/test/ui_test_utils.h" |
| 14 #include "content/browser/renderer_host/render_view_host.h" |
| 15 #include "content/browser/tab_contents/tab_contents.h" |
| 16 #include "net/base/mock_host_resolver.h" | 16 #include "net/base/mock_host_resolver.h" |
| 17 | 17 |
| 18 class AppApiTest : public ExtensionApiTest { | 18 class AppApiTest : public ExtensionApiTest { |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 // Simulates a page calling window.open on an URL, and waits for the navigation. | 21 // Simulates a page calling window.open on an URL, and waits for the navigation. |
| 22 static void WindowOpenHelper(Browser* browser, | 22 static void WindowOpenHelper(Browser* browser, |
| 23 RenderViewHost* opener_host, | 23 RenderViewHost* opener_host, |
| 24 const GURL& url, | 24 const GURL& url, |
| 25 bool newtab_process_should_equal_opener) { | 25 bool newtab_process_should_equal_opener) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // 3 tabs, including the initial about:blank. The last 2 should be the same | 175 // 3 tabs, including the initial about:blank. The last 2 should be the same |
| 176 // process. | 176 // process. |
| 177 ASSERT_EQ(3, browser()->tab_count()); | 177 ASSERT_EQ(3, browser()->tab_count()); |
| 178 EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", | 178 EXPECT_EQ("/files/extensions/api_test/app_process/path1/empty.html", |
| 179 browser()->GetTabContentsAt(2)->controller(). | 179 browser()->GetTabContentsAt(2)->controller(). |
| 180 GetLastCommittedEntry()->url().path()); | 180 GetLastCommittedEntry()->url().path()); |
| 181 RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); | 181 RenderViewHost* host = browser()->GetTabContentsAt(1)->render_view_host(); |
| 182 EXPECT_EQ(host->process(), | 182 EXPECT_EQ(host->process(), |
| 183 browser()->GetTabContentsAt(2)->render_view_host()->process()); | 183 browser()->GetTabContentsAt(2)->render_view_host()->process()); |
| 184 } | 184 } |
| OLD | NEW |