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

Side by Side Diff: chrome/browser/pdf/pdf_extension_test.cc

Issue 2149153003: Links in PDF should be opened in new background tabs when ctrl + left clicked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/pdf/navigator.js » ('j') | chrome/browser/resources/pdf/pdf.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698