| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 const char kRegisterPageUrl[] = "/service_worker/cross_site_xfer.html"; | 2481 const char kRegisterPageUrl[] = "/service_worker/cross_site_xfer.html"; |
| 2482 const base::string16 kOKTitle1(base::ASCIIToUTF16("OK_1")); | 2482 const base::string16 kOKTitle1(base::ASCIIToUTF16("OK_1")); |
| 2483 const base::string16 kFailTitle1(base::ASCIIToUTF16("FAIL_1")); | 2483 const base::string16 kFailTitle1(base::ASCIIToUTF16("FAIL_1")); |
| 2484 content::TitleWatcher title_watcher1(shell()->web_contents(), kOKTitle1); | 2484 content::TitleWatcher title_watcher1(shell()->web_contents(), kOKTitle1); |
| 2485 title_watcher1.AlsoWaitForTitle(kFailTitle1); | 2485 title_watcher1.AlsoWaitForTitle(kFailTitle1); |
| 2486 | 2486 |
| 2487 NavigateToURL(shell(), embedded_test_server()->GetURL(kRegisterPageUrl)); | 2487 NavigateToURL(shell(), embedded_test_server()->GetURL(kRegisterPageUrl)); |
| 2488 ASSERT_EQ(kOKTitle1, title_watcher1.WaitAndGetTitle()); | 2488 ASSERT_EQ(kOKTitle1, title_watcher1.WaitAndGetTitle()); |
| 2489 | 2489 |
| 2490 // Force process swapping behavior. | 2490 // Force process swapping behavior. |
| 2491 ShellContentBrowserClient::SetSwapProcessesForRedirect(true); | 2491 ShellContentBrowserClient::SetTransferAllNavigations(true); |
| 2492 | 2492 |
| 2493 // The second pages loads via the serviceworker including a subresource. | 2493 // The second pages loads via the serviceworker including a subresource. |
| 2494 const char kConfirmPageUrl[] = | 2494 const char kConfirmPageUrl[] = |
| 2495 "/service_worker/cross_site_xfer_scope/" | 2495 "/service_worker/cross_site_xfer_scope/" |
| 2496 "cross_site_xfer_confirm_via_serviceworker.html"; | 2496 "cross_site_xfer_confirm_via_serviceworker.html"; |
| 2497 const base::string16 kOKTitle2(base::ASCIIToUTF16("OK_2")); | 2497 const base::string16 kOKTitle2(base::ASCIIToUTF16("OK_2")); |
| 2498 const base::string16 kFailTitle2(base::ASCIIToUTF16("FAIL_2")); | 2498 const base::string16 kFailTitle2(base::ASCIIToUTF16("FAIL_2")); |
| 2499 content::TitleWatcher title_watcher2(shell()->web_contents(), kOKTitle2); | 2499 content::TitleWatcher title_watcher2(shell()->web_contents(), kOKTitle2); |
| 2500 title_watcher2.AlsoWaitForTitle(kFailTitle2); | 2500 title_watcher2.AlsoWaitForTitle(kFailTitle2); |
| 2501 | 2501 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2998 // effect in CanSuspendRenderer(). | 2998 // effect in CanSuspendRenderer(). |
| 2999 shell()->web_contents()->WasHidden(); | 2999 shell()->web_contents()->WasHidden(); |
| 3000 EXPECT_TRUE(rph->IsProcessBackgrounded()); | 3000 EXPECT_TRUE(rph->IsProcessBackgrounded()); |
| 3001 | 3001 |
| 3002 // The process which has service worker thread shouldn't be suspended. | 3002 // The process which has service worker thread shouldn't be suspended. |
| 3003 EXPECT_FALSE(memory_coordinator->CanSuspendRenderer(render_process_id)); | 3003 EXPECT_FALSE(memory_coordinator->CanSuspendRenderer(render_process_id)); |
| 3004 } | 3004 } |
| 3005 #endif | 3005 #endif |
| 3006 | 3006 |
| 3007 } // namespace content | 3007 } // namespace content |
| OLD | NEW |