| 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 // TODO(danakj): The GPU Video Decoder needs real GL bindings. |
| 650 // crbug.com/269087 |
| 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 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", | 2744 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", |
| 2737 FINAL_STATUS_USED, | 2745 FINAL_STATUS_USED, |
| 2738 1); | 2746 1); |
| 2739 NavigateToDestURL(); | 2747 NavigateToDestURL(); |
| 2740 } | 2748 } |
| 2741 | 2749 |
| 2742 // Test interaction of the webNavigation and tabs API with prerender. | 2750 // Test interaction of the webNavigation and tabs API with prerender. |
| 2743 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, | 2751 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, |
| 2744 public ExtensionApiTest { | 2752 public ExtensionApiTest { |
| 2745 public: | 2753 public: |
| 2754 virtual void SetUp() OVERRIDE { |
| 2755 PrerenderBrowserTest::SetUp(); |
| 2756 } |
| 2757 |
| 2746 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2758 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 2747 PrerenderBrowserTest::SetUpCommandLine(command_line); | 2759 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 2748 ExtensionApiTest::SetUpCommandLine(command_line); | 2760 ExtensionApiTest::SetUpCommandLine(command_line); |
| 2749 } | 2761 } |
| 2750 | 2762 |
| 2751 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 2763 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 2752 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); | 2764 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 2753 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 2765 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 2754 } | 2766 } |
| 2755 | 2767 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2934 PrerenderTestURL("files/prerender/prerender_page.html", | 2946 PrerenderTestURL("files/prerender/prerender_page.html", |
| 2935 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); | 2947 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); |
| 2936 WebContents* web_contents = | 2948 WebContents* web_contents = |
| 2937 current_browser()->tab_strip_model()->GetActiveWebContents(); | 2949 current_browser()->tab_strip_model()->GetActiveWebContents(); |
| 2938 web_contents->IncrementCapturerCount(); | 2950 web_contents->IncrementCapturerCount(); |
| 2939 NavigateToDestURLWithDisposition(CURRENT_TAB, false); | 2951 NavigateToDestURLWithDisposition(CURRENT_TAB, false); |
| 2940 web_contents->DecrementCapturerCount(); | 2952 web_contents->DecrementCapturerCount(); |
| 2941 } | 2953 } |
| 2942 | 2954 |
| 2943 } // namespace prerender | 2955 } // namespace prerender |
| OLD | NEW |