| 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 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2671 | 2671 |
| 2672 // Test interaction of the webNavigation and tabs API with prerender. | 2672 // Test interaction of the webNavigation and tabs API with prerender. |
| 2673 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, | 2673 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, |
| 2674 public ExtensionApiTest { | 2674 public ExtensionApiTest { |
| 2675 public: | 2675 public: |
| 2676 PrerenderBrowserTestWithExtensions() { | 2676 PrerenderBrowserTestWithExtensions() { |
| 2677 autostart_test_server_ = false; | 2677 autostart_test_server_ = false; |
| 2678 } | 2678 } |
| 2679 virtual ~PrerenderBrowserTestWithExtensions() {} | 2679 virtual ~PrerenderBrowserTestWithExtensions() {} |
| 2680 | 2680 |
| 2681 protected: |
| 2681 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2682 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 2682 PrerenderBrowserTest::SetUpCommandLine(command_line); | 2683 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 2683 ExtensionApiTest::SetUpCommandLine(command_line); | 2684 ExtensionApiTest::SetUpCommandLine(command_line); |
| 2684 } | 2685 } |
| 2685 | 2686 |
| 2686 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 2687 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 2687 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); | 2688 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 2688 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 2689 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 2689 } | 2690 } |
| 2690 | 2691 |
| 2691 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 2692 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
| 2692 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture(); | 2693 PrerenderBrowserTest::TearDownInProcessBrowserTestFixture(); |
| 2693 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); | 2694 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); |
| 2694 } | 2695 } |
| 2695 | 2696 |
| 2696 virtual void SetUpOnMainThread() OVERRIDE { | 2697 virtual void SetUpOnMainThread() OVERRIDE { |
| 2697 PrerenderBrowserTest::SetUpOnMainThread(); | 2698 PrerenderBrowserTest::SetUpOnMainThread(); |
| 2699 ExtensionApiTest::SetUpOnMainThread(); |
| 2700 } |
| 2701 |
| 2702 virtual void CleanUpOnMainThread() OVERRIDE { |
| 2703 PrerenderBrowserTest::CleanUpOnMainThread(); |
| 2704 ExtensionApiTest::CleanUpOnMainThread(); |
| 2698 } | 2705 } |
| 2699 }; | 2706 }; |
| 2700 | 2707 |
| 2701 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, WebNavigation) { | 2708 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTestWithExtensions, WebNavigation) { |
| 2702 ASSERT_TRUE(StartTestServer()); | 2709 ASSERT_TRUE(StartTestServer()); |
| 2703 extensions::FrameNavigationState::set_allow_extension_scheme(true); | 2710 extensions::FrameNavigationState::set_allow_extension_scheme(true); |
| 2704 | 2711 |
| 2705 CommandLine::ForCurrentProcess()->AppendSwitch( | 2712 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 2706 switches::kAllowLegacyExtensionManifests); | 2713 switches::kAllowLegacyExtensionManifests); |
| 2707 | 2714 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2781 // Checks that non-http/https main page redirects cancel the prerender. | 2788 // Checks that non-http/https main page redirects cancel the prerender. |
| 2782 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, | 2789 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, |
| 2783 PrerenderCancelMainFrameRedirectUnsupportedScheme) { | 2790 PrerenderCancelMainFrameRedirectUnsupportedScheme) { |
| 2784 GURL url = test_server()->GetURL( | 2791 GURL url = test_server()->GetURL( |
| 2785 CreateServerRedirect("invalidscheme://www.google.com/test.html")); | 2792 CreateServerRedirect("invalidscheme://www.google.com/test.html")); |
| 2786 PrerenderTestURL(url, FINAL_STATUS_UNSUPPORTED_SCHEME, 1); | 2793 PrerenderTestURL(url, FINAL_STATUS_UNSUPPORTED_SCHEME, 1); |
| 2787 NavigateToDestURL(); | 2794 NavigateToDestURL(); |
| 2788 } | 2795 } |
| 2789 | 2796 |
| 2790 } // namespace prerender | 2797 } // namespace prerender |
| OLD | NEW |