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 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 class PrerenderBrowserTest : virtual public InProcessBrowserTest { | 504 class PrerenderBrowserTest : virtual public InProcessBrowserTest { |
505 public: | 505 public: |
506 PrerenderBrowserTest() | 506 PrerenderBrowserTest() |
507 : prerender_contents_factory_(NULL), | 507 : prerender_contents_factory_(NULL), |
508 #if defined(ENABLE_SAFE_BROWSING) | 508 #if defined(ENABLE_SAFE_BROWSING) |
509 safe_browsing_factory_(new TestSafeBrowsingServiceFactory()), | 509 safe_browsing_factory_(new TestSafeBrowsingServiceFactory()), |
510 #endif | 510 #endif |
511 use_https_src_server_(false), | 511 use_https_src_server_(false), |
512 call_javascript_(true), | 512 call_javascript_(true), |
513 loader_path_("files/prerender/prerender_loader.html"), | 513 loader_path_("files/prerender/prerender_loader.html"), |
514 explicitly_set_browser_(NULL) { | 514 explicitly_set_browser_(NULL) {} |
515 EnableDOMAutomation(); | |
516 } | |
517 | 515 |
518 virtual ~PrerenderBrowserTest() {} | 516 virtual ~PrerenderBrowserTest() {} |
519 | 517 |
520 content::SessionStorageNamespace* GetSessionStorageNamespace() const { | 518 content::SessionStorageNamespace* GetSessionStorageNamespace() const { |
521 TabContents* tab_contents = | 519 TabContents* tab_contents = |
522 current_browser()->tab_strip_model()->GetActiveTabContents(); | 520 current_browser()->tab_strip_model()->GetActiveTabContents(); |
523 if (!tab_contents) | 521 if (!tab_contents) |
524 return NULL; | 522 return NULL; |
525 return tab_contents->web_contents()->GetRenderViewHost()-> | 523 return tab_contents->web_contents()->GetRenderViewHost()-> |
526 GetSessionStorageNamespace(); | 524 GetSessionStorageNamespace(); |
(...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 ResultCatcher catcher; | 2366 ResultCatcher catcher; |
2369 | 2367 |
2370 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); | 2368 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); |
2371 NavigateToDestURL(); | 2369 NavigateToDestURL(); |
2372 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); | 2370 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); |
2373 | 2371 |
2374 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 2372 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
2375 } | 2373 } |
2376 | 2374 |
2377 } // namespace prerender | 2375 } // namespace prerender |
OLD | NEW |