| 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 <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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 FilePath().AppendASCII("History"), | 453 FilePath().AppendASCII("History"), |
| 454 FilePath().AppendASCII("target.html")); | 454 FilePath().AppendASCII("target.html")); |
| 455 ui_test_utils::NavigateToURL(browser(), form); | 455 ui_test_utils::NavigateToURL(browser(), form); |
| 456 | 456 |
| 457 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); | 457 content::WebContents* web_contents = chrome::GetActiveWebContents(browser()); |
| 458 string16 expected_title(ASCIIToUTF16("Target Page")); | 458 string16 expected_title(ASCIIToUTF16("Target Page")); |
| 459 content::TitleWatcher title_watcher( | 459 content::TitleWatcher title_watcher( |
| 460 chrome::GetActiveWebContents(browser()), expected_title); | 460 chrome::GetActiveWebContents(browser()), expected_title); |
| 461 ASSERT_TRUE(content::ExecuteJavaScript( | 461 ASSERT_TRUE(content::ExecuteJavaScript( |
| 462 web_contents->GetRenderViewHost(), | 462 web_contents->GetRenderViewHost(), |
| 463 "", | 463 L"", |
| 464 "document.getElementById('form').submit()")); | 464 ASCIIToWide("document.getElementById('form').submit()"))); |
| 465 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); | 465 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); |
| 466 | 466 |
| 467 std::vector<GURL> urls(GetHistoryContents()); | 467 std::vector<GURL> urls(GetHistoryContents()); |
| 468 ASSERT_EQ(2u, urls.size()); | 468 ASSERT_EQ(2u, urls.size()); |
| 469 ASSERT_EQ(target, urls[0]); | 469 ASSERT_EQ(target, urls[0]); |
| 470 ASSERT_EQ(form, urls[1]); | 470 ASSERT_EQ(form, urls[1]); |
| 471 } | 471 } |
| 472 | 472 |
| 473 // Verify history shortcut opens only one history tab per window. Also, make | 473 // Verify history shortcut opens only one history tab per window. Also, make |
| 474 // sure that existing history tab is activated. | 474 // sure that existing history tab is activated. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 490 | 490 |
| 491 content::WebContents* active_web_contents = | 491 content::WebContents* active_web_contents = |
| 492 browser()->tab_strip_model()->GetActiveWebContents(); | 492 browser()->tab_strip_model()->GetActiveWebContents(); |
| 493 ASSERT_EQ(web_contents, active_web_contents); | 493 ASSERT_EQ(web_contents, active_web_contents); |
| 494 ASSERT_EQ(history_url, active_web_contents->GetURL()); | 494 ASSERT_EQ(history_url, active_web_contents->GetURL()); |
| 495 | 495 |
| 496 content::WebContents* second_tab = | 496 content::WebContents* second_tab = |
| 497 browser()->tab_strip_model()->GetWebContentsAt(1); | 497 browser()->tab_strip_model()->GetWebContentsAt(1); |
| 498 ASSERT_NE(history_url, second_tab->GetURL()); | 498 ASSERT_NE(history_url, second_tab->GetURL()); |
| 499 } | 499 } |
| OLD | NEW |