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 | |
4369 // Checks that closing the omnibox popup cancels an omnibox prerender. | 4363 // Checks that closing the omnibox popup cancels an omnibox prerender. |
| 4364 // http://crbug.com/395152 |
4370 IN_PROC_BROWSER_TEST_F(PrerenderOmniboxBrowserTest, | 4365 IN_PROC_BROWSER_TEST_F(PrerenderOmniboxBrowserTest, |
4371 MAYBE_PrerenderOmniboxCancel) { | 4366 DISABLED_PrerenderOmniboxCancel) { |
4372 // Ensure the cookie store has been loaded. | 4367 // Ensure the cookie store has been loaded. |
4373 if (!GetPrerenderManager()->cookie_store_loaded()) { | 4368 if (!GetPrerenderManager()->cookie_store_loaded()) { |
4374 base::RunLoop loop; | 4369 base::RunLoop loop; |
4375 GetPrerenderManager()->set_on_cookie_store_loaded_cb_for_testing( | 4370 GetPrerenderManager()->set_on_cookie_store_loaded_cb_for_testing( |
4376 loop.QuitClosure()); | 4371 loop.QuitClosure()); |
4377 loop.Run(); | 4372 loop.Run(); |
4378 } | 4373 } |
4379 | 4374 |
4380 // Fake an omnibox prerender. | 4375 // Fake an omnibox prerender. |
4381 scoped_ptr<TestPrerender> prerender = StartOmniboxPrerender( | 4376 scoped_ptr<TestPrerender> prerender = StartOmniboxPrerender( |
4382 test_server()->GetURL("files/empty.html"), | 4377 test_server()->GetURL("files/empty.html"), |
4383 FINAL_STATUS_CANCELLED); | 4378 FINAL_STATUS_CANCELLED); |
4384 | 4379 |
4385 // Revert the location bar. This should cancel the prerender. | 4380 // Revert the location bar. This should cancel the prerender. |
4386 GetLocationBar()->Revert(); | 4381 GetLocationBar()->Revert(); |
4387 prerender->WaitForStop(); | 4382 prerender->WaitForStop(); |
4388 } | 4383 } |
4389 | 4384 |
4390 // Crashes on windows. The failure seems to be that the PrerenderOmniboxAbandon | |
4391 // test is setting up a call to the windows API RegisterApplicationRestart with | |
4392 // a command line that is too long (> 1024 characters). | |
4393 #if defined(OS_WIN) || defined(OS_MACOSX) | |
4394 #define MAYBE_PrerenderOmniboxAbandon DISABLED_PrerenderOmniboxAbandon | |
4395 #else | |
4396 #define MAYBE_PrerenderOmniboxAbandon PrerenderOmniboxAbandon | |
4397 #endif | |
4398 | |
4399 // Checks that accepting omnibox input abandons an omnibox prerender. | 4385 // Checks that accepting omnibox input abandons an omnibox prerender. |
| 4386 // http://crbug.com/394592 |
4400 IN_PROC_BROWSER_TEST_F(PrerenderOmniboxBrowserTest, | 4387 IN_PROC_BROWSER_TEST_F(PrerenderOmniboxBrowserTest, |
4401 MAYBE_PrerenderOmniboxAbandon) { | 4388 DISABLED_PrerenderOmniboxAbandon) { |
4402 // Set the abandon timeout to something high so it does not introduce | 4389 // Set the abandon timeout to something high so it does not introduce |
4403 // flakiness if the prerender times out before the test completes. | 4390 // flakiness if the prerender times out before the test completes. |
4404 GetPrerenderManager()->mutable_config().abandon_time_to_live = | 4391 GetPrerenderManager()->mutable_config().abandon_time_to_live = |
4405 base::TimeDelta::FromDays(999); | 4392 base::TimeDelta::FromDays(999); |
4406 | 4393 |
4407 // Ensure the cookie store has been loaded. | 4394 // Ensure the cookie store has been loaded. |
4408 if (!GetPrerenderManager()->cookie_store_loaded()) { | 4395 if (!GetPrerenderManager()->cookie_store_loaded()) { |
4409 base::RunLoop loop; | 4396 base::RunLoop loop; |
4410 GetPrerenderManager()->set_on_cookie_store_loaded_cb_for_testing( | 4397 GetPrerenderManager()->set_on_cookie_store_loaded_cb_for_testing( |
4411 loop.QuitClosure()); | 4398 loop.QuitClosure()); |
(...skipping 21 matching lines...) Expand all Loading... |
4433 | 4420 |
4434 // Navigate to the URL entered. | 4421 // Navigate to the URL entered. |
4435 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); | 4422 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); |
4436 | 4423 |
4437 // Prerender should be running, but abandoned. | 4424 // Prerender should be running, but abandoned. |
4438 EXPECT_TRUE( | 4425 EXPECT_TRUE( |
4439 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); | 4426 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); |
4440 } | 4427 } |
4441 | 4428 |
4442 } // namespace prerender | 4429 } // namespace prerender |
OLD | NEW |