| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <deque> | 6 #include <deque> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 was_hidden_(false), | 480 was_hidden_(false), |
| 481 was_shown_(false), | 481 was_shown_(false), |
| 482 should_be_shown_(expected_final_status == FINAL_STATUS_USED), | 482 should_be_shown_(expected_final_status == FINAL_STATUS_USED), |
| 483 skip_final_checks_(false) { | 483 skip_final_checks_(false) { |
| 484 } | 484 } |
| 485 | 485 |
| 486 ~TestPrerenderContents() override { | 486 ~TestPrerenderContents() override { |
| 487 if (skip_final_checks_) | 487 if (skip_final_checks_) |
| 488 return; | 488 return; |
| 489 | 489 |
| 490 if (expected_final_status_ == FINAL_STATUS_MAX) { | 490 EXPECT_EQ(expected_final_status_, final_status()) |
| 491 EXPECT_EQ(MATCH_COMPLETE_REPLACEMENT, match_complete_status()); | 491 << " when testing URL " << prerender_url().path() |
| 492 } else { | 492 << " (Expected: " << NameFromFinalStatus(expected_final_status_) |
| 493 EXPECT_EQ(expected_final_status_, final_status()) << | 493 << ", Actual: " << NameFromFinalStatus(final_status()) << ")"; |
| 494 " when testing URL " << prerender_url().path() << | 494 |
| 495 " (Expected: " << NameFromFinalStatus(expected_final_status_) << | |
| 496 ", Actual: " << NameFromFinalStatus(final_status()) << ")"; | |
| 497 } | |
| 498 // Prerendering RenderViewHosts should be hidden before the first | 495 // Prerendering RenderViewHosts should be hidden before the first |
| 499 // navigation, so this should be happen for every PrerenderContents for | 496 // navigation, so this should be happen for every PrerenderContents for |
| 500 // which a RenderViewHost is created, regardless of whether or not it's | 497 // which a RenderViewHost is created, regardless of whether or not it's |
| 501 // used. | 498 // used. |
| 502 if (new_render_view_host_) | 499 if (new_render_view_host_) |
| 503 EXPECT_TRUE(was_hidden_); | 500 EXPECT_TRUE(was_hidden_); |
| 504 | 501 |
| 505 // A used PrerenderContents will only be destroyed when we swap out | 502 // A used PrerenderContents will only be destroyed when we swap out |
| 506 // WebContents, at the end of a navigation caused by a call to | 503 // WebContents, at the end of a navigation caused by a call to |
| 507 // NavigateToURLImpl(). | 504 // NavigateToURLImpl(). |
| (...skipping 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3973 browser()->tab_strip_model()->GetActiveWebContents(); | 3970 browser()->tab_strip_model()->GetActiveWebContents(); |
| 3974 bool display_test_result = false; | 3971 bool display_test_result = false; |
| 3975 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, | 3972 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(web_contents, |
| 3976 "DidDisplayReallyPass()", | 3973 "DidDisplayReallyPass()", |
| 3977 &display_test_result)); | 3974 &display_test_result)); |
| 3978 ASSERT_TRUE(display_test_result); | 3975 ASSERT_TRUE(display_test_result); |
| 3979 } | 3976 } |
| 3980 #endif // !defined(DISABLE_NACL) | 3977 #endif // !defined(DISABLE_NACL) |
| 3981 | 3978 |
| 3982 } // namespace prerender | 3979 } // namespace prerender |
| OLD | NEW |