| 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 | |
| 656 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 648 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 657 #if defined(FULL_SAFE_BROWSING) | 649 #if defined(FULL_SAFE_BROWSING) |
| 658 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); | 650 SafeBrowsingService::RegisterFactory(safe_browsing_factory_.get()); |
| 659 #endif | 651 #endif |
| 660 } | 652 } |
| 661 | 653 |
| 662 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 654 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 663 command_line->AppendSwitchASCII(switches::kPrerenderMode, | 655 command_line->AppendSwitchASCII(switches::kPrerenderMode, |
| 664 switches::kPrerenderModeSwitchValueEnabled); | 656 switches::kPrerenderModeSwitchValueEnabled); |
| 665 #if defined(OS_MACOSX) | 657 #if defined(OS_MACOSX) |
| (...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2743 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", | 2735 PrerenderTestURL("files/prerender/prerender_referrer_policy.html", |
| 2744 FINAL_STATUS_USED, | 2736 FINAL_STATUS_USED, |
| 2745 1); | 2737 1); |
| 2746 NavigateToDestURL(); | 2738 NavigateToDestURL(); |
| 2747 } | 2739 } |
| 2748 | 2740 |
| 2749 // Test interaction of the webNavigation and tabs API with prerender. | 2741 // Test interaction of the webNavigation and tabs API with prerender. |
| 2750 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, | 2742 class PrerenderBrowserTestWithExtensions : public PrerenderBrowserTest, |
| 2751 public ExtensionApiTest { | 2743 public ExtensionApiTest { |
| 2752 public: | 2744 public: |
| 2753 virtual void SetUp() OVERRIDE { | |
| 2754 PrerenderBrowserTest::SetUp(); | |
| 2755 } | |
| 2756 | |
| 2757 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 2745 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 2758 PrerenderBrowserTest::SetUpCommandLine(command_line); | 2746 PrerenderBrowserTest::SetUpCommandLine(command_line); |
| 2759 ExtensionApiTest::SetUpCommandLine(command_line); | 2747 ExtensionApiTest::SetUpCommandLine(command_line); |
| 2760 } | 2748 } |
| 2761 | 2749 |
| 2762 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 2750 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 2763 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); | 2751 PrerenderBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 2764 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 2752 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 2765 } | 2753 } |
| 2766 | 2754 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2945 PrerenderTestURL("files/prerender/prerender_page.html", | 2933 PrerenderTestURL("files/prerender/prerender_page.html", |
| 2946 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); | 2934 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); |
| 2947 WebContents* web_contents = | 2935 WebContents* web_contents = |
| 2948 current_browser()->tab_strip_model()->GetActiveWebContents(); | 2936 current_browser()->tab_strip_model()->GetActiveWebContents(); |
| 2949 web_contents->IncrementCapturerCount(); | 2937 web_contents->IncrementCapturerCount(); |
| 2950 NavigateToDestURLWithDisposition(CURRENT_TAB, false); | 2938 NavigateToDestURLWithDisposition(CURRENT_TAB, false); |
| 2951 web_contents->DecrementCapturerCount(); | 2939 web_contents->DecrementCapturerCount(); |
| 2952 } | 2940 } |
| 2953 | 2941 |
| 2954 } // namespace prerender | 2942 } // namespace prerender |
| OLD | NEW |