Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 619 &y)); | 619 &y)); |
| 620 | 620 |
| 621 gfx::Point point(x, y); | 621 gfx::Point point(x, y); |
| 622 content::WebContents* web_contents = | 622 content::WebContents* web_contents = |
| 623 browser()->tab_strip_model()->GetActiveWebContents(); | 623 browser()->tab_strip_model()->GetActiveWebContents(); |
| 624 | 624 |
| 625 content::WindowedNotificationObserver observer( | 625 content::WindowedNotificationObserver observer( |
| 626 chrome::NOTIFICATION_TAB_ADDED, | 626 chrome::NOTIFICATION_TAB_ADDED, |
| 627 content::NotificationService::AllSources()); | 627 content::NotificationService::AllSources()); |
| 628 content::SimulateMouseClickAt(web_contents, 0, | 628 content::SimulateMouseClickAt(web_contents, 0, |
| 629 blink::WebMouseEvent::ButtonMiddle, point); | 629 blink::WebMouseEvent::ButtonMiddle, point); |
|
Lei Zhang
2016/07/14 22:57:52
Do you want to add another test for ctrl + left cl
jaepark
2016/07/15 00:23:56
Done.
| |
| 630 observer.Wait(); | 630 observer.Wait(); |
| 631 | 631 |
| 632 int tab_count = browser()->tab_strip_model()->count(); | 632 int tab_count = browser()->tab_strip_model()->count(); |
| 633 ASSERT_EQ(2, tab_count); | 633 ASSERT_EQ(2, tab_count); |
| 634 | 634 |
| 635 // TODO(jaepark): Middle mouse clicking on a link should not change | 635 content::WebContents* active_web_contents = |
| 636 // the focus of the tab. See http://crbug.com/628054. | 636 browser()->tab_strip_model()->GetActiveWebContents(); |
| 637 ASSERT_EQ(web_contents, active_web_contents); | |
| 638 | |
| 639 | |
| 637 content::WebContents* new_web_contents = | 640 content::WebContents* new_web_contents = |
| 638 browser()->tab_strip_model()->GetActiveWebContents(); | 641 browser()->tab_strip_model()->GetWebContentsAt(1); |
| 642 ASSERT_TRUE(new_web_contents); | |
| 639 ASSERT_NE(web_contents, new_web_contents); | 643 ASSERT_NE(web_contents, new_web_contents); |
| 640 | 644 |
| 641 const GURL& url = new_web_contents->GetURL(); | 645 const GURL& url = new_web_contents->GetURL(); |
| 642 ASSERT_EQ(std::string("http://www.example.com/"), url.spec()); | 646 ASSERT_EQ(std::string("http://www.example.com/"), url.spec()); |
| 643 } | 647 } |
| OLD | NEW |