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/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 4342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4353 WebContents* web_contents = GetActiveWebContents(); | 4353 WebContents* web_contents = GetActiveWebContents(); |
4354 GetAutocompleteActionPredictor()->StartPrerendering( | 4354 GetAutocompleteActionPredictor()->StartPrerendering( |
4355 url, | 4355 url, |
4356 web_contents->GetController().GetSessionStorageNamespaceMap(), | 4356 web_contents->GetController().GetSessionStorageNamespaceMap(), |
4357 gfx::Size(50, 50)); | 4357 gfx::Size(50, 50)); |
4358 prerender->WaitForStart(); | 4358 prerender->WaitForStart(); |
4359 return prerender.Pass(); | 4359 return prerender.Pass(); |
4360 } | 4360 } |
4361 }; | 4361 }; |
4362 | 4362 |
| 4363 // Times out on Mac at minimum. http://crbug.com/395152 |
| 4364 #if defined(OS_MACOSX) |
| 4365 #define MAYBE_PrerenderOmniboxCancel DISABLED_PrerenderOmniboxCancel |
| 4366 #else |
| 4367 #define MAYBE_PrerenderOmniboxCancel PrerenderOmniboxCancel |
| 4368 #endif |
4363 // Checks that closing the omnibox popup cancels an omnibox prerender. | 4369 // Checks that closing the omnibox popup cancels an omnibox prerender. |
4364 IN_PROC_BROWSER_TEST_F(PrerenderOmniboxBrowserTest, PrerenderOmniboxCancel) { | 4370 IN_PROC_BROWSER_TEST_F(PrerenderOmniboxBrowserTest, |
| 4371 MAYBE_PrerenderOmniboxCancel) { |
4365 // Ensure the cookie store has been loaded. | 4372 // Ensure the cookie store has been loaded. |
4366 if (!GetPrerenderManager()->cookie_store_loaded()) { | 4373 if (!GetPrerenderManager()->cookie_store_loaded()) { |
4367 base::RunLoop loop; | 4374 base::RunLoop loop; |
4368 GetPrerenderManager()->set_on_cookie_store_loaded_cb_for_testing( | 4375 GetPrerenderManager()->set_on_cookie_store_loaded_cb_for_testing( |
4369 loop.QuitClosure()); | 4376 loop.QuitClosure()); |
4370 loop.Run(); | 4377 loop.Run(); |
4371 } | 4378 } |
4372 | 4379 |
4373 // Fake an omnibox prerender. | 4380 // Fake an omnibox prerender. |
4374 scoped_ptr<TestPrerender> prerender = StartOmniboxPrerender( | 4381 scoped_ptr<TestPrerender> prerender = StartOmniboxPrerender( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4426 | 4433 |
4427 // Navigate to the URL entered. | 4434 // Navigate to the URL entered. |
4428 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); | 4435 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); |
4429 | 4436 |
4430 // Prerender should be running, but abandoned. | 4437 // Prerender should be running, but abandoned. |
4431 EXPECT_TRUE( | 4438 EXPECT_TRUE( |
4432 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); | 4439 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); |
4433 } | 4440 } |
4434 | 4441 |
4435 } // namespace prerender | 4442 } // namespace prerender |
OLD | NEW |