| 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 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2730 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", | 2730 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", |
| 2731 FINAL_STATUS_USED, | 2731 FINAL_STATUS_USED, |
| 2732 1); | 2732 1); |
| 2733 NavigateToDestURL(); | 2733 NavigateToDestURL(); |
| 2734 } | 2734 } |
| 2735 | 2735 |
| 2736 // Test interaction of the webNavigation and tabs API with prerender. | 2736 // Test interaction of the webNavigation and tabs API with prerender. |
| 2737 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, | 2737 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, |
| 2738 public ExtensionApiTest { | 2738 public ExtensionApiTest { |
| 2739 public: | 2739 public: |
| 2740 PrerenderBrowserTestWithExtensions() { | |
| 2741 autostart_test_server_ = false; | |
| 2742 } | |
| 2743 virtual ~PrerenderBrowserTestWithExtensions() {} | |
| 2744 | |
| 2745 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2740 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 2746 PrerenderBrowserTest::SetUpCommandLine(command_line); | 2741 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 2747 ExtensionApiTest::SetUpCommandLine(command_line); | 2742 ExtensionApiTest::SetUpCommandLine(command_line); |
| 2748 } | 2743 } |
| 2749 | 2744 |
| 2750 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 2745 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 2751 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); | 2746 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 2752 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 2747 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 2753 } | 2748 } |
| 2754 | 2749 |
| 2755 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 2750 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
| 2756 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture(); | 2751 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture(); |
| 2757 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); | 2752 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); |
| 2758 } | 2753 } |
| 2759 | 2754 |
| 2760 virtual void SetUpOnMainThread() OVERRIDE { | 2755 virtual void SetUpOnMainThread() OVERRIDE { |
| 2761 PrerenderBrowserTest::SetUpOnMainThread(); | 2756 PrerenderBrowserTest::SetUpOnMainThread(); |
| 2762 } | 2757 } |
| 2763 }; | 2758 }; |
| 2764 | 2759 |
| 2765 // http://crbug.com/177163 | 2760 // http://crbug.com/177163 |
| 2766 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, | 2761 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, |
| 2767 DISABLED_WebNavigation) { | 2762 DISABLED_WebNavigation) { |
| 2768 ASSERT_TRUE(StartTestServer()); | 2763 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 2769 extensions::FrameNavigationState::set_allow_extension_scheme(true); | 2764 extensions::FrameNavigationState::set_allow_extension_scheme(true); |
| 2770 | 2765 |
| 2771 CommandLine::ForCurrentProcess()->AppendSwitch( | 2766 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 2772 switches::kAllowLegacyExtensionManifests); | 2767 switches::kAllowLegacyExtensionManifests); |
| 2773 | 2768 |
| 2774 // Wait for the extension to set itself up and return control to us. | 2769 // Wait for the extension to set itself up and return control to us. |
| 2775 ASSERT_TRUE( | 2770 ASSERT_TRUE( |
| 2776 RunExtensionSubtest("webnavigation", "test_prerender.html")) << message_; | 2771 RunExtensionSubtest("webnavigation", "test_prerender.html")) << message_; |
| 2777 | 2772 |
| 2778 ResultCatcher catcher; | 2773 ResultCatcher catcher; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2789 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 2784 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 2790 } | 2785 } |
| 2791 | 2786 |
| 2792 // Fails often on Windows dbg bots. http://crbug.com/177163 | 2787 // Fails often on Windows dbg bots. http://crbug.com/177163 |
| 2793 #if defined(OS_WIN) | 2788 #if defined(OS_WIN) |
| 2794 #define MAYBE_TabsApi DISABLED_TabsApi | 2789 #define MAYBE_TabsApi DISABLED_TabsApi |
| 2795 #else | 2790 #else |
| 2796 #define MAYBE_TabsApi TabsApi | 2791 #define MAYBE_TabsApi TabsApi |
| 2797 #endif // defined(OS_WIN) | 2792 #endif // defined(OS_WIN) |
| 2798 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, MAYBE_TabsApi) { | 2793 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, MAYBE_TabsApi) { |
| 2799 ASSERT_TRUE(StartTestServer()); | 2794 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 2800 extensions::FrameNavigationState::set_allow_extension_scheme(true); | 2795 extensions::FrameNavigationState::set_allow_extension_scheme(true); |
| 2801 | 2796 |
| 2802 // Wait for the extension to set itself up and return control to us. | 2797 // Wait for the extension to set itself up and return control to us. |
| 2803 ASSERT_TRUE(RunExtensionSubtest("tabs/on_replaced", "on_replaced.html")) | 2798 ASSERT_TRUE(RunExtensionSubtest("tabs/on_replaced", "on_replaced.html")) |
| 2804 << message_; | 2799 << message_; |
| 2805 | 2800 |
| 2806 ResultCatcher catcher; | 2801 ResultCatcher catcher; |
| 2807 | 2802 |
| 2808 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); | 2803 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); |
| 2809 | 2804 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 | 2893 |
| 2899 // Checks that media source video loads are deferred on prerendering. | 2894 // Checks that media source video loads are deferred on prerendering. |
| 2900 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHTML5MediaSourceVideo) { | 2895 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHTML5MediaSourceVideo) { |
| 2901 PrerenderTestURL("files/prerender/prerender_html5_video_media_source.html", | 2896 PrerenderTestURL("files/prerender/prerender_html5_video_media_source.html", |
| 2902 FINAL_STATUS_USED, | 2897 FINAL_STATUS_USED, |
| 2903 1); | 2898 1); |
| 2904 NavigateToDestUrlAndWaitForPassTitle(); | 2899 NavigateToDestUrlAndWaitForPassTitle(); |
| 2905 } | 2900 } |
| 2906 | 2901 |
| 2907 } // namespace prerender | 2902 } // namespace prerender |
| OLD | NEW |