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

Side by Side Diff: chrome/browser/history/history_browsertest.cc

Issue 10941050: Second try of 157576 https://chromiumcodereview.appspot.com/10780013/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
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 <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 469
470 std::vector<GURL> urls(GetHistoryContents()); 470 std::vector<GURL> urls(GetHistoryContents());
471 ASSERT_EQ(2u, urls.size()); 471 ASSERT_EQ(2u, urls.size());
472 ASSERT_EQ(target, urls[0]); 472 ASSERT_EQ(target, urls[0]);
473 ASSERT_EQ(form, urls[1]); 473 ASSERT_EQ(form, urls[1]);
474 } 474 }
475 475
476 // Verify history shortcut opens only one history tab per window. Also, make 476 // Verify history shortcut opens only one history tab per window. Also, make
477 // sure that existing history tab is activated. 477 // sure that existing history tab is activated.
478 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, OneHistoryTabPerWindow) { 478 IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, OneHistoryTabPerWindow) {
479 GURL history_url("chrome://chrome/history/"); 479 GURL history_url(chrome::kChromeUIHistoryURL);
480 480
481 // Even after navigate completes, the currently-active tab title is 481 // Even after navigate completes, the currently-active tab title is
482 // 'Loading...' for a brief time while the history page loads. 482 // 'Loading...' for a brief time while the history page loads.
483 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); 483 content::WebContents* web_contents = chrome::GetActiveWebContents(browser());
484 string16 expected_title(ASCIIToUTF16("History")); 484 string16 expected_title(ASCIIToUTF16("History"));
485 content::TitleWatcher title_watcher(web_contents, expected_title); 485 content::TitleWatcher title_watcher(web_contents, expected_title);
486 chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY); 486 chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY);
487 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); 487 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
488 488
489 ui_test_utils::NavigateToURLWithDisposition( 489 ui_test_utils::NavigateToURLWithDisposition(
490 browser(), GURL(chrome::kAboutBlankURL), NEW_FOREGROUND_TAB, 490 browser(), GURL(chrome::kAboutBlankURL), NEW_FOREGROUND_TAB,
491 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 491 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
492 chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY); 492 chrome::ExecuteCommand(browser(), IDC_SHOW_HISTORY);
493 493
494 content::WebContents* active_web_contents = 494 content::WebContents* active_web_contents =
495 chrome::GetActiveWebContents(browser()); 495 chrome::GetActiveWebContents(browser());
496 ASSERT_EQ(web_contents, active_web_contents); 496 ASSERT_EQ(web_contents, active_web_contents);
497 ASSERT_EQ(history_url, active_web_contents->GetURL()); 497 ASSERT_EQ(history_url, active_web_contents->GetURL());
498 498
499 TabContents* second_tab = browser()->tab_strip_model()->GetTabContentsAt(1); 499 TabContents* second_tab = browser()->tab_strip_model()->GetTabContentsAt(1);
500 ASSERT_NE(history_url, second_tab->web_contents()->GetURL()); 500 ASSERT_NE(history_url, second_tab->web_contents()->GetURL());
501 } 501 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/lazy_background_page_apitest.cc ('k') | chrome/browser/ui/browser_navigator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698