| 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 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2476 base::Bind(&ClearBrowsingData, current_browser(), | 2476 base::Bind(&ClearBrowsingData, current_browser(), |
| 2477 BrowsingDataRemover::REMOVE_HISTORY)); | 2477 BrowsingDataRemover::REMOVE_HISTORY)); |
| 2478 content::RunMessageLoop(); | 2478 content::RunMessageLoop(); |
| 2479 | 2479 |
| 2480 // Make sure prerender history was cleared. | 2480 // Make sure prerender history was cleared. |
| 2481 EXPECT_EQ(0, GetHistoryLength()); | 2481 EXPECT_EQ(0, GetHistoryLength()); |
| 2482 } | 2482 } |
| 2483 | 2483 |
| 2484 // Checks that when the cache is cleared, prerenders are cancelled but | 2484 // Checks that when the cache is cleared, prerenders are cancelled but |
| 2485 // prerendering history is not cleared. | 2485 // prerendering history is not cleared. |
| 2486 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderClearCache) { | 2486 // Flaky/times out on linux_aura, win, mac - http://crbug.com/270948 |
| 2487 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, DISABLED_PrerenderClearCache) { |
| 2487 PrerenderTestURL("files/prerender/prerender_page.html", | 2488 PrerenderTestURL("files/prerender/prerender_page.html", |
| 2488 FINAL_STATUS_CACHE_OR_HISTORY_CLEARED, | 2489 FINAL_STATUS_CACHE_OR_HISTORY_CLEARED, |
| 2489 1); | 2490 1); |
| 2490 | 2491 |
| 2491 // Post a task to clear the cache, and run the message loop until it | 2492 // Post a task to clear the cache, and run the message loop until it |
| 2492 // destroys the prerender. | 2493 // destroys the prerender. |
| 2493 base::MessageLoop::current()->PostTask(FROM_HERE, | 2494 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 2494 base::Bind(&ClearBrowsingData, current_browser(), | 2495 base::Bind(&ClearBrowsingData, current_browser(), |
| 2495 BrowsingDataRemover::REMOVE_CACHE)); | 2496 BrowsingDataRemover::REMOVE_CACHE)); |
| 2496 content::RunMessageLoop(); | 2497 content::RunMessageLoop(); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2945 PrerenderTestURL("files/prerender/prerender_page.html", | 2946 PrerenderTestURL("files/prerender/prerender_page.html", |
| 2946 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); | 2947 FINAL_STATUS_PAGE_BEING_CAPTURED, 1); |
| 2947 WebContents* web_contents = | 2948 WebContents* web_contents = |
| 2948 current_browser()->tab_strip_model()->GetActiveWebContents(); | 2949 current_browser()->tab_strip_model()->GetActiveWebContents(); |
| 2949 web_contents->IncrementCapturerCount(); | 2950 web_contents->IncrementCapturerCount(); |
| 2950 NavigateToDestURLWithDisposition(CURRENT_TAB, false); | 2951 NavigateToDestURLWithDisposition(CURRENT_TAB, false); |
| 2951 web_contents->DecrementCapturerCount(); | 2952 web_contents->DecrementCapturerCount(); |
| 2952 } | 2953 } |
| 2953 | 2954 |
| 2954 } // namespace prerender | 2955 } // namespace prerender |
| OLD | NEW |