| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_tabstrip.h" | 8 #include "chrome/browser/ui/browser_tabstrip.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 IN_PROC_BROWSER_TEST_F(ContentAutofillDriverBrowserTest, | 120 IN_PROC_BROWSER_TEST_F(ContentAutofillDriverBrowserTest, |
| 121 SwitchTabAndHideAutofillPopup) { | 121 SwitchTabAndHideAutofillPopup) { |
| 122 // Notification is different on platforms. On linux this will be called twice, | 122 // Notification is different on platforms. On linux this will be called twice, |
| 123 // while on windows only once. | 123 // while on windows only once. |
| 124 EXPECT_CALL(autofill_client_, HideAutofillPopup()).Times(testing::AtLeast(1)); | 124 EXPECT_CALL(autofill_client_, HideAutofillPopup()).Times(testing::AtLeast(1)); |
| 125 | 125 |
| 126 scoped_refptr<content::MessageLoopRunner> runner = | 126 scoped_refptr<content::MessageLoopRunner> runner = |
| 127 new content::MessageLoopRunner; | 127 new content::MessageLoopRunner; |
| 128 web_contents_hidden_callback_ = runner->QuitClosure(); | 128 web_contents_hidden_callback_ = runner->QuitClosure(); |
| 129 chrome::AddSelectedTabWithURL(browser(), | 129 chrome::AddSelectedTabWithURL(browser(), |
| 130 GURL(content::kAboutBlankURL), | 130 GURL(url::kAboutBlankURL), |
| 131 content::PAGE_TRANSITION_AUTO_TOPLEVEL); | 131 content::PAGE_TRANSITION_AUTO_TOPLEVEL); |
| 132 runner->Run(); | 132 runner->Run(); |
| 133 web_contents_hidden_callback_.Reset(); | 133 web_contents_hidden_callback_.Reset(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 IN_PROC_BROWSER_TEST_F(ContentAutofillDriverBrowserTest, | 136 IN_PROC_BROWSER_TEST_F(ContentAutofillDriverBrowserTest, |
| 137 TestPageNavigationHidingAutofillPopup) { | 137 TestPageNavigationHidingAutofillPopup) { |
| 138 // Notification is different on platforms. On linux this will be called twice, | 138 // Notification is different on platforms. On linux this will be called twice, |
| 139 // while on windows only once. | 139 // while on windows only once. |
| 140 EXPECT_CALL(autofill_client_, HideAutofillPopup()).Times(testing::AtLeast(1)); | 140 EXPECT_CALL(autofill_client_, HideAutofillPopup()).Times(testing::AtLeast(1)); |
| 141 | 141 |
| 142 scoped_refptr<content::MessageLoopRunner> runner = | 142 scoped_refptr<content::MessageLoopRunner> runner = |
| 143 new content::MessageLoopRunner; | 143 new content::MessageLoopRunner; |
| 144 nav_entry_committed_callback_ = runner->QuitClosure(); | 144 nav_entry_committed_callback_ = runner->QuitClosure(); |
| 145 browser()->OpenURL(content::OpenURLParams(GURL(chrome::kChromeUIBookmarksURL), | 145 browser()->OpenURL(content::OpenURLParams(GURL(chrome::kChromeUIBookmarksURL), |
| 146 content::Referrer(), | 146 content::Referrer(), |
| 147 CURRENT_TAB, | 147 CURRENT_TAB, |
| 148 content::PAGE_TRANSITION_TYPED, | 148 content::PAGE_TRANSITION_TYPED, |
| 149 false)); | 149 false)); |
| 150 browser()->OpenURL(content::OpenURLParams(GURL(chrome::kChromeUIAboutURL), | 150 browser()->OpenURL(content::OpenURLParams(GURL(chrome::kChromeUIAboutURL), |
| 151 content::Referrer(), | 151 content::Referrer(), |
| 152 CURRENT_TAB, | 152 CURRENT_TAB, |
| 153 content::PAGE_TRANSITION_TYPED, | 153 content::PAGE_TRANSITION_TYPED, |
| 154 false)); | 154 false)); |
| 155 runner->Run(); | 155 runner->Run(); |
| 156 nav_entry_committed_callback_.Reset(); | 156 nav_entry_committed_callback_.Reset(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace autofill | 159 } // namespace autofill |
| OLD | NEW |