OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 11 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_commands.h" | 13 #include "chrome/browser/ui/browser_commands.h" |
14 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
15 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
16 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/test/base/ui_test_utils.h" | 19 #include "chrome/test/base/ui_test_utils.h" |
| 20 #include "components/sync/api/string_ordinal.h" |
20 #include "content/public/browser/navigation_entry.h" | 21 #include "content/public/browser/navigation_entry.h" |
21 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
22 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
23 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
24 #include "content/public/browser/site_instance.h" | 25 #include "content/public/browser/site_instance.h" |
25 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
26 #include "content/public/test/browser_test_utils.h" | 27 #include "content/public/test/browser_test_utils.h" |
27 #include "content/public/test/test_navigation_observer.h" | 28 #include "content/public/test/test_navigation_observer.h" |
28 #include "extensions/browser/extension_host.h" | 29 #include "extensions/browser/extension_host.h" |
29 #include "extensions/browser/extension_system.h" | 30 #include "extensions/browser/extension_system.h" |
30 #include "extensions/browser/install_flag.h" | 31 #include "extensions/browser/install_flag.h" |
31 #include "extensions/browser/process_map.h" | 32 #include "extensions/browser/process_map.h" |
32 #include "extensions/common/extension.h" | 33 #include "extensions/common/extension.h" |
33 #include "extensions/common/file_util.h" | 34 #include "extensions/common/file_util.h" |
34 #include "extensions/common/switches.h" | 35 #include "extensions/common/switches.h" |
35 #include "net/dns/mock_host_resolver.h" | 36 #include "net/dns/mock_host_resolver.h" |
36 #include "net/test/embedded_test_server/embedded_test_server.h" | 37 #include "net/test/embedded_test_server/embedded_test_server.h" |
37 #include "sync/api/string_ordinal.h" | |
38 | 38 |
39 using content::NavigationController; | 39 using content::NavigationController; |
40 using content::RenderViewHost; | 40 using content::RenderViewHost; |
41 using content::SiteInstance; | 41 using content::SiteInstance; |
42 using content::WebContents; | 42 using content::WebContents; |
43 using extensions::Extension; | 43 using extensions::Extension; |
44 | 44 |
45 class AppApiTest : public ExtensionApiTest { | 45 class AppApiTest : public ExtensionApiTest { |
46 protected: | 46 protected: |
47 // Gets the base URL for files for a specific test, making sure that it uses | 47 // Gets the base URL for files for a specific test, making sure that it uses |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 // Navigate the popup to another process outside the app. | 852 // Navigate the popup to another process outside the app. |
853 GURL non_app_url(base_url.Resolve("path3/empty.html")); | 853 GURL non_app_url(base_url.Resolve("path3/empty.html")); |
854 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); | 854 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); |
855 SiteInstance* new_instance = popup_contents->GetSiteInstance(); | 855 SiteInstance* new_instance = popup_contents->GetSiteInstance(); |
856 EXPECT_NE(app_instance, new_instance); | 856 EXPECT_NE(app_instance, new_instance); |
857 | 857 |
858 // It should still be in the same BrowsingInstance, allowing postMessage to | 858 // It should still be in the same BrowsingInstance, allowing postMessage to |
859 // work. | 859 // work. |
860 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); | 860 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); |
861 } | 861 } |
OLD | NEW |