| 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 // The GPU Video Decoder needs real GL bindings. |
| 650 UseRealGLBindings(); |
| 651 |
| 652 InProcessBrowserTest::SetUp(); |
| 653 } |
| 654 |
| 648 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 655 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 649 #if defined(FULL_SAFE_BROWSING) | 656 #if defined(FULL_SAFE_BROWSING) |
| 650 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); | 657 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); |
| 651 #endif | 658 #endif |
| 652 } | 659 } |
| 653 | 660 |
| 654 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 661 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 655 command_line->AppendSwitchASCII(switches::kPrerenderMode, | 662 command_line->AppendSwitchASCII(switches::kPrerenderMode, |
| 656 switches::kPrerenderModeSwitchValueEnabled); | 663 switches::kPrerenderModeSwitchValueEnabled); |
| 657 #if defined(OS_MACOSX) | 664 #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", | 2742 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", |
| 2736 FINAL_STATUS_USED, | 2743 FINAL_STATUS_USED, |
| 2737 1); | 2744 1); |
| 2738 NavigateToDestURL(); | 2745 NavigateToDestURL(); |
| 2739 } | 2746 } |
| 2740 | 2747 |
| 2741 // Test interaction of the webNavigation and tabs API with prerender. | 2748 // Test interaction of the webNavigation and tabs API with prerender. |
| 2742 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, | 2749 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, |
| 2743 public ExtensionApiTest { | 2750 public ExtensionApiTest { |
| 2744 public: | 2751 public: |
| 2752 virtual void SetUp() OVERRIDE { |
| 2753 PrerenderBrowserTest::SetUp(); |
| 2754 ExtensionApiTest::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 |