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 3398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3409 // the hanging request to be scheduled. | 3409 // the hanging request to be scheduled. |
3410 ui_test_utils::NavigateToURLWithDisposition( | 3410 ui_test_utils::NavigateToURLWithDisposition( |
3411 current_browser(), kNoCommitUrl, NEW_FOREGROUND_TAB, | 3411 current_browser(), kNoCommitUrl, NEW_FOREGROUND_TAB, |
3412 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | 3412 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
3413 hang_loop.Run(); | 3413 hang_loop.Run(); |
3414 | 3414 |
3415 // Now interrupt that navigation and navigate to the destination URL. This | 3415 // Now interrupt that navigation and navigate to the destination URL. This |
3416 // should forcibly complete the previous navigation and also complete a | 3416 // should forcibly complete the previous navigation and also complete a |
3417 // WOULD_HAVE_BEEN_PRERENDERED navigation. | 3417 // WOULD_HAVE_BEEN_PRERENDERED navigation. |
3418 NavigateToDestURL(); | 3418 NavigateToDestURL(); |
3419 histogram_tester().ExpectTotalCount("Prerender.none_PerceivedPLT", 2); | 3419 histogram_tester().ExpectTotalCount("Prerender.none_PerceivedPLT", 1); |
3420 histogram_tester().ExpectTotalCount("Prerender.none_PerceivedPLTMatched", 0); | 3420 histogram_tester().ExpectTotalCount("Prerender.none_PerceivedPLTMatched", 0); |
3421 histogram_tester().ExpectTotalCount( | 3421 histogram_tester().ExpectTotalCount( |
3422 "Prerender.none_PerceivedPLTMatchedComplete", 0); | 3422 "Prerender.none_PerceivedPLTMatchedComplete", 0); |
3423 histogram_tester().ExpectTotalCount("Prerender.websame_PerceivedPLT", 1); | 3423 histogram_tester().ExpectTotalCount("Prerender.websame_PerceivedPLT", 1); |
3424 histogram_tester().ExpectTotalCount("Prerender.websame_PerceivedPLTMatched", | 3424 histogram_tester().ExpectTotalCount("Prerender.websame_PerceivedPLTMatched", |
3425 0); | 3425 0); |
3426 histogram_tester().ExpectTotalCount( | 3426 histogram_tester().ExpectTotalCount( |
3427 "Prerender.websame_PerceivedPLTMatchedComplete", 1); | 3427 "Prerender.websame_PerceivedPLTMatchedComplete", 1); |
3428 } | 3428 } |
3429 | 3429 |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4428 | 4428 |
4429 // Navigate to the URL entered. | 4429 // Navigate to the URL entered. |
4430 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); | 4430 omnibox_view->model()->AcceptInput(CURRENT_TAB, false); |
4431 | 4431 |
4432 // Prerender should be running, but abandoned. | 4432 // Prerender should be running, but abandoned. |
4433 EXPECT_TRUE( | 4433 EXPECT_TRUE( |
4434 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); | 4434 GetAutocompleteActionPredictor()->IsPrerenderAbandonedForTesting()); |
4435 } | 4435 } |
4436 | 4436 |
4437 } // namespace prerender | 4437 } // namespace prerender |
OLD | NEW |