| 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 "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 10 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 browser()->tab_strip_model()->GetWebContentsAt(2)-> | 369 browser()->tab_strip_model()->GetWebContentsAt(2)-> |
| 370 GetRenderProcessHost()); | 370 GetRenderProcessHost()); |
| 371 } | 371 } |
| 372 | 372 |
| 373 // Tests that app process switching works properly in the following scenario: | 373 // Tests that app process switching works properly in the following scenario: |
| 374 // 1. navigate to a page1 in the app | 374 // 1. navigate to a page1 in the app |
| 375 // 2. page1 redirects to a page2 outside the app extent (ie, "/server-redirect") | 375 // 2. page1 redirects to a page2 outside the app extent (ie, "/server-redirect") |
| 376 // 3. page2 redirects back to a page in the app | 376 // 3. page2 redirects back to a page in the app |
| 377 // The final navigation should end up in the app process. | 377 // The final navigation should end up in the app process. |
| 378 // See http://crbug.com/61757 | 378 // See http://crbug.com/61757 |
| 379 // Flaky on Linux. http://crbug.com/341898 | 379 // Flaky. http://crbug.com/341898 |
| 380 #if defined(OS_LINUX) | 380 IN_PROC_BROWSER_TEST_F(AppApiTest, DISABLED_AppProcessRedirectBack) { |
| 381 #define MAYBE_AppProcessRedirectBack DISABLED_AppProcessRedirectBack | |
| 382 #else | |
| 383 #define MAYBE_AppProcessRedirectBack AppProcessRedirectBack | |
| 384 #endif | |
| 385 IN_PROC_BROWSER_TEST_F(AppApiTest, MAYBE_AppProcessRedirectBack) { | |
| 386 host_resolver()->AddRule("*", "127.0.0.1"); | 381 host_resolver()->AddRule("*", "127.0.0.1"); |
| 387 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 382 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
| 388 | 383 |
| 389 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app_process"))); | 384 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("app_process"))); |
| 390 | 385 |
| 391 // Open two tabs in the app. | 386 // Open two tabs in the app. |
| 392 GURL base_url = GetTestBaseURL("app_process"); | 387 GURL base_url = GetTestBaseURL("app_process"); |
| 393 | 388 |
| 394 chrome::NewTab(browser()); | 389 chrome::NewTab(browser()); |
| 395 ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path1/empty.html")); | 390 ui_test_utils::NavigateToURL(browser(), base_url.Resolve("path1/empty.html")); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 // Navigate the popup to another process outside the app. | 866 // Navigate the popup to another process outside the app. |
| 872 GURL non_app_url(base_url.Resolve("path3/empty.html")); | 867 GURL non_app_url(base_url.Resolve("path3/empty.html")); |
| 873 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); | 868 ui_test_utils::NavigateToURL(active_browser_list->get(1), non_app_url); |
| 874 SiteInstance* new_instance = popup_contents->GetSiteInstance(); | 869 SiteInstance* new_instance = popup_contents->GetSiteInstance(); |
| 875 EXPECT_NE(app_instance, new_instance); | 870 EXPECT_NE(app_instance, new_instance); |
| 876 | 871 |
| 877 // It should still be in the same BrowsingInstance, allowing postMessage to | 872 // It should still be in the same BrowsingInstance, allowing postMessage to |
| 878 // work. | 873 // work. |
| 879 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); | 874 EXPECT_TRUE(app_instance->IsRelatedSiteInstance(new_instance)); |
| 880 } | 875 } |
| OLD | NEW |