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