| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 virtual ~PrerenderBrowserTest() {} | 638 virtual ~PrerenderBrowserTest() {} |
| 639 | 639 |
| 640 content::SessionStorageNamespace* GetSessionStorageNamespace() const { | 640 content::SessionStorageNamespace* GetSessionStorageNamespace() const { |
| 641 WebContents* web_contents = | 641 WebContents* web_contents = |
| 642 current_browser()->tab_strip_model()->GetActiveWebContents(); | 642 current_browser()->tab_strip_model()->GetActiveWebContents(); |
| 643 if (!web_contents) | 643 if (!web_contents) |
| 644 return NULL; | 644 return NULL; |
| 645 return web_contents->GetController().GetDefaultSessionStorageNamespace(); | 645 return web_contents->GetController().GetDefaultSessionStorageNamespace(); |
| 646 } | 646 } |
| 647 | 647 |
| 648 virtual void SetUp() OVERRIDE { |
| 649 if (UsingAcceleratedVideoDecode()) { |
| 650 // The GPU Video Decoder needs real GL bindings. |
| 651 UseRealGLBindings(); |
| 652 } |
| 653 InProcessBrowserTest::SetUp(); |
| 654 } |
| 655 |
| 648 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 656 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 649 #if defined(FULL_SAFE_BROWSING) | 657 #if defined(FULL_SAFE_BROWSING) |
| 650 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); | 658 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); |
| 651 #endif | 659 #endif |
| 652 } | 660 } |
| 653 | 661 |
| 654 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 662 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 655 command_line->AppendSwitchASCII(switches::kPrerenderMode, | 663 command_line->AppendSwitchASCII(switches::kPrerenderMode, |
| 656 switches::kPrerenderModeSwitchValueEnabled); | 664 switches::kPrerenderModeSwitchValueEnabled); |
| 657 #if defined(OS_MACOSX) | 665 #if defined(OS_MACOSX) |
| (...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", | 2743 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", |
| 2736 FINAL_STATUS_USED, | 2744 FINAL_STATUS_USED, |
| 2737 1); | 2745 1); |
| 2738 NavigateToDestURL(); | 2746 NavigateToDestURL(); |
| 2739 } | 2747 } |
| 2740 | 2748 |
| 2741 // Test interaction of the webNavigation and tabs API with prerender. | 2749 // Test interaction of the webNavigation and tabs API with prerender. |
| 2742 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, | 2750 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, |
| 2743 public ExtensionApiTest { | 2751 public ExtensionApiTest { |
| 2744 public: | 2752 public: |
| 2753 virtual void SetUp() OVERRIDE { |
| 2754 PrerenderBrowserTest::SetUp(); |
| 2755 } |
| 2756 |
| 2745 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2757 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 2746 PrerenderBrowserTest::SetUpCommandLine(command_line); | 2758 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 2747 ExtensionApiTest::SetUpCommandLine(command_line); | 2759 ExtensionApiTest::SetUpCommandLine(command_line); |
| 2748 } | 2760 } |
| 2749 | 2761 |
| 2750 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 2762 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 2751 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); | 2763 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 2752 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 2764 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 2753 } | 2765 } |
| 2754 | 2766 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2917 PrerenderTestURL("files/prerender/prerender_page.html", | 2929 PrerenderTestURL("files/prerender/prerender_page.html", |
| 2918 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); | 2930 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); |
| 2919 WebContents* web_contents = | 2931 WebContents* web_contents = |
| 2920 current_browser()->tab_strip_model()->GetActiveWebContents(); | 2932 current_browser()->tab_strip_model()->GetActiveWebContents(); |
| 2921 web_contents->IncrementCapturerCount(); | 2933 web_contents->IncrementCapturerCount(); |
| 2922 NavigateToDestURLWithDisposition(CURRENT_TAB, false); | 2934 NavigateToDestURLWithDisposition(CURRENT_TAB, false); |
| 2923 web_contents->DecrementCapturerCount(); | 2935 web_contents->DecrementCapturerCount(); |
| 2924 } | 2936 } |
| 2925 | 2937 |
| 2926 } // namespace prerender | 2938 } // namespace prerender |
| OLD | NEW |