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 "chrome/browser/prerender/prerender_test_utils.h" | 5 #include "chrome/browser/prerender/prerender_test_utils.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" | 8 #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" |
9 #include "chrome/browser/prerender/prerender_manager.h" | 9 #include "chrome/browser/prerender/prerender_manager.h" |
10 #include "chrome/browser/prerender/prerender_manager_factory.h" | 10 #include "chrome/browser/prerender/prerender_manager_factory.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 safe_browsing_factory_( | 407 safe_browsing_factory_( |
408 base::MakeUnique<safe_browsing::TestSafeBrowsingServiceFactory>()), | 408 base::MakeUnique<safe_browsing::TestSafeBrowsingServiceFactory>()), |
409 prerender_contents_factory_(nullptr), | 409 prerender_contents_factory_(nullptr), |
410 explicitly_set_browser_(nullptr), | 410 explicitly_set_browser_(nullptr), |
411 autostart_test_server_(true) {} | 411 autostart_test_server_(true) {} |
412 | 412 |
413 PrerenderInProcessBrowserTest::~PrerenderInProcessBrowserTest() {} | 413 PrerenderInProcessBrowserTest::~PrerenderInProcessBrowserTest() {} |
414 | 414 |
415 void PrerenderInProcessBrowserTest::SetUpCommandLine( | 415 void PrerenderInProcessBrowserTest::SetUpCommandLine( |
416 base::CommandLine* command_line) { | 416 base::CommandLine* command_line) { |
417 command_line->AppendSwitch(switches::kEnablePepperTesting); | 417 ASSERT_TRUE(ppapi::RegisterFlashTestPlugin(command_line)); |
418 command_line->AppendSwitchASCII(switches::kOverridePluginPowerSaverForTesting, | |
419 "ignore-list"); | |
420 ASSERT_TRUE(ppapi::RegisterPowerSaverTestPlugin(command_line)); | |
421 } | 418 } |
422 | 419 |
423 void PrerenderInProcessBrowserTest::TearDownInProcessBrowserTestFixture() { | 420 void PrerenderInProcessBrowserTest::TearDownInProcessBrowserTestFixture() { |
424 safe_browsing::SafeBrowsingService::RegisterFactory(nullptr); | 421 safe_browsing::SafeBrowsingService::RegisterFactory(nullptr); |
425 } | 422 } |
426 | 423 |
427 content::SessionStorageNamespace* | 424 content::SessionStorageNamespace* |
428 PrerenderInProcessBrowserTest::GetSessionStorageNamespace() const { | 425 PrerenderInProcessBrowserTest::GetSessionStorageNamespace() const { |
429 content::WebContents* web_contents = GetActiveWebContents(); | 426 content::WebContents* web_contents = GetActiveWebContents(); |
430 if (!web_contents) | 427 if (!web_contents) |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file) { | 535 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file) { |
539 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 536 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
540 net::URLRequestFilter::GetInstance()->AddUrlInterceptor( | 537 net::URLRequestFilter::GetInstance()->AddUrlInterceptor( |
541 url, net::URLRequestMockHTTPJob::CreateInterceptorForSingleFile( | 538 url, net::URLRequestMockHTTPJob::CreateInterceptorForSingleFile( |
542 file, content::BrowserThread::GetBlockingPool())); | 539 file, content::BrowserThread::GetBlockingPool())); |
543 } | 540 } |
544 | 541 |
545 } // namespace test_utils | 542 } // namespace test_utils |
546 | 543 |
547 } // namespace prerender | 544 } // namespace prerender |
OLD | NEW |