Chromium Code Reviews| 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 <deque> | 5 #include <deque> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2590 // Checks that the referrer policy is used when prerendering on HTTPS. | 2590 // Checks that the referrer policy is used when prerendering on HTTPS. |
| 2591 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSSLReferrerPolicy) { | 2591 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSSLReferrerPolicy) { |
| 2592 set_use_https_src(true); | 2592 set_use_https_src(true); |
| 2593 set_loader_path("files/prerender/prerender_loader_with_referrer_policy.html"); | 2593 set_loader_path("files/prerender/prerender_loader_with_referrer_policy.html"); |
| 2594 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", | 2594 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", |
| 2595 FINAL_STATUS_USED, | 2595 FINAL_STATUS_USED, |
| 2596 1); | 2596 1); |
| 2597 NavigateToDestURL(); | 2597 NavigateToDestURL(); |
| 2598 } | 2598 } |
| 2599 | 2599 |
| 2600 // Test interaction of the webNavigation API with prerender. | 2600 // Test interaction of the webNavigation and tabs API with prerender. |
| 2601 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, | 2601 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, |
| 2602 public ExtensionApiTest { | 2602 public ExtensionApiTest { |
| 2603 public: | 2603 public: |
| 2604 PrerenderBrowserTestWithExtensions() {} | 2604 PrerenderBrowserTestWithExtensions() {} |
| 2605 virtual ~PrerenderBrowserTestWithExtensions() {} | 2605 virtual ~PrerenderBrowserTestWithExtensions() {} |
| 2606 | 2606 |
| 2607 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2607 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 2608 PrerenderBrowserTest::SetUpCommandLine(command_line); | 2608 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 2609 ExtensionApiTest::SetUpCommandLine(command_line); | 2609 ExtensionApiTest::SetUpCommandLine(command_line); |
| 2610 } | 2610 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2645 ChannelDestructionWatcher channel_close_watcher; | 2645 ChannelDestructionWatcher channel_close_watcher; |
| 2646 channel_close_watcher.WatchChannel( | 2646 channel_close_watcher.WatchChannel( |
| 2647 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); | 2647 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); |
| 2648 NavigateToDestURL(); | 2648 NavigateToDestURL(); |
| 2649 channel_close_watcher.WaitForChannelClose(); | 2649 channel_close_watcher.WaitForChannelClose(); |
| 2650 | 2650 |
| 2651 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); | 2651 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); |
| 2652 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 2652 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 2653 } | 2653 } |
| 2654 | 2654 |
| 2655 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, TabsApi) { | |
| 2656 // PrerenderBrowserTest automatically started a test server. Restart it, so | |
| 2657 // ExtensionApiTest can register its test parameters. | |
| 2658 test_server()->Stop(); | |
|
Matt Perry
2013/01/04 00:21:07
This is a little janky. Can you make it an option
justinlin
2013/01/04 12:43:50
Done.
| |
| 2659 ASSERT_TRUE(StartTestServer()); | |
| 2660 extensions::FrameNavigationState::set_allow_extension_scheme(true); | |
| 2661 | |
| 2662 // Wait for the extension to set itself up and return control to us. | |
| 2663 ASSERT_TRUE(RunExtensionSubtest("tabs/on_replaced", "on_replaced.html")) | |
| 2664 << message_; | |
| 2665 | |
| 2666 ResultCatcher catcher; | |
| 2667 | |
| 2668 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); | |
| 2669 | |
| 2670 ChannelDestructionWatcher channel_close_watcher; | |
| 2671 channel_close_watcher.WatchChannel( | |
| 2672 chrome::GetActiveWebContents(browser())->GetRenderProcessHost()); | |
| 2673 NavigateToDestURL(); | |
| 2674 channel_close_watcher.WaitForChannelClose(); | |
| 2675 | |
| 2676 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); | |
| 2677 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 2678 } | |
| 2679 | |
| 2655 } // namespace prerender | 2680 } // namespace prerender |
| OLD | NEW |