Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 1977463002: Prerender: Remove MatchComplete status. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698